IAIK CMS/SMIME Toolkit Demo API Documentation
Version 6.1

demo.cms.pkcs11
Class PKCS11Demo

java.lang.Object
  extended by demo.cms.pkcs11.PKCS11Demo
Direct Known Subclasses:
EncryptedMailDemo, EnvelopedDataStreamDemo, SignedDataStreamDemo, SignedMailDemo

public abstract class PKCS11Demo
extends java.lang.Object

Base class for PKCS#11 Demos.


Field Summary
protected  iaik.pkcs.pkcs11.provider.IAIKPkcs11 iaikPkcs11Provider_
          The PKCS#11 JCE provider.
protected  iaik.security.provider.IAIK iaikSoftwareProvider_
          The IAIK JCE software provider.
protected  java.lang.String moduleName_
          Module name (native PKCS#11 module of the cryptographic hardware.
protected  java.security.KeyStore tokenKeyStore_
          The key store that represents the token (smart card) contents.
protected  char[] userPin_
          The user pin for the token key store.
 
Constructor Summary
protected PKCS11Demo()
          Creates a PKCS11Demo object that has to be explicitly initialized with a module name.
  PKCS11Demo(java.lang.String moduleName, char[] userPin)
          Creates a PKCS11Demo object for the given module name.
 
Method Summary
 void getKeyStore()
          This method gets the key store of the PKCS#11 provider and stores a reference atpkcs11ClientKeystore_.
 void init(java.lang.String moduleName, char[] userPin)
          Inits this PKCS11Demo object for the given module name.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

moduleName_

protected java.lang.String moduleName_
Module name (native PKCS#11 module of the cryptographic hardware. It may be necessary to provide the file with the full path, if the module is not in the search path of the system).


userPin_

protected char[] userPin_
The user pin for the token key store.


iaikPkcs11Provider_

protected iaik.pkcs.pkcs11.provider.IAIKPkcs11 iaikPkcs11Provider_
The PKCS#11 JCE provider.


iaikSoftwareProvider_

protected iaik.security.provider.IAIK iaikSoftwareProvider_
The IAIK JCE software provider.


tokenKeyStore_

protected java.security.KeyStore tokenKeyStore_
The key store that represents the token (smart card) contents.

Constructor Detail

PKCS11Demo

protected PKCS11Demo()
Creates a PKCS11Demo object that has to be explicitly initialized with a module name.


PKCS11Demo

public PKCS11Demo(java.lang.String moduleName,
                  char[] userPin)
Creates a PKCS11Demo object for the given module name.

Parameters:
moduleName - the name of the module
userPin - the user-pin (password) for the TokenKeyStore (may be null to pop-up a dialog asking for the pin)
Method Detail

init

public void init(java.lang.String moduleName,
                 char[] userPin)
Inits this PKCS11Demo object for the given module name.

Parameters:
moduleName - the name of the module
userPin - the user-pin (password) for the TokenKeyStore (may be null to pou-up a dialog asking for the pin)

getKeyStore

public void getKeyStore()
                 throws java.security.GeneralSecurityException,
                        java.io.IOException
This method gets the key store of the PKCS#11 provider and stores a reference atpkcs11ClientKeystore_.

Throws:
java.security.GeneralSecurityException - If anything with the provider fails.
java.io.IOException - If loading the key store fails.

IAIK CMS/SMIME Toolkit Demo API Documentation
Version 6.1

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