java.lang.Object
java.security.SecureRandomSpi
com.ibm.crypto.ibmjcehybrid.provider.SHA1PRNGHybrid
- All Implemented Interfaces:
Serializable
This class is a facade for the SHA1 Pseudo Random Number
Generation algorithm.
- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionCreates an instance of the SHA1PRNGHybrid class.SHA1PRNGHybrid
(byte[] seed) Creates an instance of the SHA1PRNGHybrid 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.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.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.Methods inherited from class java.security.SecureRandomSpi
engineGetParameters, engineNextBytes, engineReseed, toString
-
Constructor Details
-
SHA1PRNGHybrid
public SHA1PRNGHybrid()Creates an instance of the SHA1PRNGHybrid class. -
SHA1PRNGHybrid
public SHA1PRNGHybrid(byte[] seed) Creates an instance of the SHA1PRNGHybrid class.- Parameters:
seed
- a series of bytes used as seed
-
-
Method Details
-
engineSetSeed
Sets the seed value for the random number generator.- Specified by:
engineSetSeed
in 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:
engineNextBytes
in 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:
engineGenerateSeed
in 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.
-