com.ibm.crypto.fips.provider
Class AESKeyGenerator
- java.lang.Object
javax.crypto.KeyGeneratorSpi
com.ibm.crypto.fips.provider.AESKeyGenerator
All implemented interfaces:
- public final class AESKeyGenerator
- extends javax.crypto.KeyGeneratorSpi
- implements AlgorithmStatus
Author:
Paschalis Kaltsatis
Constructor Summary
Constructor and Description |
---|
AESKeyGenerator()
Verify the JCE framework in the constructor.
|
Method Summary
Modifier and Type | Method and Description |
---|---|
|
engineGenerateKey()
Generates a AES key.
|
|
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.
|
|
engineInit(int keysize,java.security.SecureRandom random)
Initializes this key generator for a certain keysize, using the given
source of randomness.
|
|
engineInit(java.security.SecureRandom random)
Initializes this key generator.
|
|
internalGenerateKey()
Generates a AES key.
|
|
internalInit(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.
|
|
internalInit(int keysize,java.security.SecureRandom random)
Initializes this key generator for a certain keysize, using the given
source of randomness.
|
|
internalInit(java.security.SecureRandom random)
Initializes this key generator.
|
|
isFipsApproved()
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail
AESKeyGenerator
- public AESKeyGenerator()
Verify the JCE framework in the constructor.
Throws:
java.lang.SecurityException
- if fails to verify
the JCE framework. Method Detail
isFipsApproved
- public boolean isFipsApproved()
Description copied from interface:
AlgorithmStatus
Module identifies if the cryptographic operation (algorithm) is FIPS certified
Specified by:
isFipsApproved
in interface AlgorithmStatus
See Also:
engineInit
- protected void engineInit(java.security.SecureRandom random)
Initializes this key generator.
Specified by:
engineInit
in class javax.crypto.KeyGeneratorSpi
Parameters:
random
- the source of randomness for this generator Throws:
FIPSRuntimeException
- if SelfTest.isFipsRunnable returns false. internalInit
- protected void internalInit(java.security.SecureRandom random)
Initializes this key generator.
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 class javax.crypto.KeyGeneratorSpi
Parameters:
params
- the key generation parameters random
- the source of randomness for this key generator Throws:
java.security.InvalidAlgorithmParameterException
- if params
is
inappropriate for this key generator FIPSRuntimeException
- if SelfTest.isFipsRunnable returns false. internalInit
- protected void internalInit(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.
Parameters:
params
- the key generation parameters random
- the source of randomness for this key generator Throws:
java.security.InvalidAlgorithmParameterException
- if params
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 class javax.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 Throws:
FIPSRuntimeException
- if SelfTest.isFipsRunnable returns false. internalInit
- protected void internalInit(int keysize,
- java.security.SecureRandom random)
Initializes this key generator for a certain keysize, using the given
source of randomness.
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( )
Generates a AES key.
Specified by:
engineGenerateKey
in class javax.crypto.KeyGeneratorSpi
internalGenerateKey
- protected javax.crypto.SecretKey internalGenerateKey( )
Generates a AES key.
Returns:
the new AES key