All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class cryptix.provider.elgamal.BaseElGamalPrivateKey

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

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:

  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:
ElGamalKey, Cipher, Signature

Variable Index

 o x

Constructor Index

 o BaseElGamalPrivateKey(BigInteger, BigInteger, BigInteger)
Constructs a BaseElGamalPrivateKey with the specified prime p, base g, and private value x.
 o BaseElGamalPrivateKey(BigInteger, BigInteger, BigInteger, BigInteger)
Constructs a BaseElGamalPrivateKey with the specified prime p, base g, private value x, and pre-calculated public value y = gx mod p.
 o BaseElGamalPrivateKey(ElGamalParams, BigInteger)
Constructs a BaseElGamalPublicKey with a prime and base taken from an object implementing java.security.interfaces.ElGamalParams, and the specified private value x.

Method Index

 o getX()
Returns the value of x (the private key).

Variables

 o x
 protected BigInteger x

Constructors

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

Parameters:
p - the prime as a java.math.BigInteger
g - the base as a java.math.BigInteger
x - the value of x as a java.math.BigInteger
y - the value of y as a java.math.BigInteger
Throws: NullPointerException
if p == null || g == null || x == null || y == null
 o 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.

Parameters:
p - the prime as a java.math.BigInteger
g - the base as a java.math.BigInteger
x - the value of x as a java.math.BigInteger
Throws: NullPointerException
if p == null || g == null || x == null
 o 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.

Parameters:
params - the parameters for this key
x - the value of x as a java.math.BigInteger
Throws: NullPointerException
if params == null || x == null
See Also:
ElGamalParams

Methods

 o getX
 public BigInteger getX()
Returns the value of x (the private key).

Returns:
x as a java.math.BigInteger

All Packages  Class Hierarchy  This Package  Previous  Next  Index