Module ibm.crypto.ibmjcehybrid
Class ARCFOURKeyGeneratorHybrid
- java.lang.Object
-
- javax.crypto.KeyGeneratorSpi
-
- com.ibm.crypto.ibmjcehybrid.provider.ARCFOURKeyGeneratorHybrid
-
public final class ARCFOURKeyGeneratorHybrid extends javax.crypto.KeyGeneratorSpi
This class is a facade for the ARCFOUR key generation algorithm.
-
-
Constructor Summary
Constructors Constructor Description ARCFOURKeyGeneratorHybrid()
Creates an instance of the ARCFOURKeyGeneratorHybrid class.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected javax.crypto.SecretKey
engineGenerateKey()
Gets the key generator and generates the key.protected void
engineInit(int keysize, java.security.SecureRandom random)
Initializes this key generator for a certain keysize, using the given source of randomness.protected void
engineInit(java.security.SecureRandom random)
Initializes this key generator.protected void
engineInit(java.security.spec.AlgorithmParameterSpec params, java.security.SecureRandom random)
Initializes this key generator with the specified parameter set and a user-provided source of randomness.protected javax.crypto.SecretKey
generateKey(boolean isExternalCall)
Gets the key generator and generates the key.javax.crypto.KeyGenerator
getBestInstance(java.lang.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
getGenerator()
Creates an instance of the KeyGenerator.
-
-
-
Method Detail
-
engineInit
protected void engineInit(java.security.SecureRandom random)
Initializes this key generator.- Specified by:
engineInit
in classjavax.crypto.KeyGeneratorSpi
- Parameters:
random
- the source of randomness for this generator
-
engineInit
protected void engineInit(java.security.spec.AlgorithmParameterSpec params, java.security.SecureRandom random) throws java.security.InvalidAlgorithmParameterException
Initializes this key generator with the specified parameter set and a user-provided source of randomness.- Specified by:
engineInit
in classjavax.crypto.KeyGeneratorSpi
- Parameters:
params
- the key generation parametersrandom
- the source of randomness for this key generator- Throws:
java.security.InvalidAlgorithmParameterException
- ifparams
is inappropriate for this key generator
-
engineInit
protected void engineInit(int keysize, java.security.SecureRandom random)
Initializes this key generator for a certain keysize, using the given source of randomness.- Specified by:
engineInit
in classjavax.crypto.KeyGeneratorSpi
- 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
protected javax.crypto.SecretKey engineGenerateKey()
Gets the key generator and generates the key.- Specified by:
engineGenerateKey
in classjavax.crypto.KeyGeneratorSpi
- Returns:
- the new key
-
generateKey
protected javax.crypto.SecretKey generateKey(boolean isExternalCall)
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:
java.lang.RuntimeException
- if this method fails to create and to initialize the message digest.
-
getBestInstance
public javax.crypto.KeyGenerator getBestInstance(java.lang.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.- Parameters:
algorithm
- The desired algorithm- Returns:
- the requested KeyGenerator
- Throws:
java.lang.RuntimeException
- if this constructor fails to authenticate the JCE framework.
-
-