|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--com.ibm.security.pkcsutil.PKCSDerObject | +--com.ibm.security.pkcs7.Content | +--com.ibm.security.pkcs7.EncryptedData
Implements the ASN.1 EncryptedData type.
The EncryptedData type content can consist of EncryptedContentInfo of any type. Unlike EnvelopedData, EncryptedData has neither recipients nor encrypted content-encryption keys. Keys are assumed to be managed by other means.
This definition reflects PKCS #7 version 1.5 specifications with selected enhancements from the Cryptographic Message Syntax (CMS) RFC 2630 specifications.
EncryptedData objects are immutable; they cannot be changed once created.
EncryptedContentInfo
Fields inherited from class com.ibm.security.pkcsutil.PKCSDerObject |
provider |
Constructor Summary | |
EncryptedData(byte[] der)
Create an EncryptedData object with a DER byte array. |
|
EncryptedData(byte[] der,
String provider)
Create an EncryptedData object with a DER byte array. |
|
EncryptedData(EncryptedContentInfo eci,
PKCSAttributes unprotectedAttrs)
Create an EncryptedData object with the specified values. |
|
EncryptedData(EncryptedContentInfo eci,
PKCSAttributes unprotectedAttrs,
String provider)
Create an EncryptedData object with the specified values. |
|
EncryptedData(String filename,
boolean base64)
Create an EncryptedData with the filename of the DER-encoded or BASE64-encoded object. |
|
EncryptedData(String filename,
boolean base64,
String provider)
Create an EncryptedData with the filename of the DER-encoded or BASE64-encoded object. |
Method Summary | |
Object |
clone()
Creates a clone of this EncryptedData object. |
protected void |
decode(com.ibm.security.pkcs7.DerValue encoding)
Initializes an EncryptedData object from a DerValue. |
ContentInfo |
decrypt(byte[] key)
Decrypts the object's encrypted content using the input decryption key. |
void |
encode(OutputStream os)
Encodes this object to an OutputStream. |
boolean |
equals(Object other)
Determines if this EncryptedData object is equivalent to the input object. |
protected void |
finalize()
Ensure that the contentEncryptionKey bytes are nulled out when there are no more references to this object. |
EncryptedContentInfo |
getEncryptedContent()
Returns a reference the encryptedContent data member of this object. |
byte[] |
getEncryptionKey()
Returns the key used to encrypt the content, or null if this object was not used to encrypt the content. |
ObjectIdentifier |
getObjectIdentifier()
Returns a reference to the Object Identifier for this object. |
PKCSAttribute |
getUnprotectedAttribute(ObjectIdentifier oid)
Returns a reference to the unprotected attribute from the unprotected attribute set based on an ObjectIdentifier. |
PKCSAttributes |
getUnprotectedAttributes()
Returns a reference to the set unprotected attributes. |
BigInteger |
getVersion()
Returns a reference to the version for this object. |
String |
toString()
Returns a string representation of this EncryptedData object. |
Methods inherited from class com.ibm.security.pkcsutil.PKCSDerObject |
decode,
decode,
encode,
hashCode,
read,
readBASE64,
write,
write,
writeBASE64 |
Methods inherited from class java.lang.Object |
getClass,
notify,
notifyAll,
wait,
wait,
wait |
Constructor Detail |
public EncryptedData(byte[] der) throws IOException
der
- a byte array containing the DER encoding of an EncryptedData
object.public EncryptedData(byte[] der, String provider) throws IOException
der
- a byte array containing the DER encoding of an EncryptedData
object.provider
- the name of the java security provider to usepublic EncryptedData(EncryptedContentInfo eci, PKCSAttributes unprotectedAttrs)
eci
- the encrypted content contained in an EncryptedContentInfo
object.unprotectedAttrs
- PKCSAttributes set of unprotected attributes.public EncryptedData(EncryptedContentInfo eci, PKCSAttributes unprotectedAttrs, String provider)
eci
- the encrypted content contained in an EncryptedContentInfo
object.unprotectedAttrs
- PKCSAttributes set of unprotected attributes.provider
- the name of the java security provider to usepublic EncryptedData(String filename, boolean base64) throws IOException
filename
- name of the DER-encoded or base64-encoded objectbase64
- true if BASE64-encoded, false if DER-encodedpublic EncryptedData(String filename, boolean base64, String provider) throws IOException
filename
- name of the DER-encoded or base64-encoded objectbase64
- true if BASE64-encoded, false if DER-encodedprovider
- the name of the java security provider to useMethod Detail |
public Object clone()
public void encode(OutputStream os) throws IOException
os
- the OutputStream to write the encoded data to.protected void decode(com.ibm.security.pkcs7.DerValue encoding) throws IOException
encoding
- a DER-encoded EncryptedData object.public boolean equals(Object other)
other
- the object to compare this one to.public PKCSAttribute getUnprotectedAttribute(ObjectIdentifier oid)
oid
- ObjectIdentifier to matchpublic PKCSAttributes getUnprotectedAttributes()
public byte[] getEncryptionKey()
public ContentInfo decrypt(byte[] key) throws IOException, PKCSException
decryptionKey
- a byte encoding of the key to use for content
decryption.public ObjectIdentifier getObjectIdentifier()
public EncryptedContentInfo getEncryptedContent()
public BigInteger getVersion()
public String toString()
protected void finalize()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |