JSS 3.1

org.mozilla.jss.pkcs11
Class PK11SecureRandom

java.lang.Object
  |
  +--org.mozilla.jss.pkcs11.PK11SecureRandom

public final class PK11SecureRandom
extends java.lang.Object
implements JSSSecureRandom

A random number generator for PKCS #11.

See Also:
CryptoManager

Constructor Summary
PK11SecureRandom()
          While it would be "nice" to add the following code snippet to check initialization of the random number generator prior to using any of the functions, a circular link dependency prevents this: try { CryptoManager.getInstance(); } catch ( CryptoManager.NotInitializedException e ) { Assert.notReached("Pseudorandom number generator " + "has not been initialized!" ); }
 
Method Summary
 void nextBytes(byte[] bytes)
           
 void setSeed(byte[] seed)
           
 void setSeed(long seed)
           
 
Methods inherited from class java.lang.Object
, clone, equals, finalize, getClass, hashCode, notify, notifyAll, registerNatives, toString, wait, wait, wait
 

Constructor Detail

PK11SecureRandom

public PK11SecureRandom()
While it would be "nice" to add the following code snippet to check initialization of the random number generator prior to using any of the functions, a circular link dependency prevents this: try { CryptoManager.getInstance(); } catch ( CryptoManager.NotInitializedException e ) { Assert.notReached("Pseudorandom number generator " + "has not been initialized!" ); }
Method Detail

setSeed

public void setSeed(byte[] seed)
Specified by:
setSeed in interface JSSSecureRandom

setSeed

public void setSeed(long seed)
Specified by:
setSeed in interface JSSSecureRandom

nextBytes

public void nextBytes(byte[] bytes)
Specified by:
nextBytes in interface JSSSecureRandom

JSS 3.1