Top Description Fields Constructors Methods
org.bouncycastle.crypto.engines

public Class RSAEngine

extends Object
implements AsymmetricBlockCipher
Class Inheritance
All Implemented Interfaces
org.bouncycastle.crypto.AsymmetricBlockCipher
Imports
org.bouncycastle.crypto.AsymmetricBlockCipher, .CipherParameters, .DataLengthException

this does your basic RSA algorithm.

Field Summary

Modifier and TypeField and Description
private RSACoreEngine

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public int

Returns:

maximum size for an input block.
getInputBlockSize
()

Implements org.bouncycastle.crypto.AsymmetricBlockCipher.getInputBlockSize.

Return the maximum size for an input block to this engine.

public int

Returns:

maximum size for an output block.
getOutputBlockSize
()

Implements org.bouncycastle.crypto.AsymmetricBlockCipher.getOutputBlockSize.

Return the maximum size for an output block to this engine.

public void
init(boolean
true if we are encrypting, false otherwise.
forEncryption
,
CipherParameters
the necessary RSA key parameters.
param
)

Implements org.bouncycastle.crypto.AsymmetricBlockCipher.init.

initialise the RSA engine.

public byte[]

Returns:

the result of the RSA process.
processBlock
(byte[]
the input array.
in
,
int
the offset into the input buffer where the data starts.
inOff
,
int
the length of the data to be processed.
inLen
)

Implements org.bouncycastle.crypto.AsymmetricBlockCipher.processBlock.

Process a single block using the basic RSA algorithm.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

coreback to summary
private RSACoreEngine core

Constructor Detail

RSAEngineback to summary
public RSAEngine()

Method Detail

getInputBlockSizeback to summary
public int getInputBlockSize()

Implements org.bouncycastle.crypto.AsymmetricBlockCipher.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:int

maximum size for an input block.

getOutputBlockSizeback to summary
public int getOutputBlockSize()

Implements org.bouncycastle.crypto.AsymmetricBlockCipher.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:int

maximum size for an output block.

initback to summary
public void init(boolean forEncryption, CipherParameters param)

Implements org.bouncycastle.crypto.AsymmetricBlockCipher.init.

initialise the RSA engine.

Parameters
forEncryption:boolean

true if we are encrypting, false otherwise.

param:CipherParameters

the necessary RSA key parameters.

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

Implements org.bouncycastle.crypto.AsymmetricBlockCipher.processBlock.

Process a single block using the basic RSA algorithm.

Parameters
in:byte[]

the input array.

inOff:int

the offset into the input buffer where the data starts.

inLen:int

the length of the data to be processed.

Returns:byte[]

the result of the RSA process.

Exceptions
DataLengthException:
the input block is too large.