com.rsa.certj.provider.db.pkcs11

Class PKCS11DB

java.lang.Object
  |
  +--com.rsa.certj.Provider
        |
        +--com.rsa.certj.provider.db.pkcs11.PKCS11DB

public final class PKCS11DB
extends Provider

This class implements a database service provider that stores entries on hardware device, using PKCS#11 standard. The certificate and private keys are stored as objects on the token. PKCS #11 cryptographic services are provided by direct calls to Crypto-J APIs. No security officer services will be enabled by this provider (e.g. initializing the token).

PKCS #11 represents certificates and keys as objects stored on a token residing in a slot. A token is an abstract representation of a storage device and it can be an actual physical device (e.g. a smartcard) or implemented completely in software. Users gain access to objects on the token (token objects) by opening a session to the token. Sessions can be either read-only or read/write with respect to token objects, and initially only have access to public objects (certificates and public keys). A session gains access to private objects (e.g. private keys) by logging in and being authenticated with a user supplied PIN value. A secondary level of authentication may exist, but that is outside the scope of PKCS #11 and is not implemented in this provider.

Copyright (c) RSA Security Inc., 2001. All rights reserved.


Constructor Summary

PKCS11DB(String name, com.rsa.jsafe.JSAFE_PKCS11SessionSpec spec)

Constructs a PKCS11DB object with the provider name, name.

PKCS11DB(String name, com.rsa.jsafe.JSAFE_Session session)

Constructs a PKCS11DB object with the provider name, name, and already established session, session.

PKCS11DB(String name, String libraryName, String tokenLabel, char[] passPhrase, int offset, int len)

Constructs a PKCS11DB object with the provider name, name.

 

Method Summary

 ProviderImplementation

instantiate(CertJ certJ)

Creates a ProviderImplementation object that handles PKCS11 database SPI methods.

 String

toString()

Returns a string descriptive of this provider.

 
Methods inherited from class com.rsa.certj.Provider
getName, getType
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

PKCS11DB

public PKCS11DB(String name,
                com.rsa.jsafe.JSAFE_Session session)
         throws InvalidParameterException
Constructs a PKCS11DB object with the provider name, name, and already established session, session.

Parameters

         name  

A String indicating the name of the provider.

         session  

Already created session on PKCS#11 token.

Throws

InvalidParameterException - If passed in arguments are invalid.

PKCS11DB

public PKCS11DB(String name,
                com.rsa.jsafe.JSAFE_PKCS11SessionSpec spec)
         throws InvalidParameterException
Constructs a PKCS11DB object with the provider name, name. It also tries to log in on the token using the passed in info.

Parameters

         name  

A String indicating the name of the provider.

         spec  

specification how to build an object that can establish a session with a PKCS11 token.

Throws

InvalidParameterException - If passed in arguments are invalid.

PKCS11DB

public PKCS11DB(String name,
                String libraryName,
                String tokenLabel,
                char[] passPhrase,
                int offset,
                int len)
         throws InvalidParameterException
Constructs a PKCS11DB object with the provider name, name. It also tries to log in on the token using the passed in info.

Parameters

         name  

A String indicating the name of the provider.

         libraryName  

the PKCS #11 vendor supplied shared library

         tokenLabel  

the token label, at most 32 chracters

         passPhrase  

the user specified PIN

         offset  

the offset into passPhrase where PIN value starts

         len  

the user PIN length

Throws

InvalidParameterException - If arguments are invalid.
Method Detail

instantiate

public ProviderImplementation instantiate(CertJ certJ)
                                   throws ProviderManagementException
Creates a ProviderImplementation object that handles PKCS11 database SPI methods. This method is called by CertJ.registerService when an object of the PKCS11DB class is being registered; applications do not have to call this method.

Overrides

instantiate in class Provider

Parameters

         certJ  

A CertJ object for which the created provider is registered.

Returns

A ProviderImplementation object that handles the PKCS11 database SPI implementations.

Throws

ProviderManagementException - If instantiation of the PKCS11 provider fails.

toString

public String toString()
Returns a string descriptive of this provider.

Overrides

toString in class Object

Returns

A String describing this object.


RSA BSAFE ® Cert-J 2.1.1 001-047007-211-001-000