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

public Class RSABlindedEngine

extends Object
implements AsymmetricBlockCipher
Class Inheritance
All Implemented Interfaces
org.bouncycastle.crypto.AsymmetricBlockCipher
Imports
java.math.BigInteger, java.security.SecureRandom, org.bouncycastle.crypto.AsymmetricBlockCipher, .CipherParameters, .CryptoServicesRegistrar, .DataLengthException, org.bouncycastle.crypto.params.ParametersWithRandom, .RSAKeyParameters, .RSAPrivateCrtKeyParameters, org.bouncycastle.util.BigIntegers

this does your basic RSA algorithm with blinding

Field Summary

Modifier and TypeField and Description
private RSACoreEngine
private RSAKeyParameters
private static final BigInteger
private SecureRandom

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 key and other data required by the cipher.
parameters
)

Implements org.bouncycastle.crypto.AsymmetricBlockCipher.init.

initialise the RSA engine.

protected SecureRandom
initSecureRandom(boolean needed, SecureRandom provided)

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.

private BigInteger
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

coreback to summary
private RSACoreEngine core
keyback to summary
private RSAKeyParameters key
ONEback to summary
private static final BigInteger ONE
randomback to summary
private SecureRandom random

Constructor Detail

RSABlindedEngineback to summary
public RSABlindedEngine()

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 parameters)

Implements org.bouncycastle.crypto.AsymmetricBlockCipher.init.

initialise the RSA engine.

Parameters
forEncryption:boolean

true if we are encrypting, false otherwise.

parameters:CipherParameters

Doc from org.bouncycastle.crypto.AsymmetricBlockCipher.init.

the key and other data required by the cipher.

initSecureRandomback to summary
protected SecureRandom initSecureRandom(boolean needed, SecureRandom provided)
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.
processInputback to summary
private BigInteger processInput(BigInteger input)