public class

RSAEngine

extends Object
implements AsymmetricBlockCipher
java.lang.Object
   ↳ org.bouncycastle.crypto.engines.RSAEngine

Class Overview

this does your basic RSA algorithm.

Summary

Public Constructors
RSAEngine()
Public Methods
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.
byte[] processBlock(byte[] in, int inOff, int inLen)
Process a single block using the basic RSA algorithm.
[Expand]
Inherited Methods
From class java.lang.Object
From interface org.bouncycastle.crypto.AsymmetricBlockCipher

Public Constructors

public RSAEngine ()

Public Methods

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.

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.

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.

public byte[] processBlock (byte[] in, int inOff, int inLen)

Process a single block using the basic RSA algorithm.

Parameters
in the input array.
inOff the offset into the input buffer where the data starts.
inLen the length of the data to be processed.
Returns
  • the result of the RSA process.
Throws
DataLengthException the input block is too large.