Oracle Security Developer Tools CMS Java API Reference
10g (10.1.4.0.1)

B28170-01


oracle.security.crypto.cms
Class CMSSignerInfoSpec

java.lang.Object
  extended byoracle.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, oracle.security.crypto.core.PrivateKey signerKey, oracle.security.crypto.cert.X509 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, oracle.security.crypto.core.PrivateKey signerKey, oracle.security.crypto.cert.X509 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.
 oracle.security.crypto.core.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,
                         oracle.security.crypto.core.PrivateKey signerKey,
                         oracle.security.crypto.cert.X509 signerCert,
                         oracle.security.crypto.core.AlgorithmIdentifier digestAlgID,
                         oracle.security.crypto.core.AlgorithmIdentifier digestEncryptionAlgID,
                         oracle.security.crypto.cert.AttributeSet unauthenticatedAttributes)
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.

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.

CMSSignerInfoSpec

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

Please ensure that the signed (authenticated) attributes do not contain the messageDigest or contentType attributes, as these will be generated automatically.

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.

Method Detail

hashCode

public int hashCode()
Returns a hash code value for this object.
Returns:
The hash code value.

equals

public boolean equals(java.lang.Object obj)
Indicates whether some other object is "equal to" this one.
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 oracle.security.crypto.core.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.

Oracle Security Developer Tools CMS Java API Reference
10g (10.1.4.0.1)

B28170-01


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