|
Oracle Security Developer Tools CMS Java API Reference 10g Release 2 (10.1.2.0.2) B15564-01 |
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object
oracle.security.crypto.cms.CMSContentInfo
oracle.security.crypto.cms.CMSEnvelopedDataContentInfo
This class encapsulates a CMS object of content type enveloped-data
.
Constructor Summary | |
CMSEnvelopedDataContentInfo() Creates an empty CMSEnvelopedDataContentInfo . |
|
CMSEnvelopedDataContentInfo(CMSContentInfo contentInfo, AlgorithmIdentifier contentEncryptionAlgID) Creates a CMSEnvelopedDataContentInfo . |
|
CMSEnvelopedDataContentInfo(java.io.InputStream is) Creates a CMSEnvelopedDataContentInfo object, by reading a BER encoding from the specified input stream. |
Method Summary | |
void |
addRecipient(AlgorithmIdentifier keyEncryptionAlgID, SymmetricKey keyEncryptionKey, byte[] keyIdentifier, java.util.Date keyDate, ASN1Sequence otherKeyAttribute) Add a recipient. |
void |
addRecipient(CMSRecipientInfoSpec ris) Add a recipient. |
void |
addRecipient(oracle.security.crypto.cert.X509 recipientCert, AlgorithmIdentifier keyEncryptionAlgID) Add a recipient. |
void |
addRecipient(oracle.security.crypto.cert.X509 recipientCert, AlgorithmIdentifier keyEncryptionAlgID, boolean useSPKI64) Add a recipient. |
boolean |
equals(java.lang.Object obj) Indicates whether some other object is "equal to" this one. |
AlgorithmIdentifier |
getContentEncryptionAlgID() Returns the content encryption algorithm. |
CMSContentInfo |
getEnclosed(PrivateKey privateKey, oracle.security.crypto.cert.X509 recipientCert) Returns the enclosed content after decryption. |
CMSContentInfo |
getEnclosed(SymmetricKey symmetricKey, byte[] keyIdentifier) Returns the enclosed content after decryption. |
CMSContentInfo |
getEnclosed(SymmetricKey symmetricKey, byte[] keyIdentifier, java.util.Date keyDate) Returns the enclosed content after decryption. |
CMSContentInfo |
getEnclosed(SymmetricKey symmetricKey, byte[] keyIdentifier, java.util.Date keyDate, ASN1Sequence otherKeyAttribute) Returns the enclosed content after decryption. |
ASN1ObjectID |
getEnclosedContentType() Returns the content type of the encrypted content. |
byte[] |
getEncryptedContent() Returns the enclosed content which is encrypted. |
protected byte[] |
getExposedContent() Returns the contents octets of the DER encoding of the content field of this CMS object. |
OriginatorInfo |
getOriginatorInfo() Returns the OriginatorInfo. |
oracle.security.crypto.cert.AttributeSet |
getUnprotectedAttribs() Returns the unprotected attributes. |
ASN1Integer |
getVersion() Deprecated. As of Phaos CMS 2.0.1, replaced by getVersionNumber() |
java.math.BigInteger |
getVersionNumber() Returns the version number. |
int |
hashCode() Returns a hash code value for this object. |
protected void |
inputContent(java.io.InputStream is) Initializes this object by reading the Content field of the CMS ContentInfo structure i.e. |
boolean |
isDetached() Indicates if the encrypted content is not present. |
java.util.Enumeration |
recipients() Returns the list of message recipients. |
void |
setEnclosed(byte[] encryptedContent) Sets the Encrypted Content. |
protected void |
setExposedContent(byte[] expContent) Returns the contents octets of the DER encoding of the content field of this CMS object. |
void |
setOriginatorInfo(OriginatorInfo origInfo) Sets the OriginatorInfo. |
void |
setUnprotectedAttribs(oracle.security.crypto.cert.AttributeSet unprotectedAttributes) Set the unprotected attributes. |
java.lang.String |
toString() Returns a brief text description of this object. |
protected void |
update() Clears the internal output cache. |
void |
writeDetached(boolean writeDetached) Indicate if the encrypted content must be omitted from this object's output encoding. |
Methods inherited from class oracle.security.crypto.cms.CMSContentInfo |
computeDigest, contentTypeName, getContentType, input, inputInstance, isDegenerate, length, output |
Methods inherited from class java.lang.Object |
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Constructor Detail |
public CMSEnvelopedDataContentInfo()
CMSEnvelopedDataContentInfo
.public CMSEnvelopedDataContentInfo(CMSContentInfo contentInfo, AlgorithmIdentifier contentEncryptionAlgID) throws CipherException, AlgorithmIdentifierException
CMSEnvelopedDataContentInfo
.contentInfo
- The document to encrypt.contentEncryptionAlgID
- The content encryption algorithm.public CMSEnvelopedDataContentInfo(java.io.InputStream is) throws java.io.IOException
CMSEnvelopedDataContentInfo
object, by reading a BER encoding from the specified input stream.is
- The input stream.java.io.IOException
- If the input is not correctly formatted, has the wrong content type, or an I/O error occurs while reading from the input stream.Method Detail |
public boolean isDetached()
isDetached
in class CMSContentInfo
true
the encrypted content is not present; false
otherwise.protected void setExposedContent(byte[] expContent)
CMSContentInfo
setExposedContent
in class CMSContentInfo
null
for a detached CMS object.CMSContentInfo.isDetached()
protected byte[] getExposedContent()
CMSContentInfo
getExposedContent
in class CMSContentInfo
null
for a detached CMS object.CMSContentInfo.isDetached()
public java.math.BigInteger getVersionNumber()
public ASN1Integer getVersion()
getVersionNumber()
public ASN1ObjectID getEnclosedContentType()
public AlgorithmIdentifier getContentEncryptionAlgID()
public java.lang.String toString()
public java.util.Enumeration recipients()
CMSRecipientInfo
objects.public int hashCode()
public boolean equals(java.lang.Object obj)
true
if this object is the same as the obj argument; false
otherwise.public void writeDetached(boolean writeDetached)
writeDetached
- true
if the encrypted content is to be omitted from this object's encoded output; false
otherwise.CMSContentInfo.isDetached()
public void setEnclosed(byte[] encryptedContent)
encryptedContent
- The encrypted CMSContentInfo.public void addRecipient(oracle.security.crypto.cert.X509 recipientCert, AlgorithmIdentifier keyEncryptionAlgID) throws AlgorithmIdentifierException, CipherException, InvalidKeyException
Uses the Key Transport Recipient Information with IssuerAndSerialNumber as the Recipient Identifier.
recipientCert
- The recipient's public key certificate.keyEncryptionAlgID
- The key encipherment algorithm.AlgorithmIdentifierException
- Unrecognized algorithm identifier.CipherException
- An error occurred during encryption.InvalidKeyException
- Invalid content encryption key.public void addRecipient(oracle.security.crypto.cert.X509 recipientCert, AlgorithmIdentifier keyEncryptionAlgID, boolean useSPKI64) throws AlgorithmIdentifierException, CipherException, InvalidKeyException
Uses the Key Transport Recipient Information with Subject Key Identifier as the Recipient Identifier.
recipientCert
- The recipient's public key certificate.keyEncryptionAlgID
- The key encipherment algorithm.useSPKI64
- Uses Subject Public Key Identifier as the recipient identifier. true
use 64 bit PKI; false
use 160 bit SPKI.AlgorithmIdentifierException
- Unrecognized algorithm identifier.CipherException
- An error occurred during encryption.InvalidKeyException
- Invalid content encryption key.public void addRecipient(CMSRecipientInfoSpec ris) throws AlgorithmIdentifierException, CipherException, InvalidInputException, InvalidKeyException
Uses the Key Encryption Key Recipient Information.
ris
- The recipient's information.InvalidInputException
- Unrecognized RecipientInfoSpec.AlgorithmIdentifierException
- Unrecognized algorithm identifier.CipherException
- An error occurred during encryption.InvalidKeyException
- Invalid content encryption key.public void addRecipient(AlgorithmIdentifier keyEncryptionAlgID, SymmetricKey keyEncryptionKey, byte[] keyIdentifier, java.util.Date keyDate, ASN1Sequence otherKeyAttribute) throws AlgorithmIdentifierException, CipherException, InvalidKeyException, InvalidInputException
Uses the Key Encryption Key Recipient Information.
AlgorithmIdentifierException
- Unrecognized algorithm identifier.CipherException
- An error occurred during encryption.InvalidKeyException
- Invalid content encryption key.InvalidInputException
public CMSContentInfo getEnclosed(PrivateKey privateKey, oracle.security.crypto.cert.X509 recipientCert) throws AlgorithmIdentifierException, InvalidKeyException, CipherException, UnknownRecipientException, InvalidInputException
Assumes that Key Transport Recipient Information is used.
AlgorithmIdentifierException
- Unrecognized algorithm identifier.CipherException
- An error occurred during encryption.InvalidKeyException
- Invalid content encryption key.UnknownRecipientException
- The decryption key does belong to the recipient.InvalidInputException
- If an incorrect encoding or I/O error occurred.public CMSContentInfo getEnclosed(SymmetricKey symmetricKey, byte[] keyIdentifier) throws AlgorithmIdentifierException, InvalidKeyException, CipherException, UnknownRecipientException, InvalidInputException
Assumes that Key Encryption Key Recipient Information is used.
symmetricKey
- The previously distributed symmetric key.keyIdentifier
- Key identifier.AlgorithmIdentifierException
- Unrecognized algorithm identifier.CipherException
- An error occurred during encryption.InvalidKeyException
- Invalid content encryption key.UnknownRecipientException
- The decryption key does belong to the recipient.InvalidInputException
- If an incorrect encoding or I/O error occurred.public CMSContentInfo getEnclosed(SymmetricKey symmetricKey, byte[] keyIdentifier, java.util.Date keyDate) throws AlgorithmIdentifierException, InvalidKeyException, CipherException, UnknownRecipientException, InvalidInputException
Assumes that Key Encryption Key Recipient Information is used.
symmetricKey
- The previously distributed symmetric key.keyIdentifier
- Key identifier.keyDate
- Key generation date.AlgorithmIdentifierException
- Unrecognized algorithm identifier.CipherException
- An error occurred during encryption.InvalidKeyException
- Invalid content encryption key.UnknownRecipientException
- The decryption key does belong to the recipient.InvalidInputException
- If an incorrect encoding or I/O error occurred.public CMSContentInfo getEnclosed(SymmetricKey symmetricKey, byte[] keyIdentifier, java.util.Date keyDate, ASN1Sequence otherKeyAttribute) throws AlgorithmIdentifierException, InvalidKeyException, CipherException, UnknownRecipientException, InvalidInputException
Assumes that Key Encryption Key Recipient Information is used.
symmetricKey
- The previously distributed symmetric key.keyIdentifier
- Key identifier.keyDate
- Key generation date.otherKeyAttribute
- The Other Key Attribute.AlgorithmIdentifierException
- Unrecognized algorithm identifier.CipherException
- An error occurred during encryption.InvalidKeyException
- Invalid content encryption key.UnknownRecipientException
- The decryption key does belong to the recipient.InvalidInputException
- If an incorrect encoding or I/O error occurred.protected void inputContent(java.io.InputStream is) throws java.io.IOException
CMSContentInfo
This method must be implemented by subclasses. It is unlikely that package users will ever need to call it directly.
inputContent
in class CMSContentInfo
java.io.IOException
public byte[] getEncryptedContent()
public void setOriginatorInfo(OriginatorInfo origInfo)
Do not use this method if PKCS#7 v1.5 interoperability is required.
origInfo
- The OriginatorInfo.public OriginatorInfo getOriginatorInfo()
OriginatorInfo
if present or null
otherwise.public void setUnprotectedAttribs(oracle.security.crypto.cert.AttributeSet unprotectedAttributes)
unprotectedAttributes
- The unprotected attributes.public oracle.security.crypto.cert.AttributeSet getUnprotectedAttribs()
null
otherwise.protected void update()
update
in class CMSContentInfo
|
Oracle Security Developer Tools CMS Java API Reference 10g Release 2 (10.1.2.0.2) B15564-01 |
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |