|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--java.security.KeyPairGeneratorSpi | +--java.security.KeyPairGenerator | +--iaik.security.dh.ESDHKeyPairGenerator
Key pair generator for ESDH keys to be used for Ephemeral Static Diffie Hellman key agreement as specified by RFC 2631.
For creating a ESDH key pair necessary a KeyPairGenerator has to be instantiated,
properly initialized and directed to actually generate the keys by calling the
generateKeyPair
method. If the generator
is not initialized by explicitly calling an initialize
method,
the modulus length per default is set to 1024 bits.
Generating ESDH keys using a modulus length of, e.g. 1024 bits (explicitly initialized), may be done by:
KeyPairGenerator key_gen = KeyPairGenerator.getIntance("ESDH"); key_gen.initialize(1024, sec_random); KeyPair key_pair = key_gen.generateKeyPair();
The example above initializes the key pair generator algorithm-independently by only specifying the length of the modulus. For performing an algorithm-specific initialization, an explicit cast to ESDHKeyPairGenerator would be necessary, e.g.:
ESDHKeyPairGenerator dh_key_gen = (ESDHKeyPairGenerator)key_gen; dh_key_gen.initialize(dh_param_spec, sec_random);
Guidelines on how to create key pairs using a KeyPairGenerator can be found in http://java.sun.com/products/JDK/1.1/docs/guide/security/CryptoSpec.html.
KeyPairGenerator
,
KeyPair
,
ESDHPublicKey
,
ESDHPrivateKey
,
ESDHKeyFactory
,
ESDHKeyAgreement
Constructor Summary | |
ESDHKeyPairGenerator()
Default constructor for creating a ESDHKeyPairGenerator object. |
Method Summary | |
KeyPair |
generateKeyPair()
Actually generates the requested ESDH KeyPair. |
void |
initialize(AlgorithmParameterSpec param,
SecureRandom random)
Initializes this ESDHKeyPairGenerator with given ESDH parameter specification and random seed. |
void |
initialize(int primeLength)
Initializes the ESDHKeyPairGenerator for given prime modulus length. |
void |
initialize(int primeLength,
SecureRandom random)
Initializes the ESDHKeyPairGenerator for given prime modulus length with the given random seed. |
Methods inherited from class java.security.KeyPairGenerator |
genKeyPair, getAlgorithm, getInstance, getInstance, getProvider, initialize |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public ESDHKeyPairGenerator()
Method Detail |
public void initialize(int primeLength)
initialize
in class KeyPairGenerator
primLength
- the length of the prime modulus in bitspublic void initialize(int primeLength, SecureRandom random)
initialize
in class KeyPairGenerator
primLength
- the length of the prime modulus in bitsrandom
- the random seed as SecureRandom.public void initialize(AlgorithmParameterSpec param, SecureRandom random) throws InvalidAlgorithmParameterException
initialize
in class KeyPairGenerator
param
- the ESDHParameterSpec representing prime modulus p
,
base generator g
, prime factor q
,
the subgroup factor j
(if available) and the seed seed
and pgenCounter pgenCounter
(if available).random
- the random seed as SecureRandomInvalidParameterException
- if the given algorithm parameter specification is not
a ESDHParameterSpec or the size of the exponent is not
shorter than that of the prime modulus, both derived
from the given ESDH parameter specificationpublic KeyPair generateKeyPair()
generateKeyPair
in class KeyPairGenerator
|
This Javadoc may contain text parts from Internet Standard specifications (RFC 2459, 3280, 3039, 2560, 1521, 821, 822, 2253, 1319, 1321, ,2630, 2631, 2268, 3058, 2984, 2104, 2144, 2040, 2311, 2279, see copyright note) and RSA Data Security Public-Key Cryptography Standards (PKCS#1,3,5,7,8,9,10,12, see copyright note). | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |