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 theKeyGeneratorclass.- See Also:
KeyGenerator
-
-
Constructor Summary
Constructors Constructor Description KeyGeneratorSpi()Creates a newKeyGeneratorSpiinstance.
-
Method Summary
All Methods Instance Methods Abstract Methods 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.
-
-
-
Method Detail
-
engineGenerateKey
protected abstract SecretKey engineGenerateKey()
Generates a secret key.- Returns:
- the generated secret key.
-
engineInit
protected abstract void engineInit(AlgorithmParameterSpec params, SecureRandom random) throws InvalidAlgorithmParameterException
Initializes 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
protected abstract void engineInit(int keysize, SecureRandom random)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
protected abstract void engineInit(SecureRandom random)
Initializes thisKeyGeneratorwith the specified randomness source.- Parameters:
random- the randomness source for any random bytes.
-
-