cryptix.provider.elgamal
Class BaseElGamalPublicKey
java.lang.Object
cryptix.provider.elgamal.BaseElGamalPublicKey
- ElGamalKey, ElGamalPublicKey, PublicKey
public class BaseElGamalPublicKey
extends java.lang.Object
A class representing an ElGamal public key. This is also a superclass
for ElGamal private keys. It is called BaseElGamalPublicKey to
distinguish it from the interface ElGamalPublicKey, 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 $
- David Hopwood
- Cryptix 2.2.2
ElGamalParams
, java.security.Key
, java.security.Cipher
, java.security.Signature
protected BigInteger | g
|
protected BigInteger | p
|
protected BigInteger | y
|
BaseElGamalPublicKey(BigInteger p, BigInteger g, BigInteger y) - Constructs a BaseElGamalPublicKey with the specified prime p,
base g, and public value y = gx mod p.
|
BaseElGamalPublicKey(ElGamalParams params, BigInteger y) - Constructs a BaseElGamalPublicKey with a prime and base taken
from an object implementing java.security.interfaces.ElGamalParams,
and the specified public value y = gx mod p.
|
String | getAlgorithm() - Returns the name of the algorithm this key is intended for
("ElGamal").
|
byte[] | getEncoded() - Returns an encoding of this key as a byte array.
|
String | getFormat() - Returns the encoding format name for this key.
|
BigInteger | getG() - Returns the base, g.
|
BigInteger | getP() - Returns the prime, p.
|
BigInteger | getY() - Returns the value of y = gx mod p
(where x is the private value).
|
BaseElGamalPublicKey
public BaseElGamalPublicKey(BigInteger p,
BigInteger g,
BigInteger y)
Constructs a BaseElGamalPublicKey with the specified prime p,
base g, and public value y = gx mod p.
BaseElGamalPublicKey
public BaseElGamalPublicKey(ElGamalParams params,
BigInteger y)
Constructs a BaseElGamalPublicKey with a prime and base taken
from an object implementing java.security.interfaces.ElGamalParams,
and the specified public value y = gx mod p.
getAlgorithm
public String getAlgorithm()
Returns the name of the algorithm this key is intended for
("ElGamal").
getEncoded
public byte[] getEncoded()
Returns an encoding of this key as a byte array. In the current
release this always returns null, because key encoding is not
yet supported.
getFormat
public String getFormat()
Returns the encoding format name for this key. In the current
release this always returns null, because key encoding is not
yet supported.
getG
public BigInteger getG()
Returns the base, g.
- getG in interface ElGamalKey
- the base as a java.math.BigInteger
getP
public BigInteger getP()
Returns the prime, p.
- getP in interface ElGamalKey
- the prime as a java.math.BigInteger
getY
public BigInteger getY()
Returns the value of y = gx mod p
(where x is the private value).
- getY in interface ElGamalKey
- y as a java.math.BigInteger