public class ESDHParameterGenerator extends DHParameterGenerator
The algorithm used is taken from RFC 2631. It specifies a minimum prime length of 512 bit and minimum exponent length of 160 bit; defaults in this implementation are 1024 and 300 bits respectively. Access to the verification parameters provided by the generation algorithm is not possible with the current API.
Note that parameter generation is fairly slow but this should not be a problem as this is a hardly performed activity anyway. Typically they will be generated once per user group by the CA and then the users will generate their keys using the parameters provided.
The Diffie Hellman algorithm has been the first public-key algorithm. It only can be used for key-agreement, but not for data encrypting and decrypting.
PKCS#3 describes
a method for implementing the Diffie Hellman key agreement where two (or more)
entities use general Diffie Hellman parameters (an odd prime p,
an integer base g satisfying 0 < g < p,
and optionally an integer l prescribing the length of the private value),
generated from some central authority (which may an entity itself), for creating a
shared secret only known by them.
Applications shall use AlgorithmParameterGenerator.getInstance("ESDH")
for obtaining an AlgorithmParamterGenerator for generating ESDH parameters in opaque
representation. Once the generator has been created, it shall be properly initialized
by one of the several init methods. If none explicit initialization is
done, per default the length of the prime modulus is set to 512 bits and the length
of the exponent (private value) is chosen to be 8 bits shorter, i.e. 504 bits. After
initializing the generator (or relying on default settings), the reguired parameters
actually are created by calling the generateParameters method.
AlgorithmParameterGenerator,
javax.crypto.spec.ESDHParameterSpec,
ESDHParameters,
ESDHPublicKey,
ESDHPrivateKey,
ESDHKeyPairGenerator,
ESDHKeyFactory,
ESDHKeyAgreement| Constructor and Description |
|---|
ESDHParameterGenerator()
The default constructor.
|
| Modifier and Type | Method and Description |
|---|---|
protected java.security.AlgorithmParameters |
createAlgParams(java.math.BigInteger p,
java.math.BigInteger g,
java.math.BigInteger q,
java.math.BigInteger j,
byte[] seed,
int counter)
Actually generates the required DH AlgorithmParameters.
|
engineGenerateParameters, engineInit, engineInitpublic ESDHParameterGenerator()
AlgorithmParameterGenerator.getInstance
factory methods for obtaining an AlgorithmParamterGenerator for generating paramters
for Diffie Hellman key agreement.protected java.security.AlgorithmParameters createAlgParams(java.math.BigInteger p,
java.math.BigInteger g,
java.math.BigInteger q,
java.math.BigInteger j,
byte[] seed,
int counter)
Applications shall call generatePrameters()
for provider independently accessing this method.