|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.bouncycastle.crypto.generators.NaccacheSternKeyPairGenerator
public class NaccacheSternKeyPairGenerator
Key generation parameters for NaccacheStern cipher. For details on this cipher, please see http://www.gemplus.com/smart/rd/publications/pdf/NS98pkcs.pdf
Field Summary | |
---|---|
private static java.math.BigInteger |
ONE
|
private NaccacheSternKeyGenerationParameters |
param
|
private static int[] |
smallPrimes
|
Constructor Summary | |
---|---|
NaccacheSternKeyPairGenerator()
|
Method Summary | |
---|---|
private static java.util.Vector |
findFirstPrimes(int count)
Finds the first 'count' primes starting with 3 |
AsymmetricCipherKeyPair |
generateKeyPair()
return an AsymmetricCipherKeyPair containing the generated keys. |
private static java.math.BigInteger |
generatePrime(int bitLength,
int certainty,
java.security.SecureRandom rand)
|
private static int |
getInt(java.security.SecureRandom rand,
int n)
|
void |
init(KeyGenerationParameters param)
intialise the key pair generator. |
private static java.util.Vector |
permuteList(java.util.Vector arr,
java.security.SecureRandom rand)
Generates a permuted ArrayList from the original one. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
private static int[] smallPrimes
private NaccacheSternKeyGenerationParameters param
private static final java.math.BigInteger ONE
Constructor Detail |
---|
public NaccacheSternKeyPairGenerator()
Method Detail |
---|
public void init(KeyGenerationParameters param)
AsymmetricCipherKeyPairGenerator
init
in interface AsymmetricCipherKeyPairGenerator
param
- the parameters the key pair is to be initialised with.public AsymmetricCipherKeyPair generateKeyPair()
AsymmetricCipherKeyPairGenerator
generateKeyPair
in interface AsymmetricCipherKeyPairGenerator
private static java.math.BigInteger generatePrime(int bitLength, int certainty, java.security.SecureRandom rand)
private static java.util.Vector permuteList(java.util.Vector arr, java.security.SecureRandom rand)
arr
- the ArrayList to be permutedrand
- the source of Randomness for permutation
private static int getInt(java.security.SecureRandom rand, int n)
private static java.util.Vector findFirstPrimes(int count)
count
- the number of primes to find
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |