ecash.kernel
Class PubKey

java.lang.Object
  |
  +--ecash.kernel.PubKey
All Implemented Interfaces:
java.io.Serializable

public class PubKey
extends java.lang.Object
implements java.io.Serializable

Public key of the bank, used to sign the bank notes.

Author:
Michel Deriaz
See Also:
Serialized Form

Constructor Summary
PubKey(java.math.BigInteger e, java.math.BigInteger n)
          Creates a public key from the public exponent and the modulus.
PubKey(java.lang.String value)
          Re-build the object from it's string representation.
 
Method Summary
 java.math.BigInteger getE()
          Returns the public exponent of the key.
 java.math.BigInteger getN()
          Returns the modulus of the key.
static PubKey load(java.lang.String filename)
          Re-build the object from it's file representation.
 void save(java.lang.String filename)
          Saves this object into it's file representation.
 java.lang.String toString()
          Returns a string representation of this PubKey.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

PubKey

public PubKey(java.math.BigInteger e,
              java.math.BigInteger n)
Creates a public key from the public exponent and the modulus.

Parameters:
e - the public exponent
n - the modulus

PubKey

public PubKey(java.lang.String value)
Re-build the object from it's string representation.

Parameters:
value - the string representation of the object
Method Detail

getE

public java.math.BigInteger getE()
Returns the public exponent of the key.

Returns:
e, the public exponent of the key

getN

public java.math.BigInteger getN()
Returns the modulus of the key.

Returns:
n, the modulus of the key

load

public static PubKey load(java.lang.String filename)
Re-build the object from it's file representation.

Parameters:
filename - the filename

save

public void save(java.lang.String filename)
Saves this object into it's file representation.

Parameters:
filename - the filename

toString

public java.lang.String toString()
Returns a string representation of this PubKey.

Overrides:
toString in class java.lang.Object
Returns:
a string representation of this PubKey