JCEKeyGeneratorpublic class JCEKeyGenerator extends KeyGeneratorSpi
Fields Summary |
---|
protected String | algName | protected int | keySize | protected int | defaultKeySize | protected org.bouncycastle.crypto.CipherKeyGenerator | engine | protected boolean | uninitialised |
Methods Summary |
---|
protected javax.crypto.SecretKey | engineGenerateKey()
if (uninitialised)
{
engine.init(new KeyGenerationParameters(
new SecureRandom(), defaultKeySize));
}
return (SecretKey)(new SecretKeySpec(engine.generateKey(), algName));
| protected void | engineInit(java.security.spec.AlgorithmParameterSpec params, java.security.SecureRandom random)
throw new InvalidAlgorithmParameterException("Not Implemented");
| protected void | engineInit(java.security.SecureRandom random)
if (random != null)
{
uninitialised = false;
engine.init(new KeyGenerationParameters(random, defaultKeySize));
}
| protected void | engineInit(int keySize, java.security.SecureRandom random)
uninitialised = false;
try
{
engine.init(new KeyGenerationParameters(random, keySize));
}
catch (IllegalArgumentException e)
{
throw new InvalidParameterException(e.getMessage());
}
|
|