Module ibm.crypto.ibmjcehybrid
Class IBMSecureRandomHybrid
- java.lang.Object
-
- java.security.SecureRandomSpi
-
- com.ibm.crypto.ibmjcehybrid.provider.IBMSecureRandomHybrid
-
- All Implemented Interfaces:
java.io.Serializable
public final class IBMSecureRandomHybrid extends java.security.SecureRandomSpi
This class is a facade for the IBM SecureRandom algorithm.- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description IBMSecureRandomHybrid()
Creates a new instance of the IBMSecureRandomHybrid class.IBMSecureRandomHybrid(byte[] seed)
Creates a new instance of the IBMSecureRandomHybrid class.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description 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.void
engineNextBytes(byte[] bytes)
Generates a user-specified number of random bytes.void
engineSetSeed(byte[] seed)
Sets the seed value for the random number generator.java.security.SecureRandom
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 void
getGenerator(byte[] seed)
Creates an instance of the SecureRandom.
-
-
-
Constructor Detail
-
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 Detail
-
engineSetSeed
public void engineSetSeed(byte[] seed) throws java.lang.UnsupportedOperationException
Sets the seed value for the random number generator.- Specified by:
engineSetSeed
in classjava.security.SecureRandomSpi
- Parameters:
seed
- a series of bytes used as seed.- Throws:
java.lang.UnsupportedOperationException
- is never thrown by this method.
-
engineNextBytes
public void engineNextBytes(byte[] bytes)
Generates a user-specified number of random bytes.- Specified by:
engineNextBytes
in classjava.security.SecureRandomSpi
- 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:
engineGenerateSeed
in classjava.security.SecureRandomSpi
- Parameters:
numBytes
- the size of the seed to generate
-
getGenerator
protected void getGenerator(byte[] seed)
Creates an instance of the SecureRandom.- Throws:
java.lang.RuntimeException
- if this method fails to create and to initialize the SecureRandom.
-
getBestInstance
public java.security.SecureRandom 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.- Parameters:
seed
- a series of bytes used as seed value.- Returns:
- the requested Secure Random object
- Throws:
java.lang.RuntimeException
- if this constructor fails to authenticate the JCE framework.
-
-