|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.itextpdf.text.pdf.security.DigestAlgorithms
public class DigestAlgorithms
Class that contains a map with the different message digest algorithms.
Field Summary | |
---|---|
static String |
RIPEMD160
Algorithm available for signatures since PDF 1.7 |
static String |
SHA1
Algorithm available for signatures since PDF 1.3 |
static String |
SHA256
Algorithm available for signatures since PDF 1.6 |
static String |
SHA384
Algorithm available for signatures since PDF 1.7 |
static String |
SHA512
Algorithm available for signatures since PDF 1.7 |
Constructor Summary | |
---|---|
DigestAlgorithms()
|
Method Summary | |
---|---|
static byte[] |
digest(InputStream data,
MessageDigest messageDigest)
|
static byte[] |
digest(InputStream data,
String hashAlgorithm,
String provider)
Creates a hash using a specific digest algorithm and a provider. |
static String |
getAllowedDigests(String name)
Returns the id of a digest algorithms that is allowed in PDF, or null if it isn't allowed. |
static String |
getDigest(String oid)
Gets the digest name for a certain id |
static MessageDigest |
getMessageDigest(String hashAlgorithm,
String provider)
Creates a MessageDigest object that can be used to create a hash. |
static MessageDigest |
getMessageDigestFromOid(String digestOid,
String provider)
|
static String |
normalizeDigestName(String algo)
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final String SHA1
public static final String SHA256
public static final String SHA384
public static final String SHA512
public static final String RIPEMD160
Constructor Detail |
---|
public DigestAlgorithms()
Method Detail |
---|
public static MessageDigest getMessageDigestFromOid(String digestOid, String provider) throws NoSuchAlgorithmException, NoSuchProviderException
NoSuchAlgorithmException
NoSuchProviderException
public static MessageDigest getMessageDigest(String hashAlgorithm, String provider) throws NoSuchAlgorithmException, NoSuchProviderException
hashAlgorithm
- the algorithm you want to use to create a hashprovider
- the provider you want to use to create the hash
NoSuchAlgorithmException
NoSuchProviderException
GeneralSecurityException
public static byte[] digest(InputStream data, String hashAlgorithm, String provider) throws GeneralSecurityException, IOException
data
- the message of which you want to create a hashhashAlgorithm
- the algorithm used to create the hashprovider
- the provider used to create the hash
GeneralSecurityException
IOException
public static byte[] digest(InputStream data, MessageDigest messageDigest) throws GeneralSecurityException, IOException
GeneralSecurityException
IOException
public static String getDigest(String oid)
oid
- an id (for instance "1.2.840.113549.2.5")
public static String normalizeDigestName(String algo)
public static String getAllowedDigests(String name)
name
- the name of the digest algorithm
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |