public class BaseElGamalPublicKey extends java.lang.Object implements ElGamalPublicKey
References:
Copyright © 1997
Systemics Ltd on behalf of the
Cryptix Development Team.
All rights reserved.
$Revision: 1.2 $
ElGamalParams
,
Key
,
java.security.Cipher
,
Signature
,
Serialized FormModifier and Type | Field and Description |
---|---|
protected java.math.BigInteger |
g |
protected java.math.BigInteger |
p |
protected java.math.BigInteger |
y |
Constructor and Description |
---|
BaseElGamalPublicKey(java.math.BigInteger p,
java.math.BigInteger g,
java.math.BigInteger y)
Constructs a BaseElGamalPublicKey with the specified prime p,
base g, and public value y = g
|
BaseElGamalPublicKey(ElGamalParams params,
java.math.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 = g
|
Modifier and Type | Method and Description |
---|---|
java.lang.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.
|
java.lang.String |
getFormat()
Returns the encoding format name for this key.
|
java.math.BigInteger |
getG()
Returns the base, g.
|
java.math.BigInteger |
getP()
Returns the prime, p.
|
java.math.BigInteger |
getY()
Returns the value of y = g
|
protected java.math.BigInteger p
protected java.math.BigInteger g
protected java.math.BigInteger y
public BaseElGamalPublicKey(java.math.BigInteger p, java.math.BigInteger g, java.math.BigInteger y)
java.lang.NullPointerException
- if p == null || g == null || y == nullpublic BaseElGamalPublicKey(ElGamalParams params, java.math.BigInteger y)
java.lang.NullPointerException
- if params == null || y == nullpublic java.math.BigInteger getP()
getP
in interface ElGamalKey
public java.math.BigInteger getG()
getG
in interface ElGamalKey
public java.math.BigInteger getY()
getY
in interface ElGamalKey
public java.lang.String getAlgorithm()
getAlgorithm
in interface java.security.Key
public java.lang.String getFormat()
getFormat
in interface java.security.Key
public byte[] getEncoded()
getEncoded
in interface java.security.Key