com.wizzardo.tools.security
Class RSA

java.lang.Object
  extended by com.wizzardo.tools.security.RSA

public class RSA
extends java.lang.Object


Constructor Summary
RSA(int n)
           
RSA(java.lang.String publicKey, java.lang.String modulus)
           
 
Method Summary
 java.math.BigInteger decrypt(java.math.BigInteger encrypted)
           
 byte[] decrypt(byte[] encrypted)
           
 byte[] decrypt(byte[] encrypted, int lenght)
           
 byte[] decrypt(byte[] encrypted, int offset, int arrLength, int length)
           
 java.math.BigInteger encrypt(java.math.BigInteger message)
           
 byte[] encrypt(byte[] message)
           
 java.math.BigInteger getModulus()
           
 int getN()
           
 java.math.BigInteger getPrivateKey()
           
 java.math.BigInteger getPublicKey()
           
 java.lang.String getStringToTransfer()
           
static byte[] hexStringToByteArray(java.lang.String hex)
           
static byte[] hexStringToByteArray(java.lang.String hex, int lenght)
           
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

RSA

public RSA(int n)

RSA

public RSA(java.lang.String publicKey,
           java.lang.String modulus)
Method Detail

getStringToTransfer

public java.lang.String getStringToTransfer()

encrypt

public java.math.BigInteger encrypt(java.math.BigInteger message)

decrypt

public java.math.BigInteger decrypt(java.math.BigInteger encrypted)

encrypt

public byte[] encrypt(byte[] message)

decrypt

public byte[] decrypt(byte[] encrypted)

decrypt

public byte[] decrypt(byte[] encrypted,
                      int lenght)

decrypt

public byte[] decrypt(byte[] encrypted,
                      int offset,
                      int arrLength,
                      int length)

hexStringToByteArray

public static byte[] hexStringToByteArray(java.lang.String hex,
                                          int lenght)

hexStringToByteArray

public static byte[] hexStringToByteArray(java.lang.String hex)

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object

getN

public int getN()

getModulus

public java.math.BigInteger getModulus()

getPrivateKey

public java.math.BigInteger getPrivateKey()

getPublicKey

public java.math.BigInteger getPublicKey()