Class BaseKeyGenerator
java.lang.Object
javax.crypto.KeyGeneratorSpi
org.bouncycastle.jcajce.provider.symmetric.util.BaseKeyGenerator
- Direct Known Subclasses:
AES.KeyGen,ARC4.KeyGen,Blowfish.KeyGen,DES.KeyGenerator,DESede.KeyGenerator,DESede.KeyGenerator3,MD5.KeyGenerator,SHA1.KeyGenerator,SHA256.KeyGenerator,SHA384.KeyGenerator,SHA512.KeyGenerator
public class BaseKeyGenerator extends KeyGeneratorSpi
-
Field Summary
Fields Modifier and Type Field Description protected StringalgNameprotected intdefaultKeySizeprotected CipherKeyGeneratorengineprotected intkeySizeprotected booleanuninitialised -
Constructor Summary
Constructors Modifier Constructor Description protectedBaseKeyGenerator(String algName, int defaultKeySize, CipherKeyGenerator engine) -
Method Summary
Modifier and Type Method Description protected SecretKeyengineGenerateKey()Generates a secret key.protected voidengineInit(int keySize, SecureRandom random)Initializes thisKeyGeneratorinstance for the specified key size (in bits) using the specified randomness source.protected voidengineInit(SecureRandom random)Initializes thisKeyGeneratorwith the specified randomness source.protected voidengineInit(AlgorithmParameterSpec params, SecureRandom random)Initializes thisKeyGeneratorSpiinstance with the specified algorithm parameters and randomness source.
-
Field Details
-
algName
-
keySize
protected int keySize -
defaultKeySize
protected int defaultKeySize -
engine
-
uninitialised
protected boolean uninitialised
-
-
Constructor Details
-
BaseKeyGenerator
-
-
Method Details
-
engineInit
protected void engineInit(AlgorithmParameterSpec params, SecureRandom random) throws InvalidAlgorithmParameterExceptionDescription copied from class:KeyGeneratorSpiInitializes thisKeyGeneratorSpiinstance with the specified algorithm parameters and randomness source.- Specified by:
engineInitin classKeyGeneratorSpi- 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
Description copied from class:KeyGeneratorSpiInitializes thisKeyGeneratorwith the specified randomness source.- Specified by:
engineInitin classKeyGeneratorSpi- Parameters:
random- the randomness source for any random bytes.
-
engineInit
Description copied from class:KeyGeneratorSpiInitializes thisKeyGeneratorinstance for the specified key size (in bits) using the specified randomness source.- Specified by:
engineInitin classKeyGeneratorSpi- Parameters:
keySize- the size of the key (in bits).random- the randomness source for any random bytes.
-
engineGenerateKey
Description copied from class:KeyGeneratorSpiGenerates a secret key.- Specified by:
engineGenerateKeyin classKeyGeneratorSpi- Returns:
- the generated secret key.
-