Module ibm.crypto.ibmjcehybrid
Class IBMSecureRandomHybrid
java.lang.Object
java.security.SecureRandomSpi
com.ibm.crypto.ibmjcehybrid.provider.IBMSecureRandomHybrid
- All Implemented Interfaces:
Serializable
This class is a facade for the IBM SecureRandom algorithm.
- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionCreates a new instance of the IBMSecureRandomHybrid class.IBMSecureRandomHybrid(byte[] seed) Creates a new instance of the IBMSecureRandomHybrid class. -
Method Summary
Modifier and TypeMethodDescriptionbyte[]engineGenerateSeed(int numBytes) This method generates a seed value that the app could pass back on a setSeed() call, or could pass to a different SecureRandom object on a setSeed() call.voidengineNextBytes(byte[] bytes) Generates a user-specified number of random bytes.voidengineSetSeed(byte[] seed) Sets the seed value for the random number generator.getBestInstance(byte[] seed) Creates an instance of the specified KeyGenerator, the provider will be the selecting the first provider in the list for the generator that returns a KeyGenerator object.protected voidgetGenerator(byte[] seed) Creates an instance of the SecureRandom.Methods inherited from class java.security.SecureRandomSpi
engineGetParameters, engineNextBytes, engineReseed, toString
-
Constructor Details
-
IBMSecureRandomHybrid
public IBMSecureRandomHybrid()Creates a new instance of the IBMSecureRandomHybrid class. -
IBMSecureRandomHybrid
public IBMSecureRandomHybrid(byte[] seed) Creates a new instance of the IBMSecureRandomHybrid class. Note: The seed has no real meaning in hardware and this constructor only exists for compatability with SecureRandomSpi.- Parameters:
seed- a series of bytes used as seed
-
-
Method Details
-
engineSetSeed
Sets the seed value for the random number generator.- Specified by:
engineSetSeedin classSecureRandomSpi- Parameters:
seed- a series of bytes used as seed.- Throws:
UnsupportedOperationException- is never thrown by this method.
-
engineNextBytes
public void engineNextBytes(byte[] bytes) Generates a user-specified number of random bytes.- Specified by:
engineNextBytesin classSecureRandomSpi- Parameters:
bytes- the array to be filled in with random bytes.
-
engineGenerateSeed
public byte[] engineGenerateSeed(int numBytes) This method generates a seed value that the app could pass back on a setSeed() call, or could pass to a different SecureRandom object on a setSeed() call.- Specified by:
engineGenerateSeedin classSecureRandomSpi- Parameters:
numBytes- the size of the seed to generate
-
getGenerator
protected void getGenerator(byte[] seed) Creates an instance of the SecureRandom.- Throws:
RuntimeException- if this method fails to create and to initialize the SecureRandom.
-
getBestInstance
Creates an instance of the specified KeyGenerator, the provider will be the selecting the first provider in the list for the generator that returns a KeyGenerator object.- Parameters:
seed- a series of bytes used as seed value.- Returns:
- the requested Secure Random object
- Throws:
RuntimeException- if this constructor fails to authenticate the JCE framework.
-