anon.crypto
Class MyRSA

java.lang.Object
  extended by anon.crypto.MyRSA

public class MyRSA
extends java.lang.Object

Encryption/Decryption using RSA


Field Summary
(package private)  org.bouncycastle.crypto.encodings.OAEPEncoding m_OAEP
           
(package private)  org.bouncycastle.crypto.encodings.PKCS1Encoding m_PKCS1
           
(package private)  org.bouncycastle.crypto.engines.RSAEngine m_RSAEngine
           
 
Constructor Summary
MyRSA()
           
MyRSA(org.bouncycastle.crypto.Digest digest)
           
 
Method Summary
 void init(MyRSAPrivateKey key)
          inits the cipher for decryption
 void init(MyRSAPublicKey key)
          inits the cipher for encryption
 byte[] processBlock(byte[] plain, int offset, int len)
          encrypts/decrypts one block using Plain RSA
 byte[] processBlockOAEP(byte[] plain, int offset, int len)
          encrypts/decrypts one block using OAEP padding
 byte[] processBlockPKCS1(byte[] plain, int offset, int len)
          encrypts/decrypts one block using PKCS1 padding
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

m_RSAEngine

org.bouncycastle.crypto.engines.RSAEngine m_RSAEngine

m_OAEP

org.bouncycastle.crypto.encodings.OAEPEncoding m_OAEP

m_PKCS1

org.bouncycastle.crypto.encodings.PKCS1Encoding m_PKCS1
Constructor Detail

MyRSA

public MyRSA()

MyRSA

public MyRSA(org.bouncycastle.crypto.Digest digest)
Method Detail

init

public void init(MyRSAPublicKey key)
          throws java.lang.Exception
inits the cipher for encryption

Throws:
java.lang.Exception

init

public void init(MyRSAPrivateKey key)
          throws java.lang.Exception
inits the cipher for decryption

Throws:
java.lang.Exception

processBlock

public byte[] processBlock(byte[] plain,
                           int offset,
                           int len)
                    throws java.lang.Exception
encrypts/decrypts one block using Plain RSA

Throws:
java.lang.Exception

processBlockOAEP

public byte[] processBlockOAEP(byte[] plain,
                               int offset,
                               int len)
                        throws java.lang.Exception
encrypts/decrypts one block using OAEP padding

Throws:
java.lang.Exception

processBlockPKCS1

public byte[] processBlockPKCS1(byte[] plain,
                                int offset,
                                int len)
                         throws java.lang.Exception
encrypts/decrypts one block using PKCS1 padding

Throws:
java.lang.Exception