CipherKeyGeneratorpublic class CipherKeyGenerator extends Object The base class for symmetric, or secret, cipher key generators. |
Fields Summary |
---|
protected SecureRandom | random | protected int | strength |
Methods Summary |
---|
public byte[] | generateKey()generate a secret key.
byte[] key = new byte[strength];
random.nextBytes(key);
return key;
| public void | init(KeyGenerationParameters param)initialise the key generator.
this.random = param.getRandom();
this.strength = (param.getStrength() + 7) / 8;
|
|