|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--javax.crypto.KeyGeneratorSpi | +--iaik.security.cipher.VarLengthKeyGenerator | +--iaik.security.cipher.TripleDESKeyGenerator
This class provides the functionality of a TripleDES key generator. A key generator is used for creating secret keys for symmetric algorithms.
An application uses
for creating a KeyGenerator object for the TripleDES algorithm. For actually generating the requested secret TripleDES key from the KeyGenerator object just created, an application calls theKeyGenerator key_gen = KeyGenerator.getInstance("TripleDES");
generateKey
method after
having initialized the generator with some random seed or relied on the
default system-provided source of randomness:
SecretKey triple_des_key = key_gen.generateKey();
A TripleDES key is composed of three DES keys. For extracting the inherent DES
keys, an application may use the getEncoded
method to get a byte
array representation of the TripleDES key and subsequently split it accordingly:
des key1 = first 8 bytes of key des key2 = second 8 bytes of key des key3 = first 8 bytes of key in case of 2 key triple DES, third 8 bytes otherwise
KeyGenerator
,
KeyGeneratorSpi
,
SecretKey
,
SecretKey
,
DESKeyGenerator
,
TripleDES
Constructor Summary | |
TripleDESKeyGenerator()
|
Method Summary | |
protected SecretKey |
engineGenerateKey()
Generates a new key. |
protected void |
engineInit(AlgorithmParameterSpec params,
SecureRandom random)
Initializes this key generator. |
protected void |
engineInit(int strength,
SecureRandom random)
Initializes this key generator for the given strength with the given random seed. |
protected void |
engineInit(SecureRandom random)
Initializes this key generator with the given random seed. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public TripleDESKeyGenerator()
Method Detail |
protected void engineInit(int strength, SecureRandom random)
iaik.security.cipher.VarLengthKeyGenerator
engineInit
in class iaik.security.cipher.VarLengthKeyGenerator
iaik.security.cipher.VarLengthKeyGenerator
strength
- the strength of the key to be createdrandom
- the random seedprotected SecretKey engineGenerateKey()
iaik.security.cipher.VarLengthKeyGenerator
engineGenerateKey
in class iaik.security.cipher.VarLengthKeyGenerator
iaik.security.cipher.VarLengthKeyGenerator
SecretKey
protected void engineInit(AlgorithmParameterSpec params, SecureRandom random) throws InvalidAlgorithmParameterException
engineInit(random)
.engineInit
in class KeyGeneratorSpi
InvalidAlgorithmParameterException
- if parameters are passedprotected void engineInit(SecureRandom random)
engineInit
in class KeyGeneratorSpi
random
- the random seed for this generator
|
This Javadoc may contain text parts from Internet Standard specifications (RFC 2459, 3280, 3039, 2560, 1521, 821, 822, 2253, 1319, 1321, ,2630, 2631, 2268, 3058, 2984, 2104, 2144, 2040, 2311, 2279, see copyright note) and RSA Data Security Public-Key Cryptography Standards (PKCS#1,3,5,7,8,9,10,12, see copyright note). | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |