|
|||||||||
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.EnvelopedData
This class encodes and decodes the PKCS #7
EnvelopedData
type. The enveloped data
content type consists of encrypted content of any type
and encrypted content-encryption keys for one or more
recipients. The combination of the encrypted content and
the encrypted content-encryption key for a recipient is a
digital envelope for that recipient. Any type of
content can be enveloped for any number of recipients, in
parallel.
EnvelopedData ::= SEQUENCE { version Version, recipientInfos RecipientInfos, encryptedContentInfo EncryptedContentInfo } RecipientInfos ::= SET OF RecipientInfo EncryptedContentInfo ::= SEQUENCE { contentType ContentType, contentEncryptionAlgorithm ContentEncryptionAlgorithmIdentifier, encryptedContent [0] IMPLICIT EncryptedContent OPTIONAL } EncryptedContent ::= OCTET STRING |
EnvelopedData
have the following meanings:
0
for this version.EncryptedContentInfo
have the
following meanings:
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 |
|
EnvelopedData(CertJ certJ,
CertPathCtx pathCtx)
Creates a new object to encode or decode PKCS #7
|
Method Summary |
|
void |
addRecipientInfo(RecipientInfo info)
Adds the recipient information to the list of recipients. |
void |
clearSensitiveData()
Clears any sensitive data. |
clone()
Overrides the default |
|
boolean |
equals(Object obj)
Returns |
getEncryptionAlgorithmName()
Gets the encryption algorithm name,
for example, |
|
byte[] |
getEncryptionAlgorithmOID()
Gets the encryption algorithm OID. |
getRecipientInfos()
Gets the recipient information structures as a |
|
int |
getVersionNumber()
Gets the PKCS #7 syntax version number. |
void |
setContentInfo(ContentInfo content)
Sets the actual content data of this
|
void |
setEncryptionAlgorithm(byte[] oid,
int offset,
int len,
int keyLen)
Sets the content-encryption algorithm OID. |
void |
setEncryptionAlgorithm(String algName,
int keyLen)
Sets the content encryption algorithm OID. |
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 EnvelopedData(CertJ certJ, CertPathCtx pathCtx)
EnvelopedData
.Parameters
certJ | The | ||
pathCtx | The |
Method Detail |
public void setVersionNumber(int versionNumber)
Parameters
versionNumber | The PKCS #7 syntax version number. |
public int getVersionNumber()
Returns
public void setEncryptionAlgorithm(String algName, int keyLen) throws PKCS7Exception
Parameters
algName | A | ||
keyLen | The length of the key, in bits. |
Throws
PKCS7Exception
- If algName
is null
or invalid.public void setEncryptionAlgorithm(byte[] oid, int offset, int len, int keyLen) throws PKCS7Exception
Parameters
oid | The content-encryption algorithm (and any associated parameters) under which the content is encrypted. | ||
offset | The offset into oid. | ||
len | The length of the OID data in oid array. | ||
keyLen | The length of the key in bits in the oid array. |
Throws
PKCS7Exception
- If specified OID is null
.public String getEncryptionAlgorithmName() throws PKCS7Exception
DES/ECB/NoPad
.
Returns
Throws
PKCS7Exception
- If the algorithm name cannot be obtained.public byte[] getEncryptionAlgorithmOID()
Returns
public void setContentInfo(ContentInfo content) throws PKCS7Exception
EnvelopedData
object.Parameters
content | The |
Throws
PKCS7Exception
- If this ContentInfo
object cannot be cloned,
or if this ContentInfo
object is null
.public void addRecipientInfo(RecipientInfo info) throws PKCS7Exception
Parameters
info | A |
Throws
PKCS7Exception
- If this RecipientInfo
cannot
be cloned, or if it is null
.public Vector getRecipientInfos()
Vector
.
Returns
public boolean equals(Object obj)
true
if this object
and obj contain the same
EnvelopedData
;
returns false
otherwise.Overrides
equals
in class Object
Parameters
obj | An instance of the
|
Returns
boolean
indicating whether
these objects are equal.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 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 |