|
||||||||||
| 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
This class provides the functionality of KeyGenerator for generating keys with variable length. It is an abstract class that is used by a number of different keygenerators, e.g. RC4 or Blowfish.
An application uses e.g.
KeyGenerator key_gen = KeyGenerator.getInstance("Blowfish");
to create a KeyGenerator object for the given algorithm. For actually
generating the requested secret key from the KeyGenerator object
just created, an application calls the generateKey method after
having initialized the generator with some random seed or relied on the
default system-provided source of randomness:
SecretKey new_key = key_gen.generateKey();
KeyGenerator,
KeyGeneratorSpi,
SecretKey,
SecretKey| Constructor Summary | |
protected |
VarLengthKeyGenerator(java.lang.String algorithmName,
int minLength,
int maxLength,
int defaultLength)
Constructor for use by subclasses. |
protected |
VarLengthKeyGenerator(java.lang.String algorithmName,
int minLength,
int maxLength,
int defaultLength,
int increment)
Constructor for use by subclasses. |
| Method Summary | |
SecretKey |
engineGenerateKey()
Generates a new key. |
void |
engineInit(AlgorithmParameterSpec params,
SecureRandom random)
Initializes this key generator. |
void |
engineInit(int strength,
SecureRandom random)
Initializes this key generator for the given strength with the given random seed. |
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 |
protected VarLengthKeyGenerator(java.lang.String algorithmName,
int minLength,
int maxLength,
int defaultLength,
int increment)
protected VarLengthKeyGenerator(java.lang.String algorithmName,
int minLength,
int maxLength,
int defaultLength)
| Method Detail |
public void engineInit(AlgorithmParameterSpec params,
SecureRandom random)
throws InvalidAlgorithmParameterException
engineInit(random).
public void engineInit(int strength,
SecureRandom random)
strength - the strength of the key to be createdrandom - the random seedpublic void engineInit(SecureRandom random)
random - the random seed for this generatorpublic SecretKey engineGenerateKey()
SecretKey
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||