public final class Cast3KeyGenerator
extends javax.crypto.KeyGeneratorSpi
It is designed to generate symmetric keys that can be used with the CAST3 symmetric cipher algorithm algorithm. The keys that are generated are in 'RAW' format. These keys can be of any 40, 48, 56, or 64-bits in length. This algorithm does not use algorithm parameters; if provided during initialization they will be rejected.
An instance of this algorithm can be obtained using Java Cryptography
Architecture (JCA), by requesting a 'CAST3' key generator from the
Entrust cryptographic
service provider. This can be done using the following call:
KeyGenerator.getInstance("CAST3", "Entrust");This class SHOULD NOT be used directly; it should only be used through the JCA/JCE.
Cast3Cipher| Constructor and Description |
|---|
Cast3KeyGenerator()
The constructor; creates a new instance of the CAST3 key generation
algorithm.
|
| Modifier and Type | Method and Description |
|---|---|
protected javax.crypto.SecretKey |
engineGenerateKey()
Generates a secret key.
|
protected void |
engineInit(java.security.spec.AlgorithmParameterSpec params,
java.security.SecureRandom random)
Initializes the key generator with the specified parameter set and a
user-provided source of randomness.
|
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 the key generator.
|
public Cast3KeyGenerator()
Applications should not use this constructor, instead the key generation
algorithm should be requested from the appropriate JCA/JCE cryptographic
service provider as follows:
KeyGenerator.getInstance("CAST3", "Entrust").
protected void engineInit(java.security.SecureRandom random)
engineInit in class javax.crypto.KeyGeneratorSpirandom - [FIPS 140-2 control input] the source of randomness for this
generatorFips140ErrorStateException - [FIPS 140-2 status output] thrown if the Toolkit is not
allowed to perform cryptographic operationsprotected void engineInit(int keysize,
java.security.SecureRandom random)
throws java.security.InvalidParameterException
engineInit in class javax.crypto.KeyGeneratorSpikeysize - [FIPS 140-2 data input] the keysize. This is an
algorithm-specific metric, specified in number of bits.random - [FIPS 140-2 control input] the source of randomness for this
key generatorjava.security.InvalidParameterException - [FIPS 140-2 status output] if the keysize is wrong or not
supported.Fips140ErrorStateException - [FIPS 140-2 status output] thrown if the Toolkit is not
allowed to perform cryptographic operationsprotected void engineInit(java.security.spec.AlgorithmParameterSpec params,
java.security.SecureRandom random)
throws java.security.InvalidAlgorithmParameterException
engineInit in class javax.crypto.KeyGeneratorSpiparams - [FIPS 140-2 data input] the key generation parametersrandom - [FIPS 140-2 control input] the source of randomness for this
key generatorjava.security.InvalidAlgorithmParameterException - [FIPS 140-2 status output] if params is
inappropriate for this key generatorFips140ErrorStateException - [FIPS 140-2 status output] thrown if the Toolkit is not
allowed to perform cryptographic operationsprotected javax.crypto.SecretKey engineGenerateKey()
engineGenerateKey in class javax.crypto.KeyGeneratorSpiFips140ErrorStateException - [FIPS 140-2 status output] thrown if the Toolkit is not
allowed to perform cryptographic operations