ecash.kernel
Class KeyRing

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

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

This class represents a key ring, i.e. a public key and a private key.

Author:
Michel Deriaz
See Also:
Serialized Form

Constructor Summary
KeyRing()
          Creates a new key ring using the RSA algorithm.
KeyRing(java.lang.String value)
          Re-build the object from it's string representation.
 
Method Summary
 java.math.BigInteger getD()
          Returns the private exponent.
 java.math.BigInteger getE()
          Returns the public exponent.
 java.math.BigInteger getN()
          Returns the modulus.
 PubKey getPublic()
          Creates and returns the public key.
 java.lang.String toString()
          Returns a string representation of this KeyRing.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

KeyRing

public KeyRing()
Creates a new key ring using the RSA algorithm.


KeyRing

public KeyRing(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.

Returns:
e

getN

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

Returns:
n

getD

public java.math.BigInteger getD()
Returns the private exponent.

Returns:
d

getPublic

public PubKey getPublic()
Creates and returns the public key.

Returns:
the public key

toString

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

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