Class RSA

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

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

See Also:
Serialized Form

Field Summary
(package private)  java.util.Date created
           
(package private)  java.lang.String Description
           
static java.math.BigInteger E
           
private static java.math.BigInteger FOUR
          Constants I'll need later
private  int keySize
           
private  java.math.BigInteger p
           
private  java.math.BigInteger q
           
private static java.security.SecureRandom r
           
 
Constructor Summary
RSA()
           
RSA(int keyLen)
           
 
Method Summary
 java.lang.String decrypt(java.lang.String cipherText)
          Provide this to make code look more readable
 java.math.BigInteger decryptNum(java.math.BigInteger cipherNum)
          Provide this to make code look more readable
 void gen()
          Generate a new set of keys (used for pre-serialization).
 PubRSA publicKey()
          Returns a Public key to match this object
 java.lang.String sign(java.lang.String pt)
          Returns String signature of pt, converts pt to a biginteger
 java.math.BigInteger signNum(java.math.BigInteger m)
          Returns a signature of m (m^d mod n)
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

FOUR

private static java.math.BigInteger FOUR
Constants I'll need later


E

public static java.math.BigInteger E

keySize

private int keySize

r

private static java.security.SecureRandom r

q

private java.math.BigInteger q

p

private java.math.BigInteger p

Description

java.lang.String Description

created

java.util.Date created
Constructor Detail

RSA

public RSA()

RSA

public RSA(int keyLen)
Method Detail

gen

public void gen()
Generate a new set of keys (used for pre-serialization).


signNum

public java.math.BigInteger signNum(java.math.BigInteger m)
Returns a signature of m (m^d mod n)


decryptNum

public java.math.BigInteger decryptNum(java.math.BigInteger cipherNum)
Provide this to make code look more readable


sign

public java.lang.String sign(java.lang.String pt)
Returns String signature of pt, converts pt to a biginteger


decrypt

public java.lang.String decrypt(java.lang.String cipherText)
Provide this to make code look more readable


publicKey

public PubRSA publicKey()
Returns a Public key to match this object