Module ibm.crypto.ibmjcehybrid
Class MARSKeyGeneratorHybrid
- java.lang.Object
-
- javax.crypto.KeyGeneratorSpi
-
- com.ibm.crypto.ibmjcehybrid.provider.MARSKeyGeneratorHybrid
-
public final class MARSKeyGeneratorHybrid extends javax.crypto.KeyGeneratorSpiThis class is a facade for the MARS key generation algorithm.
-
-
Constructor Summary
Constructors Constructor Description MARSKeyGeneratorHybrid()Creates a new instance of the MARSKeyGeneratorHybrid class.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected javax.crypto.SecretKeyengineGenerateKey()Gets the key generator and generates the key.protected voidengineInit(int keysize, java.security.SecureRandom random)Initializes this key generator for a certain keysize, using the given source of randomness.protected voidengineInit(java.security.SecureRandom random)Initializes this key generator.protected voidengineInit(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.SecretKeygenerateKey(boolean isExternalCall)Gets the key generator and generates the key.javax.crypto.KeyGeneratorgetBestInstance(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 voidgetGenerator()Creates an instance of the KeyGenerator.
-
-
-
Method Detail
-
engineInit
protected void engineInit(java.security.SecureRandom random)
Initializes this key generator.- Specified by:
engineInitin 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.InvalidAlgorithmParameterExceptionInitializes this key generator with the specified parameter set and a user-provided source of randomness.- Specified by:
engineInitin classjavax.crypto.KeyGeneratorSpi- Parameters:
params- the key generation parametersrandom- the source of randomness for this key generator- Throws:
java.security.InvalidAlgorithmParameterException- ifparamsis 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:
engineInitin 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:
engineGenerateKeyin 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.
-
-