iText 7 7.2.5 API
iText.Signatures.DigestAlgorithms Class Reference

Class that contains a map with the different message digest algorithms. More...

Static Public Member Functions

static IDigest  GetMessageDigestFromOid (String digestOid)
  Get a digest algorithm. More...
 
static IDigest  GetMessageDigest (String hashAlgorithm)
  Creates a MessageDigest object that can be used to create a hash. More...
 
static byte[]  Digest (Stream data, String hashAlgorithm)
  Creates a hash using a specific digest algorithm and a provider. More...
 
static byte[]  Digest (Stream data, IDigest messageDigest)
  Create a digest based on the inputstream. More...
 
static String  GetDigest (String oid)
  Gets the digest name for a certain id More...
 
static String  GetAllowedDigest (String name)
  Returns the id of a digest algorithms that is allowed in PDF, or null if it isn't allowed. More...
 

Static Public Attributes

const String  SHA1 = "SHA-1"
  Algorithm available for signatures since PDF 1.3. More...
 
const String  SHA256 = "SHA-256"
  Algorithm available for signatures since PDF 1.6. More...
 
const String  SHA384 = "SHA-384"
  Algorithm available for signatures since PDF 1.7. More...
 
const String  SHA512 = "SHA-512"
  Algorithm available for signatures since PDF 1.7. More...
 
const String  RIPEMD160 = "RIPEMD160"
  Algorithm available for signatures since PDF 1.7. More...
 

Detailed Description

Class that contains a map with the different message digest algorithms.

Member Function Documentation

◆ Digest() [1/2]

static byte [] iText.Signatures.DigestAlgorithms.Digest ( Stream  data,
IDigest  messageDigest 
)
inlinestatic

Create a digest based on the inputstream.

Parameters
data data to be digested
messageDigest algorithm to be used
Returns
digest of the data

◆ Digest() [2/2]

static byte [] iText.Signatures.DigestAlgorithms.Digest ( Stream  data,
String  hashAlgorithm 
)
inlinestatic

Creates a hash using a specific digest algorithm and a provider.

Parameters
data the message of which you want to create a hash
hashAlgorithm the algorithm used to create the hash
Returns
the hash

◆ GetAllowedDigest()

static String iText.Signatures.DigestAlgorithms.GetAllowedDigest ( String  name )
inlinestatic

Returns the id of a digest algorithms that is allowed in PDF, or null if it isn't allowed.

Parameters
name The name of the digest algorithm.
Returns
An oid.

◆ GetDigest()

static String iText.Signatures.DigestAlgorithms.GetDigest ( String  oid )
inlinestatic

Gets the digest name for a certain id

Parameters
oid an id (for instance "1.2.840.113549.2.5")
Returns
a digest name (for instance "MD5")

◆ GetMessageDigest()

static IDigest iText.Signatures.DigestAlgorithms.GetMessageDigest ( String  hashAlgorithm )
inlinestatic

Creates a MessageDigest object that can be used to create a hash.

Parameters
hashAlgorithm the algorithm you want to use to create a hash
Returns
a MessageDigest object

◆ GetMessageDigestFromOid()

static IDigest iText.Signatures.DigestAlgorithms.GetMessageDigestFromOid ( String  digestOid )
inlinestatic

Get a digest algorithm.

Parameters
digestOid oid of the digest algorithm
Returns
MessageDigest object

Member Data Documentation

◆ RIPEMD160

const String iText.Signatures.DigestAlgorithms.RIPEMD160 = "RIPEMD160"
static

Algorithm available for signatures since PDF 1.7.

◆ SHA1

const String iText.Signatures.DigestAlgorithms.SHA1 = "SHA-1"
static

Algorithm available for signatures since PDF 1.3.

◆ SHA256

const String iText.Signatures.DigestAlgorithms.SHA256 = "SHA-256"
static

Algorithm available for signatures since PDF 1.6.

◆ SHA384

const String iText.Signatures.DigestAlgorithms.SHA384 = "SHA-384"
static

Algorithm available for signatures since PDF 1.7.

◆ SHA512

const String iText.Signatures.DigestAlgorithms.SHA512 = "SHA-512"
static

Algorithm available for signatures since PDF 1.7.