Class PubRSA

java.lang.Object
  PubRSA
All Implemented Interfaces:
java.io.Serializable

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

See Also:
Serialized Form

Field Summary
(package private)  java.math.BigInteger e
          The components of the public key
(package private)  java.math.BigInteger n
          The components of the public key
 
Constructor Summary
PubRSA(java.math.BigInteger eVal, java.math.BigInteger nVal)
          Takes the exponenet (e) and the modulus (nVal) as the two parameters of the RSA secret key.
 
Method Summary
 java.math.BigInteger encrypt(java.math.BigInteger m)
          Encrypt the message m with this key, m < n, or you suffer truncation
 java.math.BigInteger getExponent()
          Return the public exponenet.
 java.math.BigInteger getModulus()
          Return Modulus.
 boolean verifySig(java.math.BigInteger m, java.math.BigInteger s)
          Verify that this public key's private key signed the message, "reverse cipher"
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

e

java.math.BigInteger e
The components of the public key


n

java.math.BigInteger n
The components of the public key

Constructor Detail

PubRSA

public PubRSA(java.math.BigInteger eVal,
              java.math.BigInteger nVal)
Takes the exponenet (e) and the modulus (nVal) as the two parameters of the RSA secret key. nVal was contructed from two primes (p,q) previously, and nVal = pq

Method Detail

encrypt

public java.math.BigInteger encrypt(java.math.BigInteger m)
Encrypt the message m with this key, m < n, or you suffer truncation


verifySig

public boolean verifySig(java.math.BigInteger m,
                         java.math.BigInteger s)
Verify that this public key's private key signed the message, "reverse cipher"


getExponent

public java.math.BigInteger getExponent()
Return the public exponenet.


getModulus

public java.math.BigInteger getModulus()
Return Modulus.