iText 8.0.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 byte[]  Digest (Stream data, String hashAlgorithm, IExternalDigest externalDigest)
  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 int  GetOutputBitLength (String name)
  Retrieve the output length in bits of the given digest algorithm. 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...
 
const String  SHA3_256 = "SHA3-256"
  Algorithm available for signatures since PDF 2.0 extended by ISO/TS 32001. More...
 
const String  SHA3_512 = "SHA3-512"
  Algorithm available for signatures since PDF 2.0 extended by ISO/TS 32001. More...
 
const String  SHA3_384 = "SHA3-384"
  Algorithm available for signatures since PDF 2.0 extended by ISO/TS 32001. More...
 
const String  SHAKE256 = "SHAKE256"
  Algorithm available for signatures since PDF 2.0 extended by ISO/TS 32001. More...
 

Detailed Description

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

Member Function Documentation

◆ Digest() [1/3]

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/3]

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

◆ Digest() [3/3]

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

Create a digest based on the inputstream.

Parameters
data data to be digested
hashAlgorithm algorithm to be used
externalDigest external digest to be used
Returns
digest of the data

◆ 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

◆ GetOutputBitLength()

static int iText.Signatures.DigestAlgorithms.GetOutputBitLength ( String  name )
inlinestatic

Retrieve the output length in bits of the given digest algorithm.

Parameters
name the name of the digest algorithm
Returns
the length of the output of the algorithm in bits

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.

◆ SHA3_256

const String iText.Signatures.DigestAlgorithms.SHA3_256 = "SHA3-256"
static

Algorithm available for signatures since PDF 2.0 extended by ISO/TS 32001.

◆ SHA3_384

const String iText.Signatures.DigestAlgorithms.SHA3_384 = "SHA3-384"
static

Algorithm available for signatures since PDF 2.0 extended by ISO/TS 32001.

◆ SHA3_512

const String iText.Signatures.DigestAlgorithms.SHA3_512 = "SHA3-512"
static

Algorithm available for signatures since PDF 2.0 extended by ISO/TS 32001.

◆ SHA512

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

Algorithm available for signatures since PDF 1.7.

◆ SHAKE256

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

Algorithm available for signatures since PDF 2.0 extended by ISO/TS 32001.

Algorithm available for signatures since PDF 2.0 extended by ISO/TS 32001.

The output length is fixed at 512 bits (64 bytes).