|
Java Card 2.1 Platform Final Revision 1.0 |
|||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--javacard.security.RandomData
The RandomData
abstract class is the base class for random number generation. Implementations of RandomData
algorithms must extend this class and implement all the abstract methods.
Field Summary | |
static byte |
ALG_PSEUDO_RANDOM
Utility pseudo random number generation algorithms. |
static byte |
ALG_SECURE_RANDOM
Cryptographically secure random number generation algorithms. |
Constructor Summary | |
protected |
RandomData()
Protected constructor for subclassing. |
Method Summary | |
abstract void |
generateData(byte[] buffer,
short offset,
short length)
Generates random data. |
static RandomData |
getInstance(byte algorithm)
Creates a RandomData instance of the selected algorithm. |
abstract void |
setSeed(byte[] buffer,
short offset,
short length)
Seeds the random data generator. |
Methods inherited from class java.lang.Object |
equals |
Field Detail |
public static final byte ALG_PSEUDO_RANDOM
public static final byte ALG_SECURE_RANDOM
Constructor Detail |
protected RandomData()
Method Detail |
public static final RandomData getInstance(byte algorithm) throws CryptoException
RandomData
instance of the selected algorithm.
The pseudo random RandomData
instance's seed is initialized to a internal default value.algorithm
- the desired random number algorithm. Valid codes listed in ALG_.. constants. See above.RandomData
object instance of the requested algorithm.CryptoException.NO_SUCH_ALGORITHM
if the requested algorithm is not supported.public abstract void generateData(byte[] buffer, short offset, short length)
buffer
- the output bufferoffset
- the offset into the output bufferlength
- the length of random data to generatepublic abstract void setSeed(byte[] buffer, short offset, short length)
buffer
- the input bufferoffset
- the offset into the input bufferlength
- the length of the seed data
|
Submit a bug or feature Java and Java Card are trademarks or registered trademarks of Sun Microsystems, Inc. in the US and other countries. Copyright 1993-1999 Sun Microsystems, Inc. 901 San Antonio Road, Palo Alto, California, 94303, U.S.A. All Rights Reserved. |
|||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |