IAIK PKCS#11 Provider API Documentation
version 1.6

iaik.pkcs.pkcs11.provider.random
Class PKCS11SeededRandomSpi

java.lang.Object
  extended by java.security.SecureRandomSpi
      extended by iaik.pkcs.pkcs11.provider.random.PKCS11RandomSpi
          extended by iaik.pkcs.pkcs11.provider.random.PKCS11SeededRandomSpi
All Implemented Interfaces:
PKCS11EngineClass, java.io.Serializable

public class PKCS11SeededRandomSpi
extends PKCS11RandomSpi

An implementation of the SecureRandomSpi that uses a PKCS#11 token to gereate seed bytes. For random data it uses a software implementation. If this object is created using the default constructor, and this is always the case when instantiated through the JCA mechanism, this implementation always links to the first instance of IAIKPkcs11. The only way to link to a different instance is to instantiate the PKCS11Random class directly and to specify the provider. This implementation gets random data from a software implementation and gets seed bytes directly from the token. It does not send any seed bytes to the token. Moreover, it automatically gets 1024 bits of seed from the token upon the first request for random data. If more seed data is required, the application can get more seed data from this object and subsequently set it to this engine object. If there is no token present at creation time of this object, or if the present token does not support random number generation, this implementation uses a software delegate to process all requests. Per default, the SHA1PRNG algorithm is used for the software delegate.

Author:
Karl Scheibelhofer
See Also:
Serialized Form

Constructor Summary
PKCS11SeededRandomSpi()
          This default constructor always links this random class to the first provider instance, because there are no means in the JCE to find out our provider instance.
PKCS11SeededRandomSpi(TokenManager tokenManager)
          This constructor links this random class to the given token manager.
 
Method Summary
 
Methods inherited from class iaik.pkcs.pkcs11.provider.random.PKCS11RandomSpi
isSupportedBy
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PKCS11SeededRandomSpi

public PKCS11SeededRandomSpi()
                      throws IAIKPkcs11Exception
This default constructor always links this random class to the first provider instance, because there are no means in the JCE to find out our provider instance.

Throws:
IAIKPkcs11Exception - If there is no IAIKPkcs11 instance available.

PKCS11SeededRandomSpi

public PKCS11SeededRandomSpi(TokenManager tokenManager)
                      throws IAIKPkcs11Exception
This constructor links this random class to the given token manager. It uses this token manager to access the token.

Parameters:
tokenManager - The manager of the token we use for random generation.
Throws:
IAIKPkcs11Exception - If there is no IAIKPkcs11 instance available.

IAIK PKCS#11 Provider API Documentation
version 1.6

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

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