|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object java.security.KeyPairGeneratorSpi de.cscc.crypto.provider.RSAKeyPairGeneratorEngine
RSAKeyPairGeneratorEngine Class.
Defaults are:
keysize
(modulus length) = 768 bit
random = new java.security.SecureRandom()
Constructor Summary | |
RSAKeyPairGeneratorEngine()
Creates new RSAKeyPairGeneratorEngine |
Method Summary | |
KeyPair |
generateKeyPair()
Generates a KeyPair . |
void |
initialize(AlgorithmParameterSpec params,
SecureRandom random)
Initializes the key pair generator using the specified parameter set and user-provided source of randomness. |
void |
initialize(int keysize,
SecureRandom random)
Initializes the key pair generator for a certain keysize, using the default parameter set. |
String |
toString()
Returns a string representation of the object. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
public RSAKeyPairGeneratorEngine()
Method Detail |
public String toString()
public void initialize(int keysize, SecureRandom random)
null
we use
the SecureRandom
implementation of the
highest-priority installed provider as the source of randomness.
(If none of the installed providers supply an implementation of
SecureRandom
, a system-provided source of randomness
is used.)
Note: If there a reinitialization with a null
reference for random
we use the existing random object,
that was valid before reinitialization.
keysize
- the keysize. The keysize must be a positive multiple of
256 and equals or greater than 768.random
- the source of randomness for this generator. If random is
null
we use the the SecureRandom
implementation
of the highest-priority installed provider as the source of randomness.
(If none of the installed providers supply an implementation of
SecureRandom
, a system-provided source of randomness
is used.)
InvalidParameterException
- if the keysize
is not
equals or geater than 768 and a multible of 256. Where the unit is bit.public void initialize(AlgorithmParameterSpec params, SecureRandom random) throws InvalidAlgorithmParameterException
RSAKeyGenParameterSpec
as
AlgorithmParamterSpec
. RSAKeyGenParameterSpec
does support int keysize
and
BigInteger publicExponent
. The keysize
must be
768 or greater and a multible of 256.
So that keysize
satisfies the equation:
keysize = x * 256, where x = 3, 4, 5, 6, ...
publicExponent
are:
publicExponent =
RSAKeyGenParameterSpec.F0
= 3publicExponent =
RSAKeyGenParameterSpec.F4
= 65537Note: If there a reinitialization with a null
reference for random
we use the existing random object,
that was valid before reinitialization.
params
- the parameter set used to generate the keys.random
- the source of randomness for this generator.
InvalidAlgorithmParameterException
- if the keysize
is not equals or geater than 768 and a multible of 256. Where the unit
is bit. Or if the publicExponent
isn't F0 or F4.RSAKeyGenParameterSpec
public KeyPair generateKeyPair()
KeyPair
. Unless an initialization method is
called using a KeyPairGenerator interface, algorithm-specific defaults
will be used. This will generate a new key pair every time it
is called. The defaults are keysize
= 768 bit and
random with the SecureRandom
implementation of the
highest-priority installed provider as the source of randomness.
(If none of the installed providers supply an implementation of
SecureRandom
, a system-provided source of randomness
is used.)
KeyPair
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |