iTextSharp.text.pdf.security.DigestAlgorithms.GetDigest C# (CSharp) Method

GetDigest() public static method

public static GetDigest ( String oid ) : String
oid String
return String
        public static String GetDigest(String oid)
        {
            String ret;
            if (digestNames.TryGetValue(oid, out ret))
                return ret;
            else
                return oid;
        }

Usage Example

 /**
  * Creates an ExternalSignature instance
  * @param pk    a PrivateKey object
  * @param hashAlgorithm the hash algorithm (e.g. "SHA-1", "SHA-256",...)
  * @param provider  the security provider (e.g. "BC")
  */
 public PrivateKeySignature(ICipherParameters pk, String hashAlgorithm)
 {
     this.pk            = pk;
     this.hashAlgorithm = DigestAlgorithms.GetDigest(DigestAlgorithms.GetAllowedDigests(hashAlgorithm));
     if (pk is RsaKeyParameters)
     {
         encryptionAlgorithm = "RSA";
     }
     else if (pk is DsaKeyParameters)
     {
         encryptionAlgorithm = "DSA";
     }
     else
     {
         throw new ArgumentException(MessageLocalization.GetComposedMessage("unknown.key.algorithm.1", pk.ToString()));
     }
 }
All Usage Examples Of iTextSharp.text.pdf.security.DigestAlgorithms::GetDigest