From 7cb752aaf746dc0b473afeb9e892b7fbc12666c5 Mon Sep 17 00:00:00 2001 From: Roberto Tyley Date: Mon, 14 Jul 2014 22:38:01 +0100 Subject: Execute become-spongy.sh https://github.com/rtyley/spongycastle/blob/3040af/become-spongy.sh --- .../crypto/KeyGenerationParameters.java | 48 ++++++++++++++++++++++ 1 file changed, 48 insertions(+) create mode 100644 core/src/main/java/org/spongycastle/crypto/KeyGenerationParameters.java (limited to 'core/src/main/java/org/spongycastle/crypto/KeyGenerationParameters.java') diff --git a/core/src/main/java/org/spongycastle/crypto/KeyGenerationParameters.java b/core/src/main/java/org/spongycastle/crypto/KeyGenerationParameters.java new file mode 100644 index 00000000..853f9c13 --- /dev/null +++ b/core/src/main/java/org/spongycastle/crypto/KeyGenerationParameters.java @@ -0,0 +1,48 @@ +package org.spongycastle.crypto; + +import java.security.SecureRandom; + +/** + * The base class for parameters to key generators. + */ +public class KeyGenerationParameters +{ + private SecureRandom random; + private int strength; + + /** + * initialise the generator with a source of randomness + * and a strength (in bits). + * + * @param random the random byte source. + * @param strength the size, in bits, of the keys we want to produce. + */ + public KeyGenerationParameters( + SecureRandom random, + int strength) + { + this.random = random; + this.strength = strength; + } + + /** + * return the random source associated with this + * generator. + * + * @return the generators random source. + */ + public SecureRandom getRandom() + { + return random; + } + + /** + * return the bit strength for keys produced by this generator, + * + * @return the strength of the keys this generator produces (in bits). + */ + public int getStrength() + { + return strength; + } +} -- cgit v1.2.3