Module ibm.crypto.ibmjcehybrid
Class SealKeyGeneratorHybrid
java.lang.Object
javax.crypto.KeyGeneratorSpi
com.ibm.crypto.ibmjcehybrid.provider.SealKeyGeneratorHybrid
This class is a facade for the Seal key generation algorithm.
-
Constructor Summary
ConstructorsConstructorDescriptionCreates an instance of the SealKeyGeneratorHybrid class. -
Method Summary
Modifier and TypeMethodDescriptionprotected SecretKey
Gets the key generator and generates the key.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 this key generator.protected void
engineInit
(AlgorithmParameterSpec params, SecureRandom random) Initializes this key generator with the specified parameter set and a user-provided source of randomness.protected SecretKey
generateKey
(boolean isExternalCall) Gets the key generator and generates the key.getBestInstance
(String algorithm) Creates an instance of the specified KeyGenerator, the provider will be the selecting the first provider in the list for the generator that returns a KeyGenerator object.protected void
Creates an instance of the KeyGenerator.
-
Constructor Details
-
SealKeyGeneratorHybrid
public SealKeyGeneratorHybrid()Creates an instance of the SealKeyGeneratorHybrid class.
-
-
Method Details
-
engineInit
Initializes this key generator.- Specified by:
engineInit
in classKeyGeneratorSpi
- Parameters:
random
- the source of randomness for this generator
-
engineInit
protected void engineInit(AlgorithmParameterSpec params, SecureRandom random) throws InvalidAlgorithmParameterException Initializes this key generator with the specified parameter set and a user-provided source of randomness.- Specified by:
engineInit
in classKeyGeneratorSpi
- Parameters:
params
- the key generation parametersrandom
- the source of randomness for this key generator- Throws:
InvalidAlgorithmParameterException
- ifparams
is inappropriate for this key generator
-
engineInit
Initializes this key generator for a certain keysize, using the given source of randomness.- Specified by:
engineInit
in classKeyGeneratorSpi
- Parameters:
keysize
- the keysize. This is an algorithm-specific metric specified in number of bits.random
- the source of randomness for this key generator
-
engineGenerateKey
Gets the key generator and generates the key.- Specified by:
engineGenerateKey
in classKeyGeneratorSpi
- Returns:
- the new key
-
generateKey
Gets the key generator and generates the key.- Parameters:
isExternalCall
- should be true if this method is being called from engineGenerateKey(), otherwise it should be false.- Returns:
- the new key
-
getGenerator
protected void getGenerator()Creates an instance of the KeyGenerator.- Throws:
RuntimeException
- if this method fails to create and to initialize the message digest.
-
getBestInstance
Creates an instance of the specified KeyGenerator, the provider will be the selecting the first provider in the list for the generator that returns a KeyGenerator object.- Parameters:
algorithm
- The desired algorithm- Returns:
- the requested KeyGenerator
- Throws:
RuntimeException
- if this constructor fails to authenticate the JCE framework.
-