part3
Class EGPrivateKey

java.lang.Object
  extended bypart3.EGPrivateKey
Direct Known Subclasses:
EGSignatureKey

public class EGPrivateKey
extends java.lang.Object

A class to implement an ElGamal private key.


Field Summary
protected  java.math.BigInteger _g
           
protected  java.math.BigInteger _p
           
protected  java.math.BigInteger _x
           
 
Constructor Summary
EGPrivateKey(java.math.BigInteger p, java.math.BigInteger g, java.math.BigInteger x)
          A constructor for an ElGamal private key (p,g,x).
EGPrivateKey(EGPrivateKey key)
          A copy constructor for an ElGamal private key.
 
Method Summary
 java.lang.String decrypt(java.util.AbstractList cipherText)
          A method to decrypt the ciphertext cipherText to a string value using this private key.
 java.math.BigInteger decrypt(EGCipherText cipherText)
          A method to decrypt the ciphertext cipherText to a big integer value using this private key.
 java.lang.String toString()
          A method to produce a string representation of this private EG key.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

_p

protected java.math.BigInteger _p

_g

protected java.math.BigInteger _g

_x

protected java.math.BigInteger _x
Constructor Detail

EGPrivateKey

public EGPrivateKey(java.math.BigInteger p,
                    java.math.BigInteger g,
                    java.math.BigInteger x)
             throws java.lang.Exception
A constructor for an ElGamal private key (p,g,x).

Throws:
Exception.
java.lang.Exception

EGPrivateKey

public EGPrivateKey(EGPrivateKey key)
             throws java.lang.Exception
A copy constructor for an ElGamal private key.

Throws:
Exception.
java.lang.Exception
Method Detail

decrypt

public java.math.BigInteger decrypt(EGCipherText cipherText)
                             throws java.lang.Exception
A method to decrypt the ciphertext cipherText to a big integer value using this private key.

Throws:
Exception.
java.lang.Exception

decrypt

public java.lang.String decrypt(java.util.AbstractList cipherText)
                         throws java.lang.Exception
A method to decrypt the ciphertext cipherText to a string value using this private key.

Throws:
Exception.
java.lang.Exception

toString

public java.lang.String toString()
A method to produce a string representation of this private EG key.

Throws:
Exception.