01: package org.bouncycastle.crypto;
02:
03: import java.security.SecureRandom;
04:
05: /**
06: * The base class for parameters to key generators.
07: */
08: public class KeyGenerationParameters {
09: private SecureRandom random;
10: private int strength;
11:
12: /**
13: * initialise the generator with a source of randomness
14: * and a strength (in bits).
15: *
16: * @param random the random byte source.
17: * @param strength the size, in bits, of the keys we want to produce.
18: */
19: public KeyGenerationParameters(SecureRandom random, int strength) {
20: this .random = random;
21: this .strength = strength;
22: }
23:
24: /**
25: * return the random source associated with this
26: * generator.
27: *
28: * @return the generators random source.
29: */
30: public SecureRandom getRandom() {
31: return random;
32: }
33:
34: /**
35: * return the bit strength for keys produced by this generator,
36: *
37: * @return the strength of the keys this generator produces (in bits).
38: */
39: public int getStrength() {
40: return strength;
41: }
42: }
|