Top Inners Constructors Methods
org.bouncycastle.crypto.general

pack-priv abstract Class GuardedAsymmetricOperatorFactory<T extends Parameters>

extends Object
implements AsymmetricOperatorFactory<T extends Parameters>
Class Inheritance
All Implemented Interfaces
org.bouncycastle.crypto.AsymmetricOperatorFactory
Known Direct Subclasses
org.bouncycastle.crypto.general.RSA.OperatorFactory, org.bouncycastle.crypto.general.ElGamal.OperatorFactory
Imports
java.security.SecureRandom, org.bouncycastle.crypto.AsymmetricKey, .AsymmetricOperatorFactory, .CryptoServicesRegistrar, .Parameters, .PlainInputProcessingException, .SingleBlockEncryptorUsingSecureRandom, org.bouncycastle.crypto.fips.FipsStatus, .FipsUnapprovedOperationError, org.bouncycastle.crypto.internal.AsymmetricBlockCipher, org.bouncycastle.crypto.internal.encodings.OAEPEncoding, .PKCS1Encoding

Nested and Inner Type Summary

Modifier and TypeClass and Description
private class

Constructor Summary

AccessConstructor and Description
pack-priv

Method Summary

Modifier and TypeMethod and Description
public SingleBlockEncryptorUsingSecureRandom<T>
createBlockEncryptor(final AsymmetricKey
the key to be used in the encryptor.
key
,
final T
the parameter set for the encryptor.
parameters
)

Implements org.bouncycastle.crypto.AsymmetricOperatorFactory.createBlockEncryptor.

Create a block encryptor for the passed in key and parameter set.
protected abstract AsymmetricBlockCipher
createCipher(boolean forEncryption, AsymmetricKey key, T parameters, SecureRandom random)

protected static boolean
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Constructor Detail

GuardedAsymmetricOperatorFactoryback to summary
pack-priv GuardedAsymmetricOperatorFactory()

Method Detail

createBlockEncryptorback to summary
public SingleBlockEncryptorUsingSecureRandom<T> createBlockEncryptor(final AsymmetricKey key, final T parameters)

Implements org.bouncycastle.crypto.AsymmetricOperatorFactory.createBlockEncryptor.

Doc from org.bouncycastle.crypto.AsymmetricOperatorFactory.createBlockEncryptor.

Create a block encryptor for the passed in key and parameter set.

Parameters
key:AsymmetricKey

the key to be used in the encryptor.

parameters:T

the parameter set for the encryptor.

Returns:SingleBlockEncryptorUsingSecureRandom<T>

an initialised block encryptor for the passed in arguments.

createCipherback to summary
protected abstract AsymmetricBlockCipher createCipher(boolean forEncryption, AsymmetricKey key, T parameters, SecureRandom random)
isRawEngineback to summary
protected static boolean isRawEngine(AsymmetricBlockCipher engine)
org.bouncycastle.crypto.general back to summary

private Class GuardedAsymmetricOperatorFactory.BlockEncryptor

extends Object
implements SingleBlockEncryptorUsingSecureRandom<T extends Parameters>
Class Inheritance
  • java.lang.Object
  • org.bouncycastle.crypto.general.GuardedAsymmetricOperatorFactory.BlockEncryptor
All Implemented Interfaces
org.bouncycastle.crypto.SingleBlockEncryptorUsingSecureRandom, org.bouncycastle.crypto.OperatorUsingSecureRandom, org.bouncycastle.crypto.SingleBlockEncryptor, org.bouncycastle.crypto.SingleBlockCipher

Field Summary

Modifier and TypeField and Description
private AsymmetricBlockCipher
private final AsymmetricKey
private final T
private final SecureRandom

Constructor Summary

AccessConstructor and Description
pack-priv
BlockEncryptor(AsymmetricKey key, T parameters, SecureRandom random)

Method Summary

Modifier and TypeMethod and Description
public byte[]
encryptBlock(byte[]
array holding the data to be encrypted.
bytes
,
int
offset into bytes where the data starts.
offSet
,
int
the number of bytes of data in the bytes array.
length
)

Implements org.bouncycastle.crypto.SingleBlockEncryptor.encryptBlock.

Encrypt a single block of data, returning the result.
private AsymmetricBlockCipher
public int
getInputSize()

Implements org.bouncycastle.crypto.SingleBlockCipher.getInputSize.

Return the maximum size of input this cipher can consume.
public int
getOutputSize()

Implements org.bouncycastle.crypto.SingleBlockCipher.getOutputSize.

Return the size of the output this cipher will produce.
public T
getParameters()

Implements org.bouncycastle.crypto.SingleBlockCipher.getParameters.

Return the parameters for this single block cipher.
public SingleBlockEncryptorUsingSecureRandom<T>
withSecureRandom(SecureRandom
the SecureRandom to use.
random
)

Implements org.bouncycastle.crypto.SingleBlockEncryptorUsingSecureRandom.withSecureRandom.

Return a variant of this encryptor using the passed in random as its source of randomness.
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

engineback to summary
private AsymmetricBlockCipher engine
keyback to summary
private final AsymmetricKey key
parametersback to summary
private final T parameters
randomback to summary
private final SecureRandom random

Constructor Detail

BlockEncryptorback to summary
pack-priv BlockEncryptor(AsymmetricKey key, T parameters, SecureRandom random)

Method Detail

encryptBlockback to summary
public byte[] encryptBlock(byte[] bytes, int offSet, int length) throws PlainInputProcessingException

Implements org.bouncycastle.crypto.SingleBlockEncryptor.encryptBlock.

Doc from org.bouncycastle.crypto.SingleBlockEncryptor.encryptBlock.

Encrypt a single block of data, returning the result.

Parameters
bytes:byte[]

array holding the data to be encrypted.

offSet:int

offset into bytes where the data starts.

length:int

the number of bytes of data in the bytes array.

Returns:byte[]

a byte array holding the encrypted result.

Exceptions
PlainInputProcessingException:
if there is an issue processing the input provided.
getEngineback to summary
private AsymmetricBlockCipher getEngine()
getInputSizeback to summary
public int getInputSize()

Implements org.bouncycastle.crypto.SingleBlockCipher.getInputSize.

Doc from org.bouncycastle.crypto.SingleBlockCipher.getInputSize.

Return the maximum size of input this cipher can consume.

Returns:int

maximum size of input in bytes.

getOutputSizeback to summary
public int getOutputSize()

Implements org.bouncycastle.crypto.SingleBlockCipher.getOutputSize.

Doc from org.bouncycastle.crypto.SingleBlockCipher.getOutputSize.

Return the size of the output this cipher will produce.

Returns:int

size of the output block produced in bytes.

getParametersback to summary
public T getParameters()

Implements org.bouncycastle.crypto.SingleBlockCipher.getParameters.

Doc from org.bouncycastle.crypto.SingleBlockCipher.getParameters.

Return the parameters for this single block cipher.

Returns:T

the cipher's parameters.

withSecureRandomback to summary
public SingleBlockEncryptorUsingSecureRandom<T> withSecureRandom(SecureRandom random)

Implements org.bouncycastle.crypto.SingleBlockEncryptorUsingSecureRandom.withSecureRandom.

Doc from org.bouncycastle.crypto.SingleBlockEncryptorUsingSecureRandom.withSecureRandom.

Return a variant of this encryptor using the passed in random as its source of randomness.

Parameters
random:SecureRandom

the SecureRandom to use.

Returns:SingleBlockEncryptorUsingSecureRandom<T>

a new encryptor which will use random where random data is required.