IAIK CMS/SMIME Toolkit Demo API Documentation
Version 6.1

demo.smime.ess
Class SigningCertificateV2Demo

java.lang.Object
  extended by demo.smime.ess.SigningCertificateDemo
      extended by demo.smime.ess.SigningCertificateV2Demo

public class SigningCertificateV2Demo
extends SigningCertificateDemo

Demonstrates how to add and parse a SigningCertificateV2 attribute to the SignerInfo of a SignedDataStream or SignedData object. The SigningCertificateV2 attributes maybe used to include certificate identification information into the signed attributes of a CMS SignerInfo object. It has been introduced by RFC 5035 to allow to use the SigningCertificate attribute with other hash algorithms than SHA-1.

See Also:
SigningCertificate, SigningCertificateV2, SignerInfo, SignedDataStream, SignedData

Constructor Summary
SigningCertificateV2Demo()
          Setups the demo certificate chains.
 
Method Summary
protected  iaik.smime.ess.SigningCertificate createSigningCertificate(java.security.cert.Certificate[] certs)
          Creates a SigningCertificateV2 attribute for the given certificates.
protected  iaik.smime.ess.SigningCertificate getSigningCertificate(iaik.cms.SignerInfo signerInfo)
          Gets the SigningCertificateV2 attribute from the given SignerInfo.
static void main(java.lang.String[] args)
          The main method.
protected  void printHeader()
          Prints some header lines to System.out.
 
Methods inherited from class demo.smime.ess.SigningCertificateDemo
createAttributeCertificate, createSignedData, createSignedDataStream, getSignedData, getSignedDataStream, start
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SigningCertificateV2Demo

public SigningCertificateV2Demo()
                         throws java.io.IOException
Setups the demo certificate chains. Keys and certificate are retrieved from the demo KeyStore.

Throws:
java.io.IOException - if an file read error occurs
Method Detail

createSigningCertificate

protected iaik.smime.ess.SigningCertificate createSigningCertificate(java.security.cert.Certificate[] certs)
                                                              throws iaik.cms.CMSException
Creates a SigningCertificateV2 attribute for the given certificates.

Overrides:
createSigningCertificate in class SigningCertificateDemo
Parameters:
certs - the certificates for which to create the SigningCertificateV2 attribute
Returns:
the SigningCertificate attribute just created
Throws:
iaik.cms.CMSException - if an error occurs when creating the SigningCertificateV2 attribute

getSigningCertificate

protected iaik.smime.ess.SigningCertificate getSigningCertificate(iaik.cms.SignerInfo signerInfo)
                                                           throws iaik.cms.CMSException
Gets the SigningCertificateV2 attribute from the given SignerInfo.

Overrides:
getSigningCertificate in class SigningCertificateDemo
Parameters:
signerInfo - the SignerInfo from which to get the SigningCertificateV2 attribute
Returns:
the SigningCertificateV2 attribute, or null if no SigningCertificate attribute is included
Throws:
iaik.cms.CMSException - if an error occurs when getting the SigningCertificateV2 attribute

printHeader

protected void printHeader()
Prints some header lines to System.out.

Overrides:
printHeader in class SigningCertificateDemo

main

public static void main(java.lang.String[] args)
                 throws java.lang.Exception
The main method.

Throws:
java.io.IOException - if an I/O error occurs when reading required keys and certificates from files
java.lang.Exception

IAIK CMS/SMIME Toolkit Demo API Documentation
Version 6.1

v6.1
(c) 2002 IAIK, (c) 2003 - 2025 SIC