cryptix.provider.elgamal
Class BaseElGamalPrivateKey
- ElGamalKey, ElGamalPrivateKey, PrivateKey, ElGamalPublicKey, PublicKey
public class BaseElGamalPrivateKey
A class representing an ElGamal private key. This can also act as
an ElGamal public key. It is called BaseElGamalPrivateKey to
distinguish it from the interface ElGamalPrivateKey, without having to
use fully-qualified names.
References:
- Bruce Schneier,
"Section 19.6 ElGamal,"
Applied Cryptography, 2nd Edition,
John Wiley & Sons, 1996.
- IEEE P1363 draft standard,
http://stdsbbs.ieee.org/groups/1363/index.html
Copyright © 1997
Systemics Ltd on behalf of the
Cryptix Development Team.
All rights reserved.
$Revision: 1.2 $
ElGamalKey
, java.security.Cipher
, java.security.Signature
BaseElGamalPrivateKey(BigInteger p, BigInteger g, BigInteger x) - Constructs a BaseElGamalPrivateKey with the specified prime
p, base g, and private value x.
|
BaseElGamalPrivateKey(BigInteger p, BigInteger g, BigInteger x, BigInteger y) - Constructs a BaseElGamalPrivateKey with the specified prime
p, base g, private value x, and pre-calculated
public value y = gx mod p.
|
BaseElGamalPrivateKey(ElGamalParams params, 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.
|
BigInteger | getX() - Returns the value of x (the private key).
|
BaseElGamalPrivateKey
public BaseElGamalPrivateKey(BigInteger p,
BigInteger g,
BigInteger x)
Constructs a BaseElGamalPrivateKey with the specified prime
p, base
g, and private value
x.
The public value
y = gx mod
p will be
calculated.
p
- the prime as a java.math.BigIntegerg
- the base as a java.math.BigIntegerx
- the value of x as a java.math.BigInteger
BaseElGamalPrivateKey
public BaseElGamalPrivateKey(BigInteger p,
BigInteger g,
BigInteger x,
BigInteger y)
Constructs a BaseElGamalPrivateKey with the specified prime
p, base g, private value x, and pre-calculated
public value y = gx mod p.
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.BigInteger
BaseElGamalPrivateKey
protected BaseElGamalPrivateKey(ElGamalParams params,
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.
The public value
y = gx mod
p will be
calculated.
params
- the parameters for this keyx
- the value of x as a java.math.BigInteger
getX
public BigInteger getX()
Returns the value of x (the private key).
- getX in interface ElGamalPrivateKey
- x as a java.math.BigInteger