public class ESDHParameterSpec
extends javax.crypto.spec.DHParameterSpec
Attention: This is not a SUN implementation!
This class has been developed by IAIK according to the documentation publically available.
For SUN's documentation of this class see
http://java.sun.com/security/JCE1.2/spec/apidoc/index.html
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.
This class represents a specification for the prime modulus (p), base ganerator (g) and exponent length (l) parameters, as used by the Diffie-Hellman key exchange algorithm according to PKCS#3 (Diffie-Hellman Key Agreement Standard).
AlgorithmParameterSpec| Constructor and Description |
|---|
ESDHParameterSpec(java.math.BigInteger p,
java.math.BigInteger g,
java.math.BigInteger q)
Creates a Diffie-Hellman parameter specification, based on given prime modulus p,
base generator g and prime factor q.
|
ESDHParameterSpec(java.math.BigInteger p,
java.math.BigInteger g,
java.math.BigInteger q,
java.math.BigInteger j)
Creates a Diffie-Hellman parameter specification, based on given prime modulus p,
base generator g, prime factor q and soubgroup factor j.
|
ESDHParameterSpec(java.math.BigInteger p,
java.math.BigInteger g,
java.math.BigInteger q,
java.math.BigInteger j,
byte[] seed,
int pgenCounter)
Creates a Diffie-Hellman parameter specification, based on given prime modulus p,
base generator g, prime factor q, soubgroup factor j, the seed and counter used
in the system parameter generation process.
|
ESDHParameterSpec(java.math.BigInteger p,
java.math.BigInteger g,
java.math.BigInteger q,
byte[] seed,
int pgenCounter)
Creates a Diffie-Hellman parameter specification, based on given prime modulus p,
base generator g, prime factor q, the seed and counter used in the system parameter
generation process.
|
| Modifier and Type | Method and Description |
|---|---|
boolean |
equals(java.lang.Object obj) |
java.math.BigInteger |
getJ()
Returns the subgroup factor j.
|
int |
getL()
This method overrides the method of the super class and always
returns 0 since we don't use parameter L in ESDH.
|
int |
getPGenCounter()
Returns the counter used in the system parameter generation process.
|
java.math.BigInteger |
getQ()
Returns the prime factor q.
|
byte[] |
getSeed()
Returns the seed used in the system parameter generation process.
|
java.lang.String |
toString()
Returns a string representation of this Object.
|
public ESDHParameterSpec(java.math.BigInteger p,
java.math.BigInteger g,
java.math.BigInteger q)
p - the prime modulusg - the base generatorq - the prime factorpublic ESDHParameterSpec(java.math.BigInteger p,
java.math.BigInteger g,
java.math.BigInteger q,
java.math.BigInteger j)
p - the prime modulusg - the base generatorq - the prime factorj - the subgroup factorpublic ESDHParameterSpec(java.math.BigInteger p,
java.math.BigInteger g,
java.math.BigInteger q,
byte[] seed,
int pgenCounter)
p - the prime modulusg - the base generatorq - the prime factorseed - the the seed used in the system parameter generation processpgenCounter - the counter used in the system parameter generation processpublic ESDHParameterSpec(java.math.BigInteger p,
java.math.BigInteger g,
java.math.BigInteger q,
java.math.BigInteger j,
byte[] seed,
int pgenCounter)
p - the prime modulusg - the base generatorq - the prime factorj - the subgroup factorseed - the the seed used in the system parameter generation processpgenCounter - the counter used in the system parameter generation processpublic java.math.BigInteger getQ()
public java.math.BigInteger getJ()
public byte[] getSeed()
public int getPGenCounter()
public int getL()
getL in class javax.crypto.spec.DHParameterSpecpublic boolean equals(java.lang.Object obj)
equals in class java.lang.Objectpublic java.lang.String toString()
toString in class java.lang.Object