Skip navigation links

Oracle Security Developer Tools CMS Java API Reference
11g (11.1.1)

E10667-02


oracle.security.crypto.cms
Class CMSSignerInfoSpec

java.lang.Object
  extended by oracle.security.crypto.cms.CMSSignerInfoSpec


public final class CMSSignerInfoSpec
extends java.lang.Object

This class encapsulates message signer information.

See Also:
CMSSignerInfo

Constructor Summary
CMSSignerInfoSpec(oracle.security.crypto.cert.AttributeSet authenticatedAttributes, java.security.PrivateKey signerKey, java.security.cert.X509Certificate signerCert, oracle.security.crypto.core.AlgorithmIdentifier digestAlgID, oracle.security.crypto.core.AlgorithmIdentifier digestEncryptionAlgID, oracle.security.crypto.cert.AttributeSet unauthenticatedAttributes)
          Creates a CMSSignerInfoSpec.
CMSSignerInfoSpec(oracle.security.crypto.cert.AttributeSet authenticatedAttributes, java.security.PrivateKey signerKey, java.security.cert.X509Certificate signerCert, oracle.security.crypto.core.AlgorithmIdentifier digestAlgID, oracle.security.crypto.core.AlgorithmIdentifier digestEncryptionAlgID, oracle.security.crypto.cert.AttributeSet unauthenticatedAttributes, boolean useSPKI)
          Creates a CMSSignerInfoSpec.

 

Method Summary
 boolean equals(java.lang.Object obj)
          Indicates whether some other object is "equal to" this one.
 byte[] generate160BitSPKI()
          Generates the 160 bit Subject Public Key Identifier as per RFC 2459 which is a 160 bit SHA-1 hash of the value of the BIT STRING.
 byte[] generate64BitSPKI()
          Generates the 64 bit Subject Public Key Identifier as per RFC 2459 which is 0100 followed by the least significant 60 bits of SHA-1 hash of the value of the BIT STRING.
 oracle.security.crypto.cert.AttributeSet getAuthenticatedAttributes()
          Returns the signed attributes.
 oracle.security.crypto.core.AlgorithmIdentifier getDigestAlgID()
          Returns the digest algorithm.
 oracle.security.crypto.core.AlgorithmIdentifier getDigestEncryptionAlgID()
          Returns the signature algorithm.
 oracle.security.crypto.cert.X500Name getIssuer()
          Returns the distinguished name of the CA which issued the signer's certificate.
 java.math.BigInteger getSerialNo()
          Returns the serial number of the signer's certificate.
 java.security.PrivateKey getSignerKey()
          Returns the signer's private key.
 oracle.security.crypto.cert.AttributeSet getUnauthenticatedAttributes()
          Returns the unsigned attributes.
 int hashCode()
          Returns a hash code value for this object.
 boolean isSPKI()
          Checks if Subject Public Key Identifier is being used as the signer identifier.
 boolean isSPKI64()
           
 void useSPKI64(boolean useSPKI64)
          Specifies if the 64 bit Subject Public Key Identifier is to be used.

 

Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait

 

Constructor Detail

CMSSignerInfoSpec

public CMSSignerInfoSpec(oracle.security.crypto.cert.AttributeSet authenticatedAttributes,
                         java.security.PrivateKey signerKey,
                         java.security.cert.X509Certificate signerCert,
                         oracle.security.crypto.core.AlgorithmIdentifier digestAlgID,
                         oracle.security.crypto.core.AlgorithmIdentifier digestEncryptionAlgID,
                         oracle.security.crypto.cert.AttributeSet unauthenticatedAttributes)
                  throws java.security.NoSuchAlgorithmException
Creates a CMSSignerInfoSpec.

Signed(Authenticated) Attributes must not contain the messageDigest or contentType attributes, as these will be generated automatically.

Issuer and Serial Number (IASN) will be used as the Signer Identifier.

This method will return only if the signature is valid.

Note the changes in the Method signature

Previouslypublic CMSSignerInfoSpec (AttributeSet , oracle.security.crypto.core.PrivateKey, X509, AlgorithmIdentifier , AlgorithmIdentifier, AttributeSet)

Nowpublic CMSSignerInfoSpec (AttributeSet , java.security.PrivateKey, X509Certificate, AlgorithmIdentifier , AlgorithmIdentifier, AttributeSet)

Note the changes in the exceptions

Exceptions included -- NoSuchAlgorithmException

Parameters:
authenticatedAttributes - The set of authenticated attributes.
signerKey - The private key to sign with.
signerCert - The signer's X.509 certificate.
digestAlgID - The message digest algorithm.
digestEncryptionAlgID - The cipher algorithm with which to encrypt the result of the message digest.
unauthenticatedAttributes - The set of unauthenticated attributes.
Throws:
java.security.NoSuchAlgorithmException - Algorithm not supported

CMSSignerInfoSpec

public CMSSignerInfoSpec(oracle.security.crypto.cert.AttributeSet authenticatedAttributes,
                         java.security.PrivateKey signerKey,
                         java.security.cert.X509Certificate signerCert,
                         oracle.security.crypto.core.AlgorithmIdentifier digestAlgID,
                         oracle.security.crypto.core.AlgorithmIdentifier digestEncryptionAlgID,
                         oracle.security.crypto.cert.AttributeSet unauthenticatedAttributes,
                         boolean useSPKI)
                  throws java.security.NoSuchAlgorithmException
Creates a CMSSignerInfoSpec.

Please ensure that the signed (authenticated) attributes do not contain the messageDigest or contentType attributes, as these will be generated automatically. p>This method will return only if the signature is valid.

Note the changes in the Method signature

Previouslypublic CMSSignerInfoSpec (AttributeSet , oracle.security.crypto.core.PrivateKey, X509, AlgorithmIdentifier , AlgorithmIdentifier, AttributeSet , boolean)

Nowpublic CMSSignerInfoSpec (AttributeSet , java.security.PrivateKey, X509Certificate, AlgorithmIdentifier , AlgorithmIdentifier, AttributeSet,boolean)

Note the changes in the exceptions

Exceptions included -- NoSuchAlgorithmException

Parameters:
authenticatedAttributes - The set of authenticated attributes.
signerKey - The private key to sign with.
signerCert - The signer's X.509 certificate.
digestAlgID - The message digest algorithm.
digestEncryptionAlgID - The cipher algorithm with which to encrypt the result of the message digest.
unauthenticatedAttributes - The set of unauthenticated attributes.
useSPKI - If true Subject Public Key Identifier (SPKI) will be used as the Signer Identifier; If false the Issuer and Serial Number (IASN) will be used.
Throws:
java.security.NoSuchAlgorithmException - Algorithm not supported

Method Detail

hashCode

public int hashCode()
Returns a hash code value for this object.
Overrides:
hashCode in class java.lang.Object
Returns:
The hash code value.

equals

public boolean equals(java.lang.Object obj)
Indicates whether some other object is "equal to" this one.
Overrides:
equals in class java.lang.Object
Returns:
true if this object is the same as the obj argument; false otherwise.

generate64BitSPKI

public byte[] generate64BitSPKI()
Generates the 64 bit Subject Public Key Identifier as per RFC 2459 which is 0100 followed by the least significant 60 bits of SHA-1 hash of the value of the BIT STRING.
Returns:
A byte array containg the identifier.

generate160BitSPKI

public byte[] generate160BitSPKI()
Generates the 160 bit Subject Public Key Identifier as per RFC 2459 which is a 160 bit SHA-1 hash of the value of the BIT STRING.
Returns:
A byte array containing the identifier.

useSPKI64

public void useSPKI64(boolean useSPKI64)
Specifies if the 64 bit Subject Public Key Identifier is to be used.
Parameters:
useSPKI64 - If true the 64 bit SPKI will be used; If false the 160 bit SPKI will be used

isSPKI64

public boolean isSPKI64()

getIssuer

public oracle.security.crypto.cert.X500Name getIssuer()
Returns the distinguished name of the CA which issued the signer's certificate.
Returns:
The X500Name of the issuer of the signing certificate.

getSerialNo

public java.math.BigInteger getSerialNo()
Returns the serial number of the signer's certificate.
Returns:
The serial number of the signing certificate.

getAuthenticatedAttributes

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

getUnauthenticatedAttributes

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

getDigestAlgID

public oracle.security.crypto.core.AlgorithmIdentifier getDigestAlgID()
Returns the digest algorithm.
Returns:
The digest algorithm identifier.

getDigestEncryptionAlgID

public oracle.security.crypto.core.AlgorithmIdentifier getDigestEncryptionAlgID()
Returns the signature algorithm.
Returns:
The signature algorithm identifier.

getSignerKey

public java.security.PrivateKey getSignerKey()
Returns the signer's private key.
Returns:
The sigining key.

isSPKI

public boolean isSPKI()
Checks if Subject Public Key Identifier is being used as the signer identifier.
Returns:
true if the signer identifier uses SPKI; false otherwise.

Skip navigation links

Oracle Security Developer Tools CMS Java API Reference
11g (11.1.1)

E10667-02


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