XCMS Toolkit

com.cms.crypto
Class SignerIdentifierGenerator

java.lang.Object
  extended by com.cms.crypto.SignerIdentifierGenerator

public class SignerIdentifierGenerator
extends java.lang.Object

Generates a SignerIdentifier (component of SignerInfo element in a set of SignerInfos in type SignedData) with the certHash choice alternative of ASN.1 type SignerIdentifier, which is the message digest of an encoded java.security.cert.Certificate.

ASN.1 type SignerIdentifier is defined in the international standard "ISO 22895 Cryptographic syntax schema" as

 SignerIdentifier ::= CHOICE {
    issuerAndSerialNumber  IssuerAndSerialNumber,
    subjectKeyIdentifier   [0] SubjectKeyIdentifier,
    certHash               [1] CertHash
 }
 
This definition is compatible with the definition defined in ETF RFC 3852:2004, but extends the IETF version of this type by adding a certHash choice alternative, which contains a value of ASN.1 type DigestInfo defined in ISO 22895:2006 as
 CertHash ::= DigestInfo
 
 DigestInfo ::= SEQUENCE {
    hashAlgorithm  DigestAlgorithmIdentifier, 
    digest         Digest
 }
 
 Digest ::= OCTET STRING
 
When used as a value of the certHash choice alternative of ASN.1 type SignerIdentifier, the digest component of ASN.1 type DigestInfo contains the hash of an entire certificate. The format and type of certificate is not specified and can be any supported by the application using this toolkit.

Note that the issuerAndSerialNumber choice alternative of ASN.1 type SignerIdentifier is not currently supported.

Version:
1.00 - 2006/02/10
Author:
support@phillipgriffin.com

Constructor Summary
SignerIdentifierGenerator(DigestAlgorithmIdentifier dai)
          Constructor for SignerIdentifierGenerator with a value of ASN.1 type DigestAlgorithmIdentifier parameter.
 
Method Summary
 SignerIdentifier generate(java.security.cert.Certificate c)
          Computes the message digest (hash) of an encoded public key certificate and builds a value of ASN.1 type SignerIdentifier.
 SignerIdentifier generate(java.security.PublicKey key)
          Computes the message digest (hash) of an encoded value of ASN.1 type SubjectPublicKeyInfo to build a value of ASN.1 type SignerIdentifier.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SignerIdentifierGenerator

public SignerIdentifierGenerator(DigestAlgorithmIdentifier dai)
                          throws java.security.NoSuchAlgorithmException
Constructor for SignerIdentifierGenerator with a value of ASN.1 type DigestAlgorithmIdentifier parameter.

Parameters:
dai - a message digest (hash) algorithm information object identifier and any associated algorithm parameters
Throws:
java.security.NoSuchAlgorithmException
Method Detail

generate

public SignerIdentifier generate(java.security.cert.Certificate c)
                          throws java.security.cert.CertificateEncodingException
Computes the message digest (hash) of an encoded public key certificate and builds a value of ASN.1 type SignerIdentifier.

Parameters:
c - a Public Key certificate
Returns:
a signer identifier
Throws:
java.security.cert.CertificateEncodingException

generate

public SignerIdentifier generate(java.security.PublicKey key)
                          throws DecodingException,
                                 java.io.IOException,
                                 java.security.NoSuchAlgorithmException
Computes the message digest (hash) of an encoded value of ASN.1 type SubjectPublicKeyInfo to build a value of ASN.1 type SignerIdentifier.

Parameters:
key - a public key
Returns:
a signer identifier
Throws:
DecodingException
java.io.IOException
java.security.NoSuchAlgorithmException

XCMS Toolkit


Copyright © 2005-2006 GRIFFIN Consulting. All Rights Reserved.