Package javax.crypto
Class KeyGeneratorSpi
java.lang.Object
javax.crypto.KeyGeneratorSpi
- Direct Known Subclasses:
BaseKeyGenerator
public abstract class KeyGeneratorSpi extends Object
The Service Provider Interface (SPI) definition for the
KeyGenerator class.- See Also:
KeyGenerator
-
Constructor Summary
Constructors Constructor Description KeyGeneratorSpi()Creates a newKeyGeneratorSpiinstance. -
Method Summary
Modifier and Type Method Description protected abstract SecretKeyengineGenerateKey()Generates a secret key.protected abstract voidengineInit(int keysize, SecureRandom random)Initializes thisKeyGeneratorinstance for the specified key size (in bits) using the specified randomness source.protected abstract voidengineInit(SecureRandom random)Initializes thisKeyGeneratorwith the specified randomness source.protected abstract voidengineInit(AlgorithmParameterSpec params, SecureRandom random)Initializes thisKeyGeneratorSpiinstance with the specified algorithm parameters and randomness source.
-
Constructor Details
-
KeyGeneratorSpi
public KeyGeneratorSpi()Creates a newKeyGeneratorSpiinstance.
-
-
Method Details
-
engineGenerateKey
Generates a secret key.- Returns:
- the generated secret key.
-
engineInit
protected abstract void engineInit(AlgorithmParameterSpec params, SecureRandom random) throws InvalidAlgorithmParameterExceptionInitializes thisKeyGeneratorSpiinstance with the specified algorithm parameters and randomness source.- Parameters:
params- the parameters for the key generation algorithm.random- the randomness source for any random bytes.- Throws:
InvalidAlgorithmParameterException- if the parameters cannot be uses to initialize this key generator algorithm.
-
engineInit
Initializes thisKeyGeneratorinstance for the specified key size (in bits) using the specified randomness source.- Parameters:
keysize- the size of the key (in bits).random- the randomness source for any random bytes.
-
engineInit
Initializes thisKeyGeneratorwith the specified randomness source.- Parameters:
random- the randomness source for any random bytes.
-