APIdia Launch Partner
Top Description Fields Constructors Methods
com.sun.crypto.provider

public final Class DESedeKeyGenerator

extends KeyGeneratorSpi
Class Inheritance
Imports
javax.crypto.KeyGeneratorSpi, .SecretKey, javax.crypto.spec.DESedeKeySpec, java.security.SecureRandom, .InvalidParameterException, .InvalidAlgorithmParameterException, .InvalidKeyException, java.security.spec.AlgorithmParameterSpec

This class generates a Triple DES key.
Author
Jan Luehe

Field Summary

Modifier and TypeField and Description
private int
private SecureRandom

Constructor Summary

AccessConstructor and Description
public
DESedeKeyGenerator()

Empty constructor

Method Summary

Modifier and TypeMethod and Description
protected SecretKey

Returns:

the new Triple DES key
engineGenerateKey
()

Implements abstract javax.crypto.KeyGeneratorSpi.engineGenerateKey.

Generates the Triple DES key.

protected void
engineInit(SecureRandom
the source of randomness for this generator
random
)

Implements abstract javax.crypto.KeyGeneratorSpi.engineInit.

Initializes this key generator.

protected void
engineInit(AlgorithmParameterSpec
the key generation parameters
params
,
SecureRandom
the source of randomness for this key generator
random
)

Implements abstract javax.crypto.KeyGeneratorSpi.engineInit.

Initializes this key generator with the specified parameter set and a user-provided source of randomness.

protected void
engineInit(int
the keysize. This is an algorithm-specific metric specified in number of bits. A keysize with 112 bits of entropy corresponds to a Triple DES key with 2 intermediate keys, and a keysize with 168 bits of entropy corresponds to a Triple DES key with 3 intermediate keys.
keysize
,
SecureRandom
the source of randomness for this key generator
random
)

Implements abstract javax.crypto.KeyGeneratorSpi.engineInit.

Initializes this key generator for a certain keysize, using the given source of randomness.

Field Detail

keysizeback to summary
private int keysize
randomback to summary
private SecureRandom random

Constructor Detail

DESedeKeyGeneratorback to summary
public DESedeKeyGenerator()

Empty constructor

Method Detail

engineGenerateKeyback to summary
protected SecretKey engineGenerateKey()

Implements abstract javax.crypto.KeyGeneratorSpi.engineGenerateKey.

Generates the Triple DES key.

Returns:SecretKey

the new Triple DES key

engineInitback to summary
protected void engineInit(SecureRandom random)

Implements abstract javax.crypto.KeyGeneratorSpi.engineInit.

Initializes this key generator.

Parameters
random:SecureRandom

the source of randomness for this generator

engineInitback to summary
protected void engineInit(AlgorithmParameterSpec params, SecureRandom random) throws InvalidAlgorithmParameterException

Implements abstract javax.crypto.KeyGeneratorSpi.engineInit.

Initializes this key generator with the specified parameter set and a user-provided source of randomness.

Parameters
params:AlgorithmParameterSpec

the key generation parameters

random:SecureRandom

the source of randomness for this key generator

Exceptions
InvalidAlgorithmParameterException:
if params is inappropriate for this key generator
engineInitback to summary
protected void engineInit(int keysize, SecureRandom random)

Implements abstract javax.crypto.KeyGeneratorSpi.engineInit.

Initializes this key generator for a certain keysize, using the given source of randomness.

Parameters
keysize:int

the keysize. This is an algorithm-specific metric specified in number of bits. A keysize with 112 bits of entropy corresponds to a Triple DES key with 2 intermediate keys, and a keysize with 168 bits of entropy corresponds to a Triple DES key with 3 intermediate keys.

random:SecureRandom

the source of randomness for this key generator