| java.lang.Object com.sun.portal.ksecurity.RandomData
All known Subclasses: com.sun.portal.ksecurity.PRand,
RandomData | abstract public class RandomData (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 | RandomData() Protected constructor for subclassing. |
Method Summary | |
abstract public void | generateData(byte[] buf, short off, short len) Generates random data. | public static RandomData | getInstance(byte alg) Creates a RandomData instance of the selected algorithm. | abstract public void | setSeed(byte[] buf, short off, short 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.
|
RandomData | protected RandomData()(Code) | | Protected constructor for subclassing.
|
generateData | abstract public void generateData(byte[] buf, short off, short len)(Code) | | Generates 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 |
getInstance | public static RandomData getInstance(byte alg) throws CryptoException(Code) | | Creates a RandomData instance of the selected algorithm.
Parameters: alg - the desired random number generation algorithm, e.g. ALG_PSEUDO_RANDOM a RandomData instance implementing the selected algorithm. exception: CryptoException - with reason code set to NO_SUCH_ALGORITHMif an unsupported algorithm is requested. WARNING: Requests for a secure random number generatorare currently redirected to a class that implements a weakly unpredictable source of random data. Licensees of this referenceimplementation are strongly urged to link requests for ALG_SECURE_RANDOM to better generators that may be availableon their specific platforms. |
setSeed | abstract public void setSeed(byte[] buf, short off, short 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 |
|
|