IAIK PKCS#11 Provider API Documentation
version 1.6

iaik.pkcs.pkcs11.provider.random
Class PKCS11Random

java.lang.Object
  extended by java.util.Random
      extended by java.security.SecureRandom
          extended by iaik.pkcs.pkcs11.provider.random.PKCS11Random
All Implemented Interfaces:
java.io.Serializable

public class PKCS11Random
extends java.security.SecureRandom

An implementation of the SecureRandom that uses a PKCS#11 token to gereate random data. 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. To link to a different provider instance, instantiate the PKCS11Random class directly and specify the provide instance.

Author:
Karl Scheibelhofer
See Also:
Serialized Form

Constructor Summary
PKCS11Random()
          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.
PKCS11Random(IAIKPkcs11 provider)
          This constructor links this random class to the given provider instance.
PKCS11Random(java.security.SecureRandomSpi pkcs11RandomImplementation, IAIKPkcs11 provider)
          This constructor links this random class to the given provider instance.
 
Method Summary
 
Methods inherited from class java.security.SecureRandom
generateSeed, getAlgorithm, getInstance, getInstance, getInstance, getProvider, getSeed, nextBytes, setSeed, setSeed
 
Methods inherited from class java.util.Random
nextBoolean, nextDouble, nextFloat, nextGaussian, nextInt, nextInt, nextLong
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PKCS11Random

public PKCS11Random()
             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.

PKCS11Random

public PKCS11Random(IAIKPkcs11 provider)
             throws IAIKPkcs11Exception
This constructor links this random class to the given provider instance. It uses the token manager of this provider to access the token.

Parameters:
provider - The IAIK PKCS#11 provider instance of this random object.
Throws:
IAIKPkcs11Exception - If there is no IAIKPkcs11 instance available.
Preconditions
(provider <> null)

PKCS11Random

public PKCS11Random(java.security.SecureRandomSpi pkcs11RandomImplementation,
                    IAIKPkcs11 provider)
             throws IAIKPkcs11Exception
This constructor links this random class to the given provider instance. It uses the token manager of this provider to access the token. It uses the given implementation object to process the requests.

Parameters:
pkcs11RandomImplementation - The random implementation of this random object.
provider - The IAIK PKCS#11 provider instance of this random object.
Throws:
IAIKPkcs11Exception - If there is no IAIKPkcs11 instance available.
Preconditions
(provider <> null)

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