IAIK PKCS#11 Provider Micro Edition
version 1.0

iaik.pkcs.pkcs11.me
Class Module

java.lang.Object
  extended byiaik.pkcs.pkcs11.me.Module

public class Module
extends java.lang.Object

This is the main class in this package. Through it, the application gets access to token objects.
The application starts with something like

  String moduleName = "aetpkss1.dll";
  Module module = Module.getInstance(moduleName);
  
  Token[] tokens = module.getTokens();
 
The string provided to the static getInstance method contains the name of the PKCS#11 module of the underlying crypto hardware; e.g. the PKCS#11 module for the smart card. In this example, it is the module called aetpkss1.dll, which is the PKCS#11 module of AET Europe's SafeSign software which supports G&D cards and most JavaCards.
The following call to getTokens returns a list of all available crypto tokens. For example, if there is smart card in the card reader—both compatible with the PKCS#11 module—the list will contain one token. If there is no card present, the list will be empty (but not null).

This class is thread-safe.

See Also:
Token

Method Summary
 void close()
          Closes this module.
static Module getInstance(java.lang.String moduleName)
          Creates an instance that accesses the specified PKCS#11 module.
 java.lang.String getManufacturer()
          Get the manufacturer name of the underlying PKCS#11 module.
 Token[] getTokens()
          Get the list of all available tokens.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getInstance

public static Module getInstance(java.lang.String moduleName)
                          throws java.io.IOException,
                                 PKCS11RuntimeException
Creates an instance that accesses the specified PKCS#11 module. The module name must be the name of the PKCS#11 shared library; e.g. aetpkss1.dll.
This method initializes the PKCS#11 module with the CKF_OS_LOCKING_OK flag set to true. No other flags are set. The reserved parameter is set to null.

Parameters:
moduleName - The PKCS#11 module name.
Returns:
The module instance.
Throws:
java.io.IOException - If connecting to the PKCS#11 module fails.
PKCS11RuntimeException - If initializing the module fails.

close

public void close()
           throws PKCS11RuntimeException
Closes this module. This causes a call to the C_Finalize function of the underlying PKCS#11 module. After this call, the application must not use this module any longer.

Throws:
PKCS11RuntimeException - If finalizing the module fails.

getManufacturer

public java.lang.String getManufacturer()
                                 throws PKCS11RuntimeException
Get the manufacturer name of the underlying PKCS#11 module.

Returns:
The name of the manufacturer of the PKCS#11 module.
Throws:
PKCS11RuntimeException - If getting the module info fails.

getTokens

public Token[] getTokens()
                  throws PKCS11RuntimeException
Get the list of all available tokens. For example, there is a smart card in a card reader—both compatible with the underlying PKCS#11 module—the list will contain one token. If there is no (compatible) token available, the list is empty but not null.

Returns:
The list of present tokens.
Throws:
PKCS11RuntimeException - If getting the token list fails.

IAIK PKCS#11 Provider Micro Edition
version 1.0

IAIK JavaSecurity Website http://jce.iaik.tugraz.at/

IAIK at Graz University of Technology, Austria, Europe
Copyright 2001-2005, IAIK, Graz University of Technology, Inffeldgasse 16a, 8010 Graz, Austria. All Rights Reserved.
version 1.0