Skip navigation links

Oracle Fusion Middleware CMS Java API Reference for Oracle Security Developer Tools
11g Release 1 (11.1.1)

E10667-03


oracle.security.crypto.cms
Class CMSAuthenticatedDataContentInfo

java.lang.Object
  extended by oracle.security.crypto.cms.CMSContentInfo
      extended by oracle.security.crypto.cms.CMSAuthenticatedDataContentInfo

All Implemented Interfaces:
oracle.security.crypto.asn1.ASN1Object, oracle.security.crypto.util.Streamable

public class CMSAuthenticatedDataContentInfo
extends CMSContentInfo

This class encapsulates a CMS object of content type authenticated-data. Previously, contentAuthenticationKey( oracle.security.crypto.core.Symmetric key) was a part of this class.It has been replaced by contentAuthenticationkeyBytes(array of key bytes) and contentAuthentication Algorithm Name.


Constructor Summary
CMSAuthenticatedDataContentInfo()
          Creates an empty CMSAuthenticatedDataContentInfo.
CMSAuthenticatedDataContentInfo(CMSContentInfo contentInfo, javax.crypto.SecretKey hmacKey, oracle.security.crypto.core.AlgorithmIdentifier macAlgorithm)
          Creates a CMSAuthenticatedDataContentInfo.
CMSAuthenticatedDataContentInfo(CMSContentInfo contentInfo, javax.crypto.SecretKey hmacKey, OriginatorInfo originatorInfo, oracle.security.crypto.core.AlgorithmIdentifier macAlgorithm, oracle.security.crypto.core.AlgorithmIdentifier digestAlgorithm, oracle.security.crypto.cert.AttributeSet authenticatedAttributes, oracle.security.crypto.cert.AttributeSet unauthenticatedAttributes)
          Creates a CMSAuthenticatedDataContentInfo.
CMSAuthenticatedDataContentInfo(CMSContentInfo contentInfo, javax.crypto.SecretKey hmacKey, java.lang.String hmacKeyAlgo, OriginatorInfo originatorInfo, oracle.security.crypto.core.AlgorithmIdentifier macAlgorithm, oracle.security.crypto.core.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(oracle.security.crypto.core.AlgorithmIdentifier keyEncryptionAlgID, javax.crypto.SecretKey keyEncryptionKey, byte[] keyIdentifier, java.util.Date keyDate, oracle.security.crypto.asn1.ASN1Sequence otherKeyAttribute)
          Add a recipient.
 void addRecipient(CMSRecipientInfoSpec ris)
          Add a recipient.
 void addRecipient(java.security.cert.X509Certificate recipientCert, oracle.security.crypto.core.AlgorithmIdentifier keyEncryptionAlgID)
          Add a recipient.
 void addRecipient(java.security.cert.X509Certificate recipientCert, oracle.security.crypto.core.AlgorithmIdentifier keyEncryptionAlgID, boolean useSPKI64)
          Add a recipient.
 oracle.security.crypto.cert.AttributeSet getAuthenticatedAttributes()
          Returns the Authenticated Attributes.
 oracle.security.crypto.core.AlgorithmIdentifier getDigestAlgID()
          Returns the digest algorithm.
 CMSContentInfo getEnclosed()
          Returns the authenticated content.
 oracle.security.crypto.asn1.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.
 oracle.security.crypto.core.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.
 oracle.security.crypto.asn1.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, oracle.security.crypto.core.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(java.security.PrivateKey privateKey, java.security.cert.X509Certificate recipientCert)
          Returns the enclosed content after decryption.
 void verifyMAC(javax.crypto.SecretKey symmetricKey, byte[] keyIdentifier)
          Returns the enclosed content after decryption.
 void verifyMAC(javax.crypto.SecretKey symmetricKey, byte[] keyIdentifier, java.util.Date keyDate)
          Returns the enclosed content after decryption.
 void verifyMAC(javax.crypto.SecretKey symmetricKey, byte[] keyIdentifier, java.util.Date keyDate, oracle.security.crypto.asn1.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

CMSAuthenticatedDataContentInfo

public CMSAuthenticatedDataContentInfo()
Creates an empty CMSAuthenticatedDataContentInfo.

CMSAuthenticatedDataContentInfo

public CMSAuthenticatedDataContentInfo(CMSContentInfo contentInfo,
                                       javax.crypto.SecretKey hmacKey,
                                       oracle.security.crypto.core.AlgorithmIdentifier macAlgorithm)
                                throws oracle.security.crypto.util.InvalidInputException,
                                       java.security.NoSuchAlgorithmException,
                                       java.security.spec.InvalidKeySpecException,
                                       java.security.InvalidKeyException
Creates a CMSAuthenticatedDataContentInfo.

Note the change in method signature :

Previously : public CMSAuthenticatedDataContentInfo (CMSContentInfo ,SymmetricKey , AlgorithmIdentifier )

Now : public CMSAuthenticatedDataContentInfo (CMSContentInfo ,SecretKey , AlgorithmIdentifier )

Note the changes in the exceptions thrown AlgorithmIdentifier Exception is no longer thrown NoSuchAlgorithmException, InvalidKeySpecException and InvalidKeyException are also thrown now

Parameters:
contentInfo - The document to authenticate.
hmacKey - The key to use for the HMAC operation.
macAlgorithm - The message authentication algorithm.
Throws:
oracle.security.crypto.util.InvalidInputException - Input parameters are incomplete or invalid.
java.security.NoSuchAlgorithmException - Algorithm is not supported.
java.security.spec.InvalidKeySpecException - The Key Specification is invalid
java.security.InvalidKeyException - The Key is invalid

CMSAuthenticatedDataContentInfo

public CMSAuthenticatedDataContentInfo(CMSContentInfo contentInfo,
                                       javax.crypto.SecretKey hmacKey,
                                       OriginatorInfo originatorInfo,
                                       oracle.security.crypto.core.AlgorithmIdentifier macAlgorithm,
                                       oracle.security.crypto.core.AlgorithmIdentifier digestAlgorithm,
                                       oracle.security.crypto.cert.AttributeSet authenticatedAttributes,
                                       oracle.security.crypto.cert.AttributeSet unauthenticatedAttributes)
                                throws oracle.security.crypto.util.InvalidInputException,
                                       java.security.NoSuchAlgorithmException,
                                       java.security.spec.InvalidKeySpecException,
                                       java.security.InvalidKeyException
Creates a CMSAuthenticatedDataContentInfo.

Note the change in method signature :

Previously : public CMSAuthenticatedDataContentInfo (CMSContentInfo , SymmetricKey , OriginatorInfo , AlgorithmIdentifier , AlgorithmIdentifier, AttributeSet , AttributeSet)

Now : public CMSAuthenticatedDataContentInfo (CMSContentInfo , SecretKey, OriginatorInfo , AlgorithmIdentifier ,AlgorithmIdentifier, AttributeSet , AttributeSet )

Note the changes in the exceptions thrown AlgorithmIdentifier Exception is no longer thrown NoSuchAlgorithmException, InvalidKeySpecException and InvalidKeyException are also thrown now

Note that the Authenticated Attributes 'Content Type' and 'Message Digest' are automatically added.

Parameters:
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.
Throws:
oracle.security.crypto.util.InvalidInputException - Input parameters are incomplete or invalid.
java.security.NoSuchAlgorithmException - Algorithm is not supported.
java.security.spec.InvalidKeySpecException - The Key Specification is invalid
java.security.InvalidKeyException - The Key is invalid

CMSAuthenticatedDataContentInfo

public CMSAuthenticatedDataContentInfo(CMSContentInfo contentInfo,
                                       javax.crypto.SecretKey hmacKey,
                                       java.lang.String hmacKeyAlgo,
                                       OriginatorInfo originatorInfo,
                                       oracle.security.crypto.core.AlgorithmIdentifier macAlgorithm,
                                       oracle.security.crypto.core.AlgorithmIdentifier digestAlgorithm,
                                       oracle.security.crypto.cert.AttributeSet authenticatedAttributes,
                                       oracle.security.crypto.cert.AttributeSet unauthenticatedAttributes)
                                throws oracle.security.crypto.util.InvalidInputException,
                                       java.security.NoSuchAlgorithmException,
                                       java.security.spec.InvalidKeySpecException,
                                       java.security.InvalidKeyException
Creates a CMSAuthenticatedDataContentInfo.

Note the change in method signature :

Previously : public CMSAuthenticatedDataContentInfo (CMSContentInfo , SymmetricKey , String , OriginatorInfo , AlgorithmIdentifier, AlgorithmIdentifier , AttributeSet , AttributeSet )

Now : public CMSAuthenticatedDataContentInfo (CMSContentInfo , SecretKey , String , OriginatorInfo , AlgorithmIdentifier, AlgorithmIdentifier , AttributeSet ,AttributeSet )

Note the changes in the exception thrown AlgorithmIdentifier Exception is no longer thrown NoSuchAlgorithmException, InvalidKeySpecException and InvalidKeyException are also thrown now

Note that the Authenticated Attributes 'Content Type' and 'Message Digest' are automatically added.

Parameters:
contentInfo - The document to authenticate.
hmacKey - The key to use for the HMAC operation. (was previously Symmetric Key - Phaos Class)
originatorInfo - The originator information.
macAlgorithm - The message authentication algorithm.
digestAlgorithm - The message digest algorithm.
authenticatedAttributes - The set of authenticatedAttributes.
unauthenticatedAttributes - The set of unauthenticatedAttributes.
Throws:
oracle.security.crypto.util.InvalidInputException - Input parameters are incomplete or invalid.
java.security.NoSuchAlgorithmException - Algorithm is not supported.
java.security.spec.InvalidKeySpecException - The Key Specification is invalid
java.security.InvalidKeyException - The Key is invalid

CMSAuthenticatedDataContentInfo

public CMSAuthenticatedDataContentInfo(java.io.InputStream is)
                                throws java.io.IOException
Creates a CMSAuthenticatedDataContentInfo by reading a BER encoding from the given input stream.
Parameters:
is - The input stream.
Throws:
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

isDetached

public boolean isDetached()
Indicates if this object is detached.
Specified by:
isDetached in class CMSContentInfo
Returns:
Returns true if detached; false otherwise.
See Also:
CMSContentInfo.isDetached()

writeDetached

public void writeDetached(boolean writeDetachedObject)
Indicate if the CMS Object that is being authenticated should be omitted while generating this object's encoding.
Parameters:
writeDetachedObject - If true, the CMS Object that is being authenticated is not output; false otherwise.
See Also:
CMSContentInfo.isDetached()

setExposedContent

protected void setExposedContent(byte[] expContent)
Description copied from class: CMSContentInfo
Returns the contents octets of the DER encoding of the content field of this CMS object. The value returned is suitable for input to the "message-digesting" and "content-encryption" process of RFC-2630.
Specified by:
setExposedContent in class CMSContentInfo
See Also:
CMSContentInfo.isDetached()

getExposedContent

protected byte[] getExposedContent()
Description copied from class: CMSContentInfo
Returns the contents octets of the DER encoding of the content field of this CMS object. The value returned is suitable for input to the "message-digesting" and "content-encryption" process of RFC-2630.
Specified by:
getExposedContent in class CMSContentInfo
Returns:
The contents octets or null for a detached CMS object.
See Also:
CMSContentInfo.isDetached()

getVersionNumber

public java.math.BigInteger getVersionNumber()
Returns the version number.
Returns:
The version number.

getVersion

public oracle.security.crypto.asn1.ASN1Integer getVersion()
Deprecated. As of Phaos CMS 2.0.1, replaced by getVersionNumber()
Returns the version number.
Returns:
The version number as an ASN1Integer.

getOriginatorInfo

public OriginatorInfo getOriginatorInfo()
Returns the Originator Info.
Returns:
The OriginatorInfo if present or null otherwise.

getMACAlgID

public oracle.security.crypto.core.AlgorithmIdentifier getMACAlgID()
Returns the MAC algorithm used for authentication.
Returns:
The algorithm identifier.

getDigestAlgID

public oracle.security.crypto.core.AlgorithmIdentifier getDigestAlgID()
Returns the digest algorithm.
Returns:
The digest identifier if present or null otherwise.

getEnclosedContentType

public oracle.security.crypto.asn1.ASN1ObjectID getEnclosedContentType()
Returns the content type of the enclosed content.
Returns:
The content type object identifier.

getEnclosed

public CMSContentInfo getEnclosed()
Returns the authenticated content.
Returns:
The authenticated CMS object.

setEnclosed

public void setEnclosed(CMSContentInfo content)
Sets the authenticated content.

This is used to set the contents of a detached authenticated-data CMS object.

Parameters:
content - The content object.

getMAC

public byte[] getMAC()
Returns the message authentication code.
Returns:
A byte array containing the MAC.

getAuthenticatedAttributes

public oracle.security.crypto.cert.AttributeSet getAuthenticatedAttributes()
Returns the Authenticated Attributes.
Returns:
The authenticated attributes if present or null otherwise.

getUnauthenticatedAttributes

public oracle.security.crypto.cert.AttributeSet getUnauthenticatedAttributes()
Returns the Unauthenticated Attributes.
Returns:
The unauthenticated attributes if present or null otherwise.

toString

public java.lang.String toString()
Returns a brief text description of this object.
Overrides:
toString in class java.lang.Object
Returns:
A string description of this object.

recipients

public java.util.Enumeration recipients()
Returns the list of message recipients.
Returns:
An enumeration of CMSRecipientInfo objects.

addRecipient

public void addRecipient(java.security.cert.X509Certificate recipientCert,
                         oracle.security.crypto.core.AlgorithmIdentifier keyEncryptionAlgID)
                  throws java.security.InvalidKeyException,
                         javax.crypto.NoSuchPaddingException,
                         java.security.NoSuchAlgorithmException,
                         javax.crypto.BadPaddingException,
                         javax.crypto.IllegalBlockSizeException,
                         java.security.cert.CertificateEncodingException,
                         java.io.IOException
Add a recipient.

Uses the Key Transport Recipient Information with IssuerAndSerialNo as the Recipient Identifier.

Note the changes in the method signature

Previously public void addRecipient (X509 , AlgorithmIdentifier )

Now public void addRecipient (X509Certificate , AlgorithmIdentifier )

Note the change in the exceptions declared to be thrown. AlgorithmIdentifierException, and CipherException are no longer thrown. Instead, NoSuchPaddingException,NoSuchAlgorithmException, BadPaddingException, IllegalBlockSizeException, CertificateEncodingException,IOException are thrown.

Parameters:
recipientCert - The recipient's public key certificate.
keyEncryptionAlgID - The key encipherment algorithm.
Throws:
java.security.InvalidKeyException - Invalid content encryption key.
javax.crypto.NoSuchPaddingException - Padding mechanism not supported
java.security.NoSuchAlgorithmException - Algorithm Not supported
javax.crypto.BadPaddingException - Expected padding in the input not found
javax.crypto.IllegalBlockSizeException - Invalid Block size (Cipher)
java.security.cert.CertificateEncodingException - Specifies an encoding error
java.io.IOException - Input/Output Exception while instantiating X509 from an inputstream

addRecipient

public void addRecipient(java.security.cert.X509Certificate recipientCert,
                         oracle.security.crypto.core.AlgorithmIdentifier keyEncryptionAlgID,
                         boolean useSPKI64)
                  throws java.security.NoSuchAlgorithmException,
                         java.security.InvalidKeyException,
                         javax.crypto.BadPaddingException,
                         javax.crypto.IllegalBlockSizeException,
                         javax.crypto.NoSuchPaddingException
Add a recipient.

Uses the Key Transport Recipient Information with Key Identifier as the Recipient Identifier.

Note the changes in the method signature

Previously public void addRecipient (X509 , AlgorithmIdentifier,boolean )

Now public void addRecipient (X509Certificate , AlgorithmIdentifier,boolean )

Note the change in the exceptions declared to be thrown. AlgorithmIdentifierException and CipherException are no longer thrown. Instead, NoSuchPaddingException,NoSuchAlgorithmException, BadPaddingException, IllegalBlockSizeException are thrown.

Parameters:
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.
Throws:
java.security.NoSuchAlgorithmException - Unrecognized algorithm identifier.
java.security.InvalidKeyException - Invalid content encryption key.
javax.crypto.NoSuchPaddingException - Padding mechanism not supported
javax.crypto.BadPaddingException - Expected padding in the input not found
javax.crypto.IllegalBlockSizeException - Invalid Block size (Cipher)

addRecipient

public void addRecipient(CMSRecipientInfoSpec ris)
                  throws oracle.security.crypto.util.InvalidInputException,
                         java.security.InvalidKeyException,
                         javax.crypto.NoSuchPaddingException,
                         java.security.NoSuchAlgorithmException,
                         javax.crypto.BadPaddingException,
                         javax.crypto.IllegalBlockSizeException,
                         java.security.InvalidAlgorithmParameterException,
                         java.security.spec.InvalidKeySpecException
Add a recipient.

Note the changes in the list of Exceptions thrown. Exceptions no longer thrown - AlgorithmIdentifierException and CipherException Exceptions introduced - NoSuchPaddingException, NoSuchAlgorithmException,BadPaddingException, IllegalBlockSizeException,InvalidAlgorithmParameterException, InvalidKeySpecException

Parameters:
ris - The recipient's information.
Throws:
oracle.security.crypto.util.InvalidInputException - Unrecognized RecipientInfoSpec.
java.security.InvalidKeyException - Invalid content encryption key.
javax.crypto.NoSuchPaddingException - Padding mechanism not supported
javax.crypto.BadPaddingException - Expected padding in the input not found
javax.crypto.IllegalBlockSizeException - Invalid Block size (Cipher)
java.security.NoSuchAlgorithmException - Unrecognized algorithm identifier.
java.security.InvalidAlgorithmParameterException - AlgorithmParameters are not valid
java.security.spec.InvalidKeySpecException - InvalidKey Specification

addRecipient

public void addRecipient(oracle.security.crypto.core.AlgorithmIdentifier keyEncryptionAlgID,
                         javax.crypto.SecretKey keyEncryptionKey,
                         byte[] keyIdentifier,
                         java.util.Date keyDate,
                         oracle.security.crypto.asn1.ASN1Sequence otherKeyAttribute)
                  throws java.security.InvalidKeyException,
                         oracle.security.crypto.util.InvalidInputException,
                         java.security.NoSuchAlgorithmException,
                         javax.crypto.BadPaddingException,
                         javax.crypto.IllegalBlockSizeException,
                         javax.crypto.NoSuchPaddingException,
                         java.security.InvalidAlgorithmParameterException,
                         java.security.spec.InvalidKeySpecException
Add a recipient.

Uses the Key Encryption Key Recipient Information.

Note the changes in the method signature

Previously public void addRecipient (AlgorithmIdentifier , SymmetricKey, byte[], Date , ASN1Sequence)

Now public void addRecipient (AlgorithmIdentifier , SecretKey, byte[], Date , ASN1Sequence)

Note the change in the exceptions declared to be thrown. Exceptions no longer thrown - AlgorithmIdentifierException and CipherException Exceptions introduced - NoSuchPaddingException, NoSuchAlgorithmException,BadPaddingException, IllegalBlockSizeException,InvalidAlgorithmParameterException, InvalidKeySpecException

Parameters:
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.
Throws:
oracle.security.crypto.util.InvalidInputException - Unrecognized RecipientInfoSpec.
java.security.InvalidKeyException - Invalid content encryption key.
javax.crypto.NoSuchPaddingException - Padding mechanism not supported
javax.crypto.BadPaddingException - Expected padding in the input not found
javax.crypto.IllegalBlockSizeException - Invalid Block size (Cipher)
java.security.NoSuchAlgorithmException - Unrecognized algorithm identifier.
java.security.InvalidAlgorithmParameterException - AlgorithmParameters are not valid
java.security.spec.InvalidKeySpecException - InvalidKey Specification

verifyMAC

public void verifyMAC(java.security.PrivateKey privateKey,
                      java.security.cert.X509Certificate recipientCert)
               throws java.security.InvalidKeyException,
                      UnknownRecipientException,
                      oracle.security.crypto.util.InvalidInputException,
                      oracle.security.crypto.core.AuthenticationException,
                      java.security.NoSuchAlgorithmException,
                      javax.crypto.NoSuchPaddingException,
                      javax.crypto.BadPaddingException,
                      javax.crypto.IllegalBlockSizeException,
                      java.security.cert.CertificateEncodingException,
                      java.io.IOException,
                      java.security.spec.InvalidKeySpecException
Returns the enclosed content after decryption.

Recipient Information uses the Key Transport Mechanism.

Note the changes in the method signature

Previously public void verifyMAC (oracle.security.crypto.core.PrivateKey , X509)

Now public void verifyMAC (java.security.PrivateKey , X509Certificate)

Note the change in the exceptions declared to be thrown. Exceptions no longer thrown - AlgorithmIdentifierException and CipherException Exceptions introduced - NoSuchAlgorithmException, NoSuchPaddingException, BadPaddingException, IllegalBlockSizeException, CertificateEncodingException,IOException,InvalidKeySpecException

Parameters:
privateKey - The recipient's private key.
recipientCert - The recipient's X509 certificate.
Throws:
java.security.InvalidKeyException - Invalid content encryption key.
UnknownRecipientException - The decryption key does belong to the recipient.
oracle.security.crypto.util.InvalidInputException - If an incorrect encoding or I/O error occurred.
javax.crypto.NoSuchPaddingException - Padding mechanism not supported
javax.crypto.BadPaddingException - Expected padding in the input not found
javax.crypto.IllegalBlockSizeException - Invalid Block size (Cipher)
java.security.NoSuchAlgorithmException - Unrecognized algorithm identifier.
java.io.IOException
java.security.spec.InvalidKeySpecException - InvalidKey Specification
java.security.cert.CertificateEncodingException - error while encoding the certificate
oracle.security.crypto.core.AuthenticationException - MAC Verification failed

verifyMAC

public void verifyMAC(javax.crypto.SecretKey symmetricKey,
                      byte[] keyIdentifier)
               throws java.security.InvalidKeyException,
                      UnknownRecipientException,
                      oracle.security.crypto.util.InvalidInputException,
                      oracle.security.crypto.core.AuthenticationException,
                      java.security.NoSuchAlgorithmException,
                      javax.crypto.BadPaddingException,
                      javax.crypto.IllegalBlockSizeException,
                      javax.crypto.NoSuchPaddingException,
                      java.security.InvalidAlgorithmParameterException,
                      java.security.spec.InvalidKeySpecException
Returns the enclosed content after decryption.

Recipient Information uses Key Encryption Key Mechanism.

Note the changes in the method signature

Previously public void verifyMAC ( SymmetricKey, byte[] )

Now public void verifyMAC (SecretKey , byte[] )

Note the change in the exceptions declared to be thrown. Exceptions no longer thrown - AlgorithmIdentifierException and CipherException Exceptions introduced - NoSuchAlgorithmException, NoSuchPaddingException, BadPaddingException, IllegalBlockSizeException, InvalidKeySpecException,InvalidAlgorithmParameterException

Parameters:
symmetricKey - The previously distributed symmetric key.
keyIdentifier - The key identifier.
Throws:
UnknownRecipientException - The decryption key does belong to the recipient.
oracle.security.crypto.util.InvalidInputException - If an incorrect encoding or I/O error occurred.
javax.crypto.NoSuchPaddingException - Padding mechanism not supported
javax.crypto.BadPaddingException - Expected padding in the input not found
javax.crypto.IllegalBlockSizeException - Invalid Block size (Cipher)
java.security.NoSuchAlgorithmException - Unrecognized algorithm identifier.
java.security.spec.InvalidKeySpecException - InvalidKey Specification
java.security.InvalidAlgorithmParameterException - Invalid AlgorithmParameters
oracle.security.crypto.core.AuthenticationException - Authentication failed
java.security.InvalidKeyException - The key is invalid

verifyMAC

public void verifyMAC(javax.crypto.SecretKey symmetricKey,
                      byte[] keyIdentifier,
                      java.util.Date keyDate)
               throws java.security.InvalidKeyException,
                      UnknownRecipientException,
                      oracle.security.crypto.util.InvalidInputException,
                      oracle.security.crypto.core.AuthenticationException,
                      java.security.NoSuchAlgorithmException,
                      javax.crypto.BadPaddingException,
                      javax.crypto.IllegalBlockSizeException,
                      javax.crypto.NoSuchPaddingException,
                      java.security.InvalidAlgorithmParameterException,
                      java.security.spec.InvalidKeySpecException
Returns the enclosed content after decryption.

Recipient Information uses Key Encryption Key Mechanism.

Note the changes in the method signature

Previously public void verifyMAC ( SymmetricKey, byte[],Date )

Now public void verifyMAC (SecretKey , byte[] ,Date)

Note the change in the exceptions declared to be thrown. Exceptions no longer thrown - AlgorithmIdentifierException and CipherException Exceptions introduced - NoSuchAlgorithmException, NoSuchPaddingException, BadPaddingException, IllegalBlockSizeException, InvalidKeySpecException,InvalidAlgorithmParameterException

Parameters:
symmetricKey - The previously distributed symmetric key.
keyIdentifier - Key identifier.
keyDate - Key generation date.
Throws:
UnknownRecipientException - The decryption key does belong to the recipient.
oracle.security.crypto.util.InvalidInputException - If an incorrect encoding or I/O error occurred.
javax.crypto.NoSuchPaddingException - Padding mechanism not supported
javax.crypto.BadPaddingException - Expected padding in the input not found
javax.crypto.IllegalBlockSizeException - Invalid Block size (Cipher)
java.security.NoSuchAlgorithmException - Unrecognized algorithm identifier.
java.security.spec.InvalidKeySpecException - InvalidKey Specification
java.security.InvalidAlgorithmParameterException - Invalid AlgorithmParameters
oracle.security.crypto.core.AuthenticationException - Authentication failed
java.security.InvalidKeyException - The key is invalid

verifyMAC

public void verifyMAC(javax.crypto.SecretKey symmetricKey,
                      byte[] keyIdentifier,
                      java.util.Date keyDate,
                      oracle.security.crypto.asn1.ASN1Sequence otherKeyAttribute)
               throws java.security.InvalidKeyException,
                      UnknownRecipientException,
                      oracle.security.crypto.util.InvalidInputException,
                      oracle.security.crypto.core.AuthenticationException,
                      java.security.NoSuchAlgorithmException,
                      javax.crypto.BadPaddingException,
                      javax.crypto.IllegalBlockSizeException,
                      javax.crypto.NoSuchPaddingException,
                      java.security.InvalidAlgorithmParameterException,
                      java.security.spec.InvalidKeySpecException
Returns the enclosed content after decryption.

Recipient Information uses Key Encryption Key Mechanism.

Note the changes in the method signature

Previously public void verifyMAC ( SymmetricKey, byte[], Date, ASN1Sequence )

Now public void verifyMAC (SecretKey , byte[] , Date, ASN1Sequence)

Note the change in the exceptions declared to be thrown. Exceptions no longer thrown - AlgorithmIdentifierException , CipherException Exceptions introduced - NoSuchAlgorithmException, NoSuchPaddingException, BadPaddingException, IllegalBlockSizeException, InvalidKeySpecException,InvalidAlgorithmParameterException

Parameters:
symmetricKey - The previously distributed symmetric key.
keyIdentifier - The key identifier.
keyDate - The key generation date.
otherKeyAttribute - The other key attribute.
Throws:
java.security.InvalidKeyException - Invalid content encryption key.
UnknownRecipientException - The decryption key does belong to the recipient.
oracle.security.crypto.util.InvalidInputException - If an incorrect encoding or I/O error occurred.
oracle.security.crypto.core.AuthenticationException - MAC verification failed
javax.crypto.NoSuchPaddingException - Padding mechanism not supported
javax.crypto.BadPaddingException - Expected padding in the input not found
javax.crypto.IllegalBlockSizeException - Invalid Block size (Cipher)
java.security.NoSuchAlgorithmException - Unrecognized algorithm identifier.
java.security.spec.InvalidKeySpecException - InvalidKey Specification
java.security.InvalidAlgorithmParameterException - Invalid AlgorithmParameters

inputContent

protected void inputContent(java.io.InputStream is)
                     throws java.io.IOException
Description copied from class: CMSContentInfo
Initializes this object by reading the Content field of the CMS ContentInfo structure i.e. the input stream must be positioned at the value octets of the Content field i.e. after the explicit [0] tag.

This method must be implemented by subclasses. It is unlikely that package users will ever need to call it directly.

Specified by:
inputContent in class CMSContentInfo
Throws:
java.io.IOException

setOriginatorInfo

public void setOriginatorInfo(OriginatorInfo originatorInfo)
Set the OriginatorInfo.

Do not use this method if PKCS#7 v1.5 interoperability is required.

Parameters:
origInfo - The OriginatorInfo.

setUnauthenticatedAttributes

public void setUnauthenticatedAttributes(oracle.security.crypto.cert.AttributeSet unauthenticatedAttributes)
Set the unauthenticated attributes.
Parameters:
unauthenticatedAttributes - The unauthenticated attributes.

setAuthenticatedAttributes

public void setAuthenticatedAttributes(oracle.security.crypto.cert.AttributeSet authenticatedAttributes,
                                       oracle.security.crypto.core.AlgorithmIdentifier digestAlgorithm)
                                throws oracle.security.crypto.util.InvalidInputException
Set the Authenticated attributes.
Parameters:
authenticatedAttributes - The authenticated attributes.
digestAlgorithm - The Message Digest Algorithm.
Throws:
oracle.security.crypto.util.InvalidInputException

update

protected void update()
Clears the internal output cache. This method is called automatically if the object ever changes, so API users need not be concerned with it. Implementors of subclasses, however, do need to ensure that it gets called when appropriate.
Overrides:
update in class CMSContentInfo

Skip navigation links

Oracle Fusion Middleware CMS Java API Reference for Oracle Security Developer Tools
11g Release 1 (11.1.1)

E10667-03


Copyright © 2005, 2011 , Oracle. All rights reserved.