com.didisoft.pgp.bc.elgamal
Class BaseElGamalPrivateKey
java.lang.Object
com.didisoft.pgp.bc.elgamal.BaseElGamalPublicKey
com.didisoft.pgp.bc.elgamal.BaseElGamalPrivateKey
- All Implemented Interfaces:
- ElGamalKey, ElGamalPrivateKey, ElGamalPublicKey, java.io.Serializable, java.security.Key, java.security.PrivateKey, java.security.PublicKey
public class BaseElGamalPrivateKey
- extends BaseElGamalPublicKey
- implements ElGamalPrivateKey
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 $
- Since:
- Cryptix 2.2.2
- Author:
- David Hopwood
- See Also:
ElGamalKey
,
java.security.Cipher
,
Signature
,
Serialized Form
Fields inherited from interface java.security.PrivateKey |
serialVersionUID |
Fields inherited from interface java.security.PublicKey |
serialVersionUID |
Constructor Summary |
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 = gx mod p. |
Method Summary |
java.math.BigInteger |
getX()
Returns the value of x (the private key). |
Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface java.security.Key |
getAlgorithm, getEncoded, getFormat |
BaseElGamalPrivateKey
public 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 = gx mod p.
- Parameters:
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
- Throws:
java.lang.NullPointerException
- if p == null || g == null ||
x == null || y == null
BaseElGamalPrivateKey
public 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.
The public value y = gx mod p will be
calculated.
- Parameters:
p
- the prime as a java.math.BigIntegerg
- the base as a java.math.BigIntegerx
- the value of x as a java.math.BigInteger
- Throws:
java.lang.NullPointerException
- if p == null || g == null || x == null
getX
public java.math.BigInteger getX()
- Returns the value of x (the private key).
- Specified by:
getX
in interface ElGamalPrivateKey
- Returns:
- x as a java.math.BigInteger
Copyright © 2006-2011 DidiSoft Ltd. All Rights Reserved.