use of org.bouncycastle.crypto.KeyGenerationParameters in project robovm by robovm.
the class BaseKeyGenerator method engineInit.
protected void engineInit(int keySize, SecureRandom random) {
try {
if (random == null) {
random = new SecureRandom();
}
engine.init(new KeyGenerationParameters(random, keySize));
uninitialised = false;
} catch (IllegalArgumentException e) {
throw new InvalidParameterException(e.getMessage());
}
}
use of org.bouncycastle.crypto.KeyGenerationParameters in project robovm by robovm.
the class BaseKeyGenerator method engineInit.
protected void engineInit(SecureRandom random) {
if (random != null) {
engine.init(new KeyGenerationParameters(random, defaultKeySize));
uninitialised = false;
}
}
use of org.bouncycastle.crypto.KeyGenerationParameters in project robovm by robovm.
the class BaseKeyGenerator method engineGenerateKey.
protected SecretKey engineGenerateKey() {
if (uninitialised) {
engine.init(new KeyGenerationParameters(new SecureRandom(), defaultKeySize));
uninitialised = false;
}
return new SecretKeySpec(engine.generateKey(), algName);
}
use of org.bouncycastle.crypto.KeyGenerationParameters in project XobotOS by xamarin.
the class JCEKeyGenerator method engineGenerateKey.
protected SecretKey engineGenerateKey() {
if (uninitialised) {
engine.init(new KeyGenerationParameters(new SecureRandom(), defaultKeySize));
uninitialised = false;
}
return new SecretKeySpec(engine.generateKey(), algName);
}
use of org.bouncycastle.crypto.KeyGenerationParameters in project XobotOS by xamarin.
the class JCEKeyGenerator method engineInit.
protected void engineInit(int keySize, SecureRandom random) {
try {
// BEGIN android-added
if (random == null) {
random = new SecureRandom();
}
// END android-added
engine.init(new KeyGenerationParameters(random, keySize));
uninitialised = false;
} catch (IllegalArgumentException e) {
throw new InvalidParameterException(e.getMessage());
}
}
Aggregations