part2
Class SimpleRSAPrivateKey

java.lang.Object
  extended bypart2.SimpleRSAPrivateKey
All Implemented Interfaces:
RSAPrivateKey
Direct Known Subclasses:
RSAPrivateKeyWithAppendix, RSAPrivateKeyWithRecovery

public class SimpleRSAPrivateKey
extends java.lang.Object
implements RSAPrivateKey

A class that implements an RSA private key.


Constructor Summary
SimpleRSAPrivateKey(java.math.BigInteger n, java.math.BigInteger d)
          A constructor for an RSA private key with modulus n and private exponent d.
SimpleRSAPrivateKey(SimpleRSAPrivateKey key)
          A copy constructor for an RSA 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(java.math.BigInteger cipherText)
          A method to decrypt the ciphertext cipherText to a big integer value using the private key key.
 java.math.BigInteger modulus()
          A method to return the modulus of this private RSA key.
 java.math.BigInteger privateExponent()
          A method to return the private exponent of this private RSA key.
 java.lang.String toString()
          A method to produce a string representation of this private RSA key.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

SimpleRSAPrivateKey

public SimpleRSAPrivateKey(java.math.BigInteger n,
                           java.math.BigInteger d)
                    throws java.lang.Exception
A constructor for an RSA private key with modulus n and private exponent d.

Throws:
Exception.
java.lang.Exception

SimpleRSAPrivateKey

public SimpleRSAPrivateKey(SimpleRSAPrivateKey key)
                    throws java.lang.Exception
A copy constructor for an RSA private key.

Throws:
Exception.
java.lang.Exception
Method Detail

modulus

public java.math.BigInteger modulus()
                             throws java.lang.Exception
A method to return the modulus of this private RSA key.

Throws:
Exception.
java.lang.Exception

privateExponent

public java.math.BigInteger privateExponent()
                                     throws java.lang.Exception
A method to return the private exponent of this private RSA key.

Throws:
Exception.
java.lang.Exception

toString

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

Throws:
Exception.

decrypt

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

Specified by:
decrypt in interface RSAPrivateKey
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.

Specified by:
decrypt in interface RSAPrivateKey
Throws:
Exception.
java.lang.Exception