RSA BSAFE CRYPTO-J

Cryptographic Components for Java

JSAFE Javadoc JCE Javadoc Search

JSAFE_Session Class Reference

This class establishes a session with a token present in a hardware device. Use it in conjunction with subclasses of JSAFE_SessionSpec.

The JSAFE_Session class describes how to connect to a PKCS #11 device. An instance of this class sets up one of the JSAFE cryptographic transformation objects (RSA and DSA signers, verifiers, key-pair generators, etc.). It then calls on a PKCS #11 device to perform the functionality specified when the object is created. Using an object of this class enables Crypto-J to initialize the PKCS #11 device and create a new session to perform the desired functionality on the device.

Creates and returns an object that encapsulates the information needed to open a session with a token in a device that supports the Cryptoki (PKCS #11) interface.

See Overview of Crypto-J for background and reference material on using and understanding Crypto-J.

Copyright © RSA Security Inc., 1999-2005. All rights reserved.

See also:
JSAFE_SessionSpec , JSAFE_PKCS11SessionSpec

Inheritance diagram for JSAFE_Session:

JSAFE_Object List of all members.

Public Methods

abstract void JSAFE_Session:: closeSession ()
 Closes the PKCS #11 session. More...

abstract String JSAFE_Session:: getDevice ()
 Returns the name of the device (such as "PKCS11") for which this session is instantiated. More...

JSAFE_SessionSpec JSAFE_Session:: getSessionSpec ()
 Gets a reference to the JSAFE_SessionSpec used by this JSAFE_Session object. More...

Object JSAFE_Session:: clone () throws CloneNotSupportedException
 Duplicates the existing object. More...

void JSAFE_Session:: clearSensitiveData ()
 This method clears sensitive data from an object. More...


Static Public Methods

JSAFE_Session JSAFE_Session:: getInstance (JSAFE_SessionSpec spec) throws JSAFE_UnimplementedException, JSAFE_InvalidParameterException, JSAFE_InvalidUseException
 Builds an object that establishes a session with a hardware token via the specified vendor-supplied shared library, or reuses a previously established session. More...


Member Function Documentation

void JSAFE_Session::clearSensitiveData   [inline];
 

This method clears sensitive data from an object. Although the finalizer clears the data, there is no guarantee the garbage collector will quickly call the finalizer. Allows a user to clear data as soon as possible. After calling clearSensitiveData(), an Init (not a ReInit) method is called to perform other operations with the object.

Reimplemented from JSAFE_Object.

Object JSAFE_Session::clone   throws CloneNotSupportedException [inline];
 

Duplicates the existing object.

Returns:
Return value from superclass clone() method.
Exceptions:
CloneNotSupporedException If the method is not implemented in the child class.

Reimplemented from JSAFE_Object.

abstract void JSAFE_Session::closeSession   [pure virtual];
 

Closes the PKCS #11 session. Before terminating the program, all sessions must be closed. If the session is already closed, this method does nothing. The method clearSensitiveData() calls this method. The JSAFE_Session objects should be closed in the reverse of the order they were created in.

abstract String JSAFE_Session::getDevice   [pure virtual];
 

Returns the name of the device (such as "PKCS11") for which this session is instantiated.

Returns:
the device name

JSAFE_Session JSAFE_Session::getInstance JSAFE_SessionSpec    spec throws JSAFE_UnimplementedException, JSAFE_InvalidParameterException, JSAFE_InvalidUseException [inline, static];
 

Builds an object that establishes a session with a hardware token via the specified vendor-supplied shared library, or reuses a previously established session.

Parameters:
spec An instance of JSAFE_SessionSpec that specifies how and with which device the connection is established.
Returns:
A JSAFE_Session object that represents a session with a hardware token.
Exceptions:
JSAFE_UnimplementedException If a device cannot be found, or the specified token that meets the conditions in the JSAFE_SessionSpec is not available.
JSAFE_InvalidParameterException If the specified session is null.
JSAFE_InvalidUseException If no device builders exist for the specified session.
See also:
JSAFE_SessionSpec , JSAFE_PKCS11SessionSpec

JSAFE_SessionSpec JSAFE_Session::getSessionSpec   [inline];
 

Gets a reference to the JSAFE_SessionSpec used by this JSAFE_Session object. This is a reference to the JSAFE_SessionSpec passed in during the call to getInstance().

Returns the session specification used to build the system. The session specification may have new information inserted by the session.

Returns:
A reference (not a copy or clone) to the JSAFE_SessionSpec used by this object, the specification passed in during getInstance().


Copyright (c) 1999-2005 RSA Security Inc. All rights reserved. 038-001001-3500-001-000 - 3.5