Class DigestAlgorithms
- Namespace
- iText.Signatures
- Assembly
- itext.sign.dll
Class that contains a map with the different message digest algorithms.
public class DigestAlgorithms
- Inheritance
-
DigestAlgorithms
- Inherited Members
Constructors
DigestAlgorithms()
public DigestAlgorithms()
Fields
RIPEMD160
Algorithm available for signatures since PDF 1.7.
public const string RIPEMD160 = "RIPEMD160"
Field Value
SHA1
Algorithm available for signatures since PDF 1.3.
public const string SHA1 = "SHA-1"
Field Value
SHA256
Algorithm available for signatures since PDF 1.6.
public const string SHA256 = "SHA-256"
Field Value
SHA384
Algorithm available for signatures since PDF 1.7.
public const string SHA384 = "SHA-384"
Field Value
SHA3_256
Algorithm available for signatures since PDF 2.0 extended by ISO/TS 32001.
public const string SHA3_256 = "SHA3-256"
Field Value
SHA3_384
Algorithm available for signatures since PDF 2.0 extended by ISO/TS 32001.
public const string SHA3_384 = "SHA3-384"
Field Value
SHA3_512
Algorithm available for signatures since PDF 2.0 extended by ISO/TS 32001.
public const string SHA3_512 = "SHA3-512"
Field Value
SHA512
Algorithm available for signatures since PDF 1.7.
public const string SHA512 = "SHA-512"
Field Value
SHAKE256
Algorithm available for signatures since PDF 2.0 extended by ISO/TS 32001.
public const string SHAKE256 = "SHAKE256"
Field Value
Remarks
Algorithm available for signatures since PDF 2.0 extended by ISO/TS 32001.
The output length is fixed at 512 bits (64 bytes).Methods
Digest(Stream, string)
Creates a hash using a specific digest algorithm and a provider.
public static byte[] Digest(Stream data, string hashAlgorithm)
Parameters
data
Streamthe message of which you want to create a hash
hashAlgorithm
stringthe algorithm used to create the hash
Returns
- byte[]
the hash
Digest(Stream, string, IExternalDigest)
Create a digest based on the inputstream.
public static byte[] Digest(Stream data, string hashAlgorithm, IExternalDigest externalDigest)
Parameters
data
Streamdata to be digested
hashAlgorithm
stringalgorithm to be used
externalDigest
IExternalDigestexternal digest to be used
Returns
- byte[]
digest of the data
Digest(Stream, IDigest)
Create a digest based on the inputstream.
public static byte[] Digest(Stream data, IDigest messageDigest)
Parameters
data
Streamdata to be digested
messageDigest
IDigestalgorithm to be used
Returns
- byte[]
digest of the data
GetAllowedDigest(string)
Returns the id of a digest algorithms that is allowed in PDF, or null if it isn't allowed.
public static string GetAllowedDigest(string name)
Parameters
name
stringThe name of the digest algorithm.
Returns
- string
An oid.
GetDigest(string)
Gets the digest name for a certain id.
public static string GetDigest(string oid)
Parameters
oid
stringan id (for instance "1.2.840.113549.2.5")
Returns
- string
a digest name (for instance "MD5")
GetMessageDigest(string)
Creates a MessageDigest object that can be used to create a hash.
public static IDigest GetMessageDigest(string hashAlgorithm)
Parameters
hashAlgorithm
stringthe algorithm you want to use to create a hash
Returns
- IDigest
a MessageDigest object
GetMessageDigestFromOid(string)
Get a digest algorithm.
public static IDigest GetMessageDigestFromOid(string digestOid)
Parameters
digestOid
stringoid of the digest algorithm
Returns
- IDigest
MessageDigest object
GetOutputBitLength(string)
Retrieve the output length in bits of the given digest algorithm.
public static int GetOutputBitLength(string name)
Parameters
name
stringthe name of the digest algorithm
Returns
- int
the length of the output of the algorithm in bits