Show / Hide Table of Contents

# Class DigestAlgorithm

##### Inheritance

object
DigestAlgorithm

##### Inherited Members

object.Equals(object)
object.Equals(object, object)
object.GetHashCode()
object.GetType()
object.MemberwiseClone()
object.ReferenceEquals(object, object)
object.ToString()

###### Namespace: pdftron.Crypto

###### Assembly: PDFTronDotNet.dll

##### Syntax

    public static class DigestAlgorithm

### Methods

#### CalculateDigest(Type, byte[])

##### Declaration

    public static byte[] CalculateDigest(DigestAlgorithm.Type in_digest_algorithm_type, byte[] in_message_buf)

##### Parameters

Type | Name | Description
--- | --- | ---
DigestAlgorithm.Type | in_digest_algorithm_type |
byte[] | in_message_buf |

##### Returns

Type | Description
--- | ---
byte[] |

#### SignDigest(byte[], Type, byte[], string)

Sign the digest of arbitrary data with private key in the provided PKCS #12 key file (.pfx). This function is part of the low-level custom signing API, and works with GenerateESSSigningCertPAdESAttribute, GenerateCMSSignedAttributes, and GenerateCMSSignature.

##### Declaration

    public static byte[] SignDigest(byte[] digest_buf, DigestAlgorithm.Type digest_algorithm_type, byte[] pkcs12_buf, string pkcs12_password)

##### Parameters

Type | Name | Description
--- | --- | ---
byte[] | digest_buf | The digest to sign
DigestAlgorithm.Type | digest_algorithm_type | The digest algorithm used to generate the digest
byte[] | pkcs12_buf | The buffer containing the PKCS #12 key (as usually stored in .pfx files) to use for signing
string | pkcs12_password | The password to use to parse the PKCS 12 key

##### Returns

Type | Description
--- | ---
byte[] | the DER-serialized bytes of the signature

#### SignDigest(byte[], Type, string, string)

Sign the digest of arbitrary data with private key in the provided PKCS #12 key file (.pfx). This function is part of the low-level custom signing API, and works with GenerateESSSigningCertPAdESAttribute, GenerateCMSSignedAttributes, and GenerateCMSSignature.

##### Declaration

    public static byte[] SignDigest(byte[] digest_buf, DigestAlgorithm.Type digest_algorithm_type, string pkcs12_keyfile_path, string pkcs12_password)

##### Parameters

Type | Name | Description
--- | --- | ---
byte[] | digest_buf | The digest to sign
DigestAlgorithm.Type | digest_algorithm_type | The digest algorithm used to generate the digest
string | pkcs12_keyfile_path | The path to the PKCS #12 keyfile (usually has a .pfx extension) to use for signing
string | pkcs12_password | The password to use to parse the PKCS #12 keyfile

##### Returns

Type | Description
--- | ---
byte[] | the DER-serialized bytes of the signature