| java.lang.Object com.sun.midp.crypto.SecureRandom
All known Subclasses: com.sun.midp.crypto.PRand,
SecureRandom | abstract public class SecureRandom (Code) | | Implements an abstract class that generalizes random number
generators.
|
Field Summary | |
final public static byte | ALG_PSEUDO_RANDOM Identifies a utility pseudo random number generation algorithm. | final public static byte | ALG_SECURE_RANDOM Identifies a cryptographically secure random number generation
algorithm. |
Constructor Summary | |
protected | SecureRandom() Protected constructor for subclassing. |
Method Summary | |
public static SecureRandom | getInstance(byte alg) Creates a RandomData instance of the selected algorithm. | abstract public void | nextBytes(byte[] buf, int off, int len) Generates the next bytes of random data. | abstract public void | setSeed(byte[] buf, int off, int len) Seeds the random number generator. |
ALG_PSEUDO_RANDOM | final public static byte ALG_PSEUDO_RANDOM(Code) | | Identifies a utility pseudo random number generation algorithm.
|
ALG_SECURE_RANDOM | final public static byte ALG_SECURE_RANDOM(Code) | | Identifies a cryptographically secure random number generation
algorithm.
|
SecureRandom | protected SecureRandom()(Code) | | Protected constructor for subclassing.
|
getInstance | public static SecureRandom getInstance(byte alg) throws NoSuchAlgorithmException(Code) | | Creates a RandomData instance of the selected algorithm.
WARNING: Requests for a secure random number generator
are currently redirected to a class that implements a weakly
unpredictable source of random data. Licensees of this reference
implementation are strongly urged to link requests for
ALG_SECURE_RANDOM to better generators that may be available
on their specific platforms.
Parameters: alg - the desired random number generation algorithm, e.g. ALG_PSEUDO_RANDOM a RandomData instance implementing the selected algorithm. exception: NoSuchAlgorithmException - if an unsupported algorithm isrequested. |
nextBytes | abstract public void nextBytes(byte[] buf, int off, int len)(Code) | | Generates the next bytes of random data.
Parameters: buf - output buffer in which the random data is to be placed Parameters: off - starting offset within buf for the random data Parameters: len - number of bytes of random data to be placed in buf |
setSeed | abstract public void setSeed(byte[] buf, int off, int len)(Code) | | Seeds the random number generator.
Parameters: buf - input buffer containing the seed Parameters: off - offset within buf where the seed starts Parameters: len - number of bytes of seed data in buf |
|
|