All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class cryptix.provider.elgamal.BaseElGamalPublicKey

java.lang.Object
   |
   +----cryptix.provider.elgamal.BaseElGamalPublicKey

public class BaseElGamalPublicKey
extends Object
implements ElGamalPublicKey
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:

  1. Bruce Schneier, "Section 19.6 ElGamal," Applied Cryptography, 2nd Edition, John Wiley & Sons, 1996.

  2. 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.1 $

Author:
David Hopwood
See Also:
ElGamalParams, Key, Cipher, Signature

Variable Index

 o g
 o p
 o y

Constructor Index

 o BaseElGamalPublicKey(BigInteger, BigInteger, BigInteger)
Constructs a BaseElGamalPublicKey with the specified prime p, base g, and public value y = gx mod p.
 o BaseElGamalPublicKey(ElGamalParams, BigInteger)
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.

Method Index

 o getAlgorithm()
Returns the name of the algorithm this key is intended for ("ElGamal").
 o getEncoded()
Returns an encoding of this key as a byte array.
 o getFormat()
Returns the encoding format name for this key.
 o getG()
Returns the base, g.
 o getP()
Returns the prime, p.
 o getY()
Returns the value of y = gx mod p (where x is the private value).

Variables

 o p
 protected BigInteger p
 o g
 protected BigInteger g
 o y
 protected BigInteger y

Constructors

 o 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.

Throws: NullPointerException
if p == null || g == null || y == null
 o 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.

Throws: NullPointerException
if params == null || y == null

Methods

 o getP
 public BigInteger getP()
Returns the prime, p.

Returns:
the prime as a java.math.BigInteger
 o getG
 public BigInteger getG()
Returns the base, g.

Returns:
the base as a java.math.BigInteger
 o getY
 public BigInteger getY()
Returns the value of y = gx mod p (where x is the private value).

Returns:
y as a java.math.BigInteger
 o getAlgorithm
 public String getAlgorithm()
Returns the name of the algorithm this key is intended for ("ElGamal").

 o 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.

 o 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.


All Packages  Class Hierarchy  This Package  Previous  Next  Index