public class LunaRandom
extends java.security.SecureRandomSpi
If the user is logged in to an HSM, the RNG operations will occur on the default slot as returned by
LunaSlotManager.getDefaultSlot()
.
If the user is not logged in, PKCS still allows RNG operations to occur. Since SecureRandom
does
not have a method to specify a slot, in this case the RNG operations will occur on the first slot on the system (in
numerical order) that has a token present. If there are no Luna tokens present this class will throw an exception.
Constructor and Description |
---|
LunaRandom() |
Modifier and Type | Method and Description |
---|---|
protected byte[] |
engineGenerateSeed(int numBytes)
Returns the given number of seed bytes.
|
protected void |
engineNextBytes(byte[] buffer)
Retrieve a user-specified number of random bytes from the Luna HSM's random number generator.
|
protected void |
engineSetSeed(byte[] seed)
Re-seed the hardware RNG with the given seed.
|
protected void engineSetSeed(byte[] seed)
engineSetSeed
in class java.security.SecureRandomSpi
seed
- The seedLunaException
- if there are no tokens present on the systemprotected void engineNextBytes(byte[] buffer)
engineNextBytes
in class java.security.SecureRandomSpi
buffer
- The buffer to fill with random dataLunaException
- if there are no tokens present on the systemprotected byte[] engineGenerateSeed(int numBytes)
engineGenerateSeed
in class java.security.SecureRandomSpi
numBytes
- The number of seed bytes to generateCopyright 2014-2018 SafeNet. All rights reserved.