java.lang.Object
javax.crypto.KeyGeneratorSpi
com.ibm.crypto.hdwrCCA.provider.DESKeyGenerator
This class generates a DES key.
This documentation describes a Service Provider Interface. It is provided for implementation insight only. This class is not intended to be called directly by application developers. Please consult the 'Java Cryptography Architecture Standard' for details on how to use this interface through a public standard class.
- NOTE:
- Certain operations may require specific hardware or software, or specific key types. See the rest of this document and the z/OS Unique Considerations Hardware Crypto Reference Guide for more details. Unsupported operations and/or combinations may result in a RuntimeException Hardware Error.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected SecretKeyGenerates the DES key.protected voidengineInit(int keysize, SecureRandom random) Initializes this key generator for a certain keysize, using the given source of randomness.protected voidengineInit(SecureRandom random) Initializes this key generator with a source of randomness.protected voidengineInit(AlgorithmParameterSpec params, SecureRandom random) Initializes this key generator with the specified parameter set and a user-provided source of randomness.
-
Constructor Details
-
DESKeyGenerator
public DESKeyGenerator()Verify the JCE framework in the constructor.- Throws:
SecurityException- if fails to verify the JCE framework.
-
-
Method Details
-
engineInit
Initializes this key generator with a source of randomness. It is not valid to specify a source of randomness for a key that will be generated as a secret hardware key.- Specified by:
engineInitin 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. If aCCAAlgorithmParameterSpecis specified, and the requested key type is eitherCCAAlgorithmParameterSpec.SECURE_INTERNAL_TOKENorCCAAlgorithmParameterSpec.CKDS, then the DES key will be generated as a secret hardware key. Generation of key encrypting keys is not supported.- Specified by:
engineInitin classKeyGeneratorSpi- Parameters:
params- the key generation parametersrandom- the source of randomness for this key generator- Throws:
InvalidAlgorithmParameterException- ifparamsis inappropriate for this key generator.InvalidParameterException- if the key size in the key generation parameters is not valid.
-
engineInit
Initializes this key generator for a certain keysize, using the given source of randomness.- Specified by:
engineInitin classKeyGeneratorSpi- Parameters:
keysize- the keysize. This is an algorithm-specific metric specified in number of bitsrandom- the source of randomness for this key generator- Throws:
InvalidParameterException- if the specified key size is not valid.
-
engineGenerateKey
Generates the DES key.- Specified by:
engineGenerateKeyin classKeyGeneratorSpi- Returns:
- the new DES key.
-