public class NativeSecureRandomSpi extends SecureRandomSpi
| Constructor and Description |
|---|
NativeSecureRandomSpi() |
| Modifier and Type | Method and Description |
|---|---|
protected byte[] |
engineGenerateSeed(int numBytes)
Returns the given number of seed bytes.
|
protected void |
engineNextBytes(byte[] bytes)
Generates a user-specified number of random bytes.
|
protected void |
engineSetSeed(byte[] seed)
Reseeds this random object.
|
static void |
nativeClose(int nativeId)
Closes the native resource.
|
static void |
nativeGenerateSeed(int nativeId,
byte[] bytes,
int numBytes)
Generates a seed.
|
static int |
nativeInit()
Initializes the native resource.
|
static void |
nativeNextBytes(int nativeId,
byte[] bytes,
int numBytes)
Generates random bytes.
|
static void |
nativeSetSeed(int nativeId,
byte[] seed,
int seedLength)
Sets the PRNG seed.
|
protected byte[] engineGenerateSeed(int numBytes)
SecureRandomSpiengineGenerateSeed in class SecureRandomSpinumBytes - the number of seed bytes to generate.protected void engineNextBytes(byte[] bytes)
SecureRandomSpi
If a call to engineSetSeed had not occurred previously, the first call to this method forces this
SecureRandom implementation to seed itself. This self-seeding will not occur if engineSetSeed was
previously called.
engineNextBytes in class SecureRandomSpibytes - the array to be filled in with random bytes.protected void engineSetSeed(byte[] seed)
SecureRandomSpiengineSetSeed in class SecureRandomSpiseed - the seed.public static void nativeClose(int nativeId)
throws NativeException
nativeId - the resource idNativeExceptionpublic static void nativeGenerateSeed(int nativeId,
byte[] bytes,
int numBytes)
throws NativeException
nativeId - the resource idbytes - the seed array to fill with random bytesnumBytes - the seed size in bytesNativeExceptionpublic static int nativeInit()
throws NativeException
NativeExceptionpublic static void nativeNextBytes(int nativeId,
byte[] bytes,
int numBytes)
throws NativeException
nativeId - the resource idbytes - the array to fill with random bytesnumBytes - the number of bytes to generateNativeExceptionpublic static void nativeSetSeed(int nativeId,
byte[] seed,
int seedLength)
throws NativeException
nativeId - the resource idseed - the seed to useNativeException