|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--com.rsa.certj.pkcs7.ContentInfo | +--com.rsa.certj.pkcs7.DigestedData
This class encodes and decodes the PKCS #7 DigestedData
type.
The digested-data content type consists of content of any type and
a message digest of the content.
DigestedData ::= SEQUENCE { version Version, digestAlgorithm DigestAlgorithmIdentifier, contentInfo ContentInfo, digest Digest } Digest ::= OCTET STRING |
See Also
Fields inherited from class com.rsa.certj.pkcs7.ContentInfo |
DATA, DIGESTED_DATA, ENCRYPTED_DATA, ENVELOPED_DATA, NO_CONTENT, PKCS7_VERSION_NUMBER_0, PKCS7_VERSION_NUMBER_1, SIGNED_DATA |
Constructor Summary |
|
DigestedData(CertJ certJ,
CertPathCtx pathCtx)
Creates a new object to encode or decode PKCS #7
|
Method Summary |
|
void |
clearSensitiveData()
Clears any sensitive data. |
clone()
Overrides the default |
|
boolean |
equals(Object obj)
Returns true if this object and obj contain the same
|
getDigestAlgorithmName()
Gets the digest algorithm name. |
|
byte[] |
getDigestAlgorithmOID()
Gets the digest algorithm identifier. |
byte[] |
getMessageDigest()
Gets the computed message digest of the content. |
int |
getVersionNumber()
Gets the PKCS #7 syntax version number. |
void |
setContentInfo(ContentInfo content)
Sets the actual content data of
this |
void |
setDigestAlgorithm(byte[] digestOID,
int offset,
int len)
Sets the digest algorithm identifier. |
void |
setDigestAlgorithm(String algName)
Sets the digest algorithm identifier. |
void |
setVersionNumber(int versionNumber)
Sets the PKCS #7 syntax version number. |
Methods inherited from class com.rsa.certj.pkcs7.ContentInfo |
bytesRead, clearInternalContentBuffer, endOfMessage, getContent, getContentInfoDERLen, getContentInfoDERLen, getContentType, getDevice, getDeviceList, getInstance, getInstance, getMessageType, getMessageType, getUnprocessedDataLen, readFinal, readInit, readInit, readInit, readUpdate, setCertJ, setCertPath, setDevice, writeMessage, writeMessage |
Methods inherited from class java.lang.Object |
getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public DigestedData(CertJ certJ, CertPathCtx pathCtx)
DigestedData
.Parameters
certJ | A | ||
pathCtx | A |
Method Detail |
public void setContentInfo(ContentInfo content) throws PKCS7Exception
DigestedData
object.Parameters
content | A |
Throws
PKCS7Exception
- If this ContentInfo
object
cannot be cloned, or if it is null
.public void setVersionNumber(int versionNumber)
Parameters
versionNumber | The PKCS #7 syntax version number. |
public int getVersionNumber()
Returns
public void setDigestAlgorithm(String algName) throws PKCS7Exception
Parameters
name | A |
Throws
PKCS7Exception
- If specified algorithm name
is null
or invalid.public void setDigestAlgorithm(byte[] digestOID, int offset, int len) throws PKCS7Exception
Parameters
DigestOID | Tthe message-digest algorithm (and any associated parameters) under which the content is digested. | ||
offset | The offset into digestOID array. | ||
len | The length of digest OID data in the |
Throws
PKCS7Exception
- If the specified OID is null
.public byte[] getDigestAlgorithmOID()
Returns
public String getDigestAlgorithmName() throws PKCS7Exception
Returns
Throws
PKCS7Exception
- If the algorithm name cannot be obtained.public byte[] getMessageDigest()
Returns
byte
array that
contains the message digest.
If message digest is not computed,
this method returns null
.
The message digest is computed during getContentDERLen
method,
and the writeContent
method. It is also set after reading the message.public Object clone() throws CloneNotSupportedException
clone
method
to get a deeper clone.
Overrides
clone
in class ContentInfo
Returns
Throws
CloneNotSupportedException
- If the cloning operation
is not successful.public boolean equals(Object obj)
DigestedData
; returns false otherwise.Overrides
equals
in class Object
Parameters
obj | An instance of the
|
Returns
boolean
indicating whether
these objects are equal.public void clearSensitiveData()
finalizer
will clear
the data, but it is not known when the garbage collector will call the
finalizer
. This method clears all sensitive data as soon
as possible.
Overrides
clearSensitiveData
in class ContentInfo
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |