org.bouncycastle.crypto.engines
Class RSACoreEngine

java.lang.Object
  extended by org.bouncycastle.crypto.engines.RSACoreEngine

 class RSACoreEngine
extends java.lang.Object

this does your basic RSA algorithm.


Field Summary
private  boolean forEncryption
           
private  RSAKeyParameters key
           
 
Constructor Summary
RSACoreEngine()
           
 
Method Summary
 java.math.BigInteger convertInput(byte[] in, int inOff, int inLen)
           
 byte[] convertOutput(java.math.BigInteger result)
           
 int getInputBlockSize()
          Return the maximum size for an input block to this engine.
 int getOutputBlockSize()
          Return the maximum size for an output block to this engine.
 void init(boolean forEncryption, CipherParameters param)
          initialise the RSA engine.
 java.math.BigInteger processBlock(java.math.BigInteger input)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

key

private RSAKeyParameters key

forEncryption

private boolean forEncryption
Constructor Detail

RSACoreEngine

RSACoreEngine()
Method Detail

init

public void init(boolean forEncryption,
                 CipherParameters param)
initialise the RSA engine.

Parameters:
forEncryption - true if we are encrypting, false otherwise.
param - the necessary RSA key parameters.

getInputBlockSize

public int getInputBlockSize()
Return the maximum size for an input block to this engine. For RSA this is always one byte less than the key size on encryption, and the same length as the key size on decryption.

Returns:
maximum size for an input block.

getOutputBlockSize

public int getOutputBlockSize()
Return the maximum size for an output block to this engine. For RSA this is always one byte less than the key size on decryption, and the same length as the key size on encryption.

Returns:
maximum size for an output block.

convertInput

public java.math.BigInteger convertInput(byte[] in,
                                         int inOff,
                                         int inLen)

convertOutput

public byte[] convertOutput(java.math.BigInteger result)

processBlock

public java.math.BigInteger processBlock(java.math.BigInteger input)