|
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.CMSAuthenticatedDataContentInfo
This class encapsulates a CMS object of content type authenticated-data
.
Constructor Summary | |
CMSAuthenticatedDataContentInfo() Creates an empty CMSAuthenticatedDataContentInfo . |
|
CMSAuthenticatedDataContentInfo(CMSContentInfo contentInfo, SymmetricKey hmacKey, AlgorithmIdentifier macAlgorithm) Creates a CMSAuthenticatedDataContentInfo . |
|
CMSAuthenticatedDataContentInfo(CMSContentInfo contentInfo, SymmetricKey hmacKey, AlgorithmIdentifier hmacKeyAlgID, OriginatorInfo originatorInfo, AlgorithmIdentifier macAlgorithm, AlgorithmIdentifier digestAlgorithm, oracle.security.crypto.cert.AttributeSet authenticatedAttributes, oracle.security.crypto.cert.AttributeSet unauthenticatedAttributes) Creates a CMSAuthenticatedDataContentInfo . |
|
CMSAuthenticatedDataContentInfo(CMSContentInfo contentInfo, SymmetricKey hmacKey, OriginatorInfo originatorInfo, AlgorithmIdentifier macAlgorithm, AlgorithmIdentifier digestAlgorithm, oracle.security.crypto.cert.AttributeSet authenticatedAttributes, oracle.security.crypto.cert.AttributeSet unauthenticatedAttributes) Creates a CMSAuthenticatedDataContentInfo . |
|
CMSAuthenticatedDataContentInfo(java.io.InputStream is) Creates a CMSAuthenticatedDataContentInfo by reading a BER encoding from the given 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. |
oracle.security.crypto.cert.AttributeSet |
getAuthenticatedAttributes() Returns the Authenticated Attributes. |
AlgorithmIdentifier |
getDigestAlgID() Returns the digest algorithm. |
CMSContentInfo |
getEnclosed() Returns the authenticated content. |
ASN1ObjectID |
getEnclosedContentType() Returns the content type of the enclosed content. |
protected byte[] |
getExposedContent() Returns the contents octets of the DER encoding of the content field of this CMS object. |
byte[] |
getMAC() Returns the message authentication code. |
AlgorithmIdentifier |
getMACAlgID() Returns the MAC algorithm used for authentication. |
OriginatorInfo |
getOriginatorInfo() Returns the Originator Info. |
oracle.security.crypto.cert.AttributeSet |
getUnauthenticatedAttributes() Returns the Unauthenticated Attributes. |
ASN1Integer |
getVersion() Deprecated. As of Phaos CMS 2.0.1, replaced by getVersionNumber() |
java.math.BigInteger |
getVersionNumber() Returns the version number. |
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 this object is detached. |
java.util.Enumeration |
recipients() Returns the list of message recipients. |
void |
setAuthenticatedAttributes(oracle.security.crypto.cert.AttributeSet authenticatedAttributes, AlgorithmIdentifier digestAlgorithm) Set the Authenticated attributes. |
void |
setEnclosed(CMSContentInfo content) Sets the authenticated 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 originatorInfo) Set the OriginatorInfo. |
void |
setUnauthenticatedAttributes(oracle.security.crypto.cert.AttributeSet unauthenticatedAttributes) Set the unauthenticated attributes. |
java.lang.String |
toString() Returns a brief text description of this object. |
protected void |
update() Clears the internal output cache. |
void |
verifyMAC(PrivateKey privateKey, oracle.security.crypto.cert.X509 recipientCert) Returns the enclosed content after decryption. |
void |
verifyMAC(SymmetricKey symmetricKey, byte[] keyIdentifier) Returns the enclosed content after decryption. |
void |
verifyMAC(SymmetricKey symmetricKey, byte[] keyIdentifier, java.util.Date keyDate) Returns the enclosed content after decryption. |
void |
verifyMAC(SymmetricKey symmetricKey, byte[] keyIdentifier, java.util.Date keyDate, ASN1Sequence otherKeyAttribute) Returns the enclosed content after decryption. |
void |
writeDetached(boolean writeDetachedObject) Indicate if the CMS Object that is being authenticated should be omitted while generating this object's 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, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
public CMSAuthenticatedDataContentInfo()
CMSAuthenticatedDataContentInfo
.public CMSAuthenticatedDataContentInfo(CMSContentInfo contentInfo, SymmetricKey hmacKey, AlgorithmIdentifier macAlgorithm) throws InvalidInputException, AlgorithmIdentifierException
CMSAuthenticatedDataContentInfo
.contentInfo
- The document to authenticate.hmacKey
- The key to use for the HMAC operation.macAlgorithm
- The message authentication algorithm.InvalidInputException
- Input parameters are incomplete or invalid.AlgorithmIdentifierException
- Algorithm is not supported.public CMSAuthenticatedDataContentInfo(CMSContentInfo contentInfo, SymmetricKey hmacKey, OriginatorInfo originatorInfo, AlgorithmIdentifier macAlgorithm, AlgorithmIdentifier digestAlgorithm, oracle.security.crypto.cert.AttributeSet authenticatedAttributes, oracle.security.crypto.cert.AttributeSet unauthenticatedAttributes) throws InvalidInputException, AlgorithmIdentifierException
CMSAuthenticatedDataContentInfo
.
Note that the Authenticated Attributes 'Content Type' and 'Message Digest' are automatically added.
contentInfo
- The document to authenticate.hmacKey
- The key to use for the HMAC operation.originatorInfo
- The originator information.macAlgorithm
- The message authentication algorithm.digestAlgorithm
- The message digest algorithm.authenticatedAttributes
- The set of authenticatedAttributes.unauthenticatedAttributes
- The set of unauthenticatedAttributes.InvalidInputException
- Input parameters are incomplete or invalid.AlgorithmIdentifierException
- Algorithm is not supported.public CMSAuthenticatedDataContentInfo(CMSContentInfo contentInfo, SymmetricKey hmacKey, AlgorithmIdentifier hmacKeyAlgID, OriginatorInfo originatorInfo, AlgorithmIdentifier macAlgorithm, AlgorithmIdentifier digestAlgorithm, oracle.security.crypto.cert.AttributeSet authenticatedAttributes, oracle.security.crypto.cert.AttributeSet unauthenticatedAttributes) throws InvalidInputException, AlgorithmIdentifierException
CMSAuthenticatedDataContentInfo
.
Note that the Authenticated Attributes 'Content Type' and 'Message Digest' are automatically added.
contentInfo
- The document to authenticate.hmacKey
- The key to use for the HMAC operation.originatorInfo
- The originator information.macAlgorithm
- The message authentication algorithm.digestAlgorithm
- The message digest algorithm.authenticatedAttributes
- The set of authenticatedAttributes.unauthenticatedAttributes
- The set of unauthenticatedAttributes.InvalidInputException
- Input parameters are incomplete or invalid.AlgorithmIdentifierException
- Algorithm is not supported.public CMSAuthenticatedDataContentInfo(java.io.InputStream is) throws java.io.IOException
CMSAuthenticatedDataContentInfo
by reading a BER encoding from the given 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 exception occurs while reading from the input stream.Method Detail |
public boolean isDetached()
isDetached
in class CMSContentInfo
true
if detached; false
otherwise.CMSContentInfo.isDetached()
public void writeDetached(boolean writeDetachedObject)
writeDetachedObject
- If true
, the CMS Object that is being authenticated is not output; false
otherwise.CMSContentInfo.isDetached()
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 OriginatorInfo getOriginatorInfo()
OriginatorInfo
if present or null
otherwise.public AlgorithmIdentifier getMACAlgID()
public AlgorithmIdentifier getDigestAlgID()
null
otherwise.public ASN1ObjectID getEnclosedContentType()
public CMSContentInfo getEnclosed()
public void setEnclosed(CMSContentInfo content)
This is used to set the contents of a detached authenticated-data CMS object.
content
- The content object.public byte[] getMAC()
public oracle.security.crypto.cert.AttributeSet getAuthenticatedAttributes()
null
otherwise.public oracle.security.crypto.cert.AttributeSet getUnauthenticatedAttributes()
null
otherwise.public java.lang.String toString()
public java.util.Enumeration recipients()
CMSRecipientInfo
objects.public void addRecipient(oracle.security.crypto.cert.X509 recipientCert, AlgorithmIdentifier keyEncryptionAlgID) throws AlgorithmIdentifierException, CipherException, InvalidKeyException
Uses the Key Transport Recipient Information with IssuerAndSerialNo 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 Key Identifier as the Recipient Identifier.
recipientCert
- The recipient's public key certificate.keyEncryptionAlgID
- The key encipherment algorithm.useSPKI64
- Uses SPKI as the recipient identifier. If True use 64 bit SPKI; 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
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.
keyEncryptionAlgID
- The key encrption (wrap) algorithm.keyEncryptionKey
- The key encryption (wrap) key.keyIdentifier
- The key identifier.keyDate
- The key generation date.otherKeyAttribute
- The other key attribute.AlgorithmIdentifierException
- Unrecognized algorithm identifier.CipherException
- An error occurred during encryption.InvalidKeyException
- Invalid content encryption key.InvalidInputException
public void verifyMAC(PrivateKey privateKey, oracle.security.crypto.cert.X509 recipientCert) throws AlgorithmIdentifierException, InvalidKeyException, CipherException, UnknownRecipientException, InvalidInputException, AuthenticationException
Recipient Information uses the Key Transport Mechanism.
privateKey
- The recipient's private key.recipientCert
- The recipient's X509 certificate.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.AuthenticationException
public void verifyMAC(SymmetricKey symmetricKey, byte[] keyIdentifier) throws AlgorithmIdentifierException, InvalidKeyException, CipherException, UnknownRecipientException, InvalidInputException, AuthenticationException
Recipient Information uses Key Encryption Key Mechanism.
symmetricKey
- The previously distributed symmetric key.keyIdentifier
- The 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.AuthenticationException
public void verifyMAC(SymmetricKey symmetricKey, byte[] keyIdentifier, java.util.Date keyDate) throws AlgorithmIdentifierException, InvalidKeyException, CipherException, UnknownRecipientException, InvalidInputException, AuthenticationException
Recipient Information uses Key Encryption Key Mechanism.
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.AuthenticationException
public void verifyMAC(SymmetricKey symmetricKey, byte[] keyIdentifier, java.util.Date keyDate, ASN1Sequence otherKeyAttribute) throws AlgorithmIdentifierException, InvalidKeyException, CipherException, UnknownRecipientException, InvalidInputException, AuthenticationException
Recipient Information uses Key Encryption Key Mechanism.
symmetricKey
- The previously distributed symmetric key.keyIdentifier
- The key identifier.keyDate
- The 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.AuthenticationException
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 void setOriginatorInfo(OriginatorInfo originatorInfo)
Do not use this method if PKCS#7 v1.5 interoperability is required.
public void setUnauthenticatedAttributes(oracle.security.crypto.cert.AttributeSet unauthenticatedAttributes)
unauthenticatedAttributes
- The unauthenticated attributes.public void setAuthenticatedAttributes(oracle.security.crypto.cert.AttributeSet authenticatedAttributes, AlgorithmIdentifier digestAlgorithm) throws InvalidInputException
authenticatedAttributes
- The authenticated attributes.digestAlgorithm
- The Message Digest Algorithm.InvalidInputException
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 |