public class NativeKeyGeneratorSpi extends KeyGeneratorSpi
| Constructor and Description |
|---|
NativeKeyGeneratorSpi(int keyBits,
int algorithmId,
String algorithm) |
| Modifier and Type | Method and Description |
|---|---|
protected SecretKey |
engineGenerateKey()
Generates a secret key.
|
protected void |
engineInit(AlgorithmParameterSpec params,
SecureRandom random)
Initializes the key generator with the specified parameter
set and a user-provided source of randomness.
|
protected void |
engineInit(int keysize,
SecureRandom random)
Initializes this key generator for a certain keysize, using the given
source of randomness.
|
protected void |
engineInit(SecureRandom random)
Initializes the key generator.
|
protected static int |
nativeGetAlgorithmId(byte[] algorithm)
Get the supported algorithm native ID.
|
protected static boolean |
nativeIsKeySizeSupported(int algorithmId,
int keyBits)
Checks whether the provided key size is supported.
|
public NativeKeyGeneratorSpi(int keyBits,
int algorithmId,
String algorithm)
protected SecretKey engineGenerateKey()
engineGenerateKey in class KeyGeneratorSpiprotected void engineInit(AlgorithmParameterSpec params, SecureRandom random) throws InvalidAlgorithmParameterException
engineInit in class KeyGeneratorSpiparams - the key generation parametersrandom - the source of randomness for this key generatorInvalidAlgorithmParameterException - if params is
inappropriate for this key generatorprotected void engineInit(int keysize,
SecureRandom random)
throws InvalidParameterException
engineInit in class KeyGeneratorSpikeysize - the keysize. This is an algorithm-specific metric, specified in number of bits.random - the source of randomness for this key generator.InvalidParameterException - if keysize is wrong or not supported.protected void engineInit(SecureRandom random)
engineInit in class KeyGeneratorSpirandom - the source of randomness for this generatorprotected static int nativeGetAlgorithmId(byte[] algorithm)
algorithm - Null terminated string that describes the algorithmprotected static boolean nativeIsKeySizeSupported(int algorithmId,
int keyBits)
algorithmId - ID of the algorithmkeyBits - size of the key expressed in bits