RandomDataImpl



com.licel.jcardsim.crypto
Class RandomDataImpl

java.lang.Object
  extended by javacard.security.RandomData
      extended by com.licel.jcardsim.crypto.RandomDataImpl

public class RandomDataImpl
extends RandomData

Implementation RandomData based on BouncyCastle CryptoAPI

See Also:
RandomData

Field Summary
 
Fields inherited from class javacard.security.RandomData
ALG_PSEUDO_RANDOM, ALG_SECURE_RANDOM
 
Constructor Summary
RandomDataImpl()
           
 
Method Summary
 void generateData(byte[] buffer, short offset, short length)
          Generates random data.
 void setSeed(byte[] buffer, short offset, short length)
          Seeds the random data generator.
 
Methods inherited from class javacard.security.RandomData
getInstance
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

RandomDataImpl

public RandomDataImpl()
Method Detail

generateData

public void generateData(byte[] buffer,
                         short offset,
                         short length)
                  throws CryptoException
Description copied from class: RandomData
Generates random data.

Specified by:
generateData in class RandomData
Parameters:
buffer - the output buffer
offset - the offset into the output buffer
length - the length of random data to generate
Throws:
CryptoException - with the following reason codes:
  • CryptoException.ILLEGAL_VALUE if the length parameter is zero.

setSeed

public void setSeed(byte[] buffer,
                    short offset,
                    short length)
Description copied from class: RandomData
Seeds the random data generator.

Specified by:
setSeed in class RandomData
Parameters:
buffer - the input buffer
offset - the offset into the input buffer
length - the length of the seed data