|
IAIK CMS/SMIME Toolkit API Documentation
Version 6.1 |
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectiaik.cms.DigestInfo
public class DigestInfo
This class implements the PKCS#7 DigestInfo type.
The PKCS#7
specifies the DigestInfo
type as ASN.1 structure whose BER encoded value serves as input for the
digest-encryption process when creating a SignedData object.
DigestInfo ::= SEQUENCE {
digestAlgorithm DigestAlgorithmIdentifier,
digest Digest }
Digest ::= OCTET STRING
Please note that PKCS#7 successor CMS (Cryptographic Message Syntax; RFC 5652) does not need the DigestInfo anymore. For RSA signing CMS uses immediately the PKCS#1 signature algorithm whereas PKCS#7 used the RSA encryption method and did the DigestInfo wrapping itself. This class only provides an utility for the SecurityProvider which may create RSA signatures by using a JCE Cipher engine for encrypting the digest requiring to do the DigestInfo wrapping outside.
| Constructor Summary | |
|---|---|
DigestInfo(iaik.asn1.structures.AlgorithmID digestAlgorithm,
byte[] digest)
Creates a new DigestInfo from a digest algorithm and a digest. |
|
DigestInfo(iaik.asn1.ASN1Object obj)
Creates a new DigestInfo from an ASN1Object. |
|
DigestInfo(byte[] array)
Creates a new DigestInfo from its DER encoding. |
|
| Method Summary | |
|---|---|
boolean |
checkDigestAlgorithm(iaik.asn1.structures.AlgorithmID digestAlgorithm)
Compares the digest algorithm of this DigestInfo with the given digest algorithm. |
void |
decode(iaik.asn1.ASN1Object obj)
Decodes the given ASN.1 DigestInfo object for parsing
the internal structure. |
byte[] |
getDigest()
Returns the digest value held by this DigestInfo. |
iaik.asn1.structures.AlgorithmID |
getDigestAlgorithm()
Returns the AlgorithmID of the message-digest algorithm (including any associated parameters) that has been used for calculating the digest on the content and any authenticated information. |
iaik.asn1.ASN1Object |
toASN1Object()
Returns this DigestInfo as ASN1Object. |
byte[] |
toByteArray()
Returns this DigestInfo as DER encoded byte array. |
java.lang.String |
toString()
Returns a string giving some information about this DigestInfo object. |
java.lang.String |
toString(boolean detailed)
Returns a string giving some - if requested - detailed information about this DigestInfo object. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public DigestInfo(iaik.asn1.structures.AlgorithmID digestAlgorithm,
byte[] digest)
DigestInfo from a digest algorithm and a digest.
digestAlgorithm - the digest algorithm (including any associated parameters)digest - the digest value to be wrapped by a DigestInfo
public DigestInfo(iaik.asn1.ASN1Object obj)
throws iaik.asn1.CodingException
DigestInfo from an ASN1Object.
The ASN1Object supplied to this constructor represents an
already exisiting DigestInfo object that may
have been created by calling toASN1Object.
obj - the DigestInfo as ASN1Object
iaik.asn1.CodingException - if the object can not be parsed
public DigestInfo(byte[] array)
throws iaik.asn1.CodingException
DigestInfo from its DER encoding.
array - the DER encoded DigestInfo
iaik.asn1.CodingException - if an error occurs when decoding the
DigestInfo| Method Detail |
|---|
public void decode(iaik.asn1.ASN1Object obj)
throws iaik.asn1.CodingException
DigestInfo object for parsing
the internal structure.
This method internally is called when creating a DigestInfo
object from an already existing DigestInfo object,
supplied as ASN1Object.
decode in interface iaik.asn1.ASN1Typeobj - the DigestInfo as ASN1Object
iaik.asn1.CodingException - if the object can not be parsedpublic iaik.asn1.ASN1Object toASN1Object()
DigestInfo as ASN1Object.
The ASN1Object returned by this method may be used as parameter value when
creating a DigestInfo object using the
DigestInfo(ASN1Object obj)
constructor.
toASN1Object in interface iaik.asn1.ASN1TypeDigestInfo as ASN1Object.public byte[] toByteArray()
DigestInfo as DER encoded byte array.
This method may be used for DER encoding this DigestInfo
object before passing it to the digest encryption process.
public iaik.asn1.structures.AlgorithmID getDigestAlgorithm()
public boolean checkDigestAlgorithm(iaik.asn1.structures.AlgorithmID digestAlgorithm)
digestAlgorithm - the digest algorithm to be compared with the
digest algorithm of this DigestInfo
true if the two algorithm identifier are equal
(NULL as parameter is treated as being equal
to a missing parameter field),
false if they are not equalpublic byte[] getDigest()
DigestInfo.
public java.lang.String toString()
DigestInfo object.
toString in class java.lang.Objectpublic java.lang.String toString(boolean detailed)
DigestInfo object.
detailed - - whether or not to give detailed information
|
IAIK CMS/SMIME Toolkit API Documentation
Version 6.1 |
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
|
v6.1 (c) 2002 IAIK, (c) 2003 - 2025 SIC |
|