public class BaseElGamalPrivateKey extends BaseElGamalPublicKey implements ElGamalPrivateKey
References:
Copyright © 1997
Systemics Ltd on behalf of the
Cryptix Development Team.
All rights reserved.
$Revision: 1.2 $
ElGamalKey
,
java.security.Cipher
,
Signature
,
Serialized FormModifier and Type | Field and Description |
---|---|
protected java.math.BigInteger |
x |
g, p, y
Modifier | Constructor and Description |
---|---|
|
BaseElGamalPrivateKey(java.math.BigInteger p,
java.math.BigInteger g,
java.math.BigInteger x)
Constructs a BaseElGamalPrivateKey with the specified prime
p, base g, and private value x.
|
|
BaseElGamalPrivateKey(java.math.BigInteger p,
java.math.BigInteger g,
java.math.BigInteger x,
java.math.BigInteger y)
Constructs a BaseElGamalPrivateKey with the specified prime
p, base g, private value x, and pre-calculated
public value y = g
|
protected |
BaseElGamalPrivateKey(ElGamalParams params,
java.math.BigInteger x)
Constructs a BaseElGamalPublicKey with a prime and base taken
from an object implementing java.security.interfaces.ElGamalParams,
and the specified private value x.
|
Modifier and Type | Method and Description |
---|---|
java.math.BigInteger |
getX()
Returns the value of x (the private key).
|
getAlgorithm, getEncoded, getFormat, getG, getP, getY
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getG, getP, getY
public BaseElGamalPrivateKey(java.math.BigInteger p, java.math.BigInteger g, java.math.BigInteger x, java.math.BigInteger y)
p
- the prime as a java.math.BigIntegerg
- the base as a java.math.BigIntegerx
- the value of x as a java.math.BigIntegery
- the value of y as a java.math.BigIntegerjava.lang.NullPointerException
- if p == null || g == null ||
x == null || y == nullpublic BaseElGamalPrivateKey(java.math.BigInteger p, java.math.BigInteger g, java.math.BigInteger x)
The public value y = g
p
- the prime as a java.math.BigIntegerg
- the base as a java.math.BigIntegerx
- the value of x as a java.math.BigIntegerjava.lang.NullPointerException
- if p == null || g == null || x == nullprotected BaseElGamalPrivateKey(ElGamalParams params, java.math.BigInteger x)
The public value y = g
params
- the parameters for this keyx
- the value of x as a java.math.BigIntegerjava.lang.NullPointerException
- if params == null || x == nullElGamalParams
public java.math.BigInteger getX()
getX
in interface ElGamalPrivateKey