Package org.cryptacular.bean
Class BufferedBlockCipherBean
java.lang.Object
org.cryptacular.bean.AbstractCipherBean
org.cryptacular.bean.AbstractBlockCipherBean
org.cryptacular.bean.BufferedBlockCipherBean
- All Implemented Interfaces:
CipherBean
Cipher bean that performs symmetric encryption/decryption using a standard block cipher in a standard mode (e.g. CBC,
OFB) with padding to support processing inputs of arbitrary length.
- Author:
- Middleware Services
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionSpec<org.bouncycastle.crypto.BufferedBlockCipher>protected BufferedBlockCipherAdapternewCipher(CiphertextHeader header, boolean mode) Creates a new cipher adapter instance suitable for the block cipher used by this class.voidsetBlockCipherSpec(Spec<org.bouncycastle.crypto.BufferedBlockCipher> blockCipherSpec) Sets the block cipher specification.Methods inherited from class org.cryptacular.bean.AbstractBlockCipherBean
process, processMethods inherited from class org.cryptacular.bean.AbstractCipherBean
decrypt, decrypt, encrypt, encrypt, getKeyAlias, getKeyStore, getNonce, lookupKey, setKeyAlias, setKeyPassword, setKeyStore, setNonce
-
Constructor Details
-
BufferedBlockCipherBean
public BufferedBlockCipherBean()Creates a new instance. -
BufferedBlockCipherBean
public BufferedBlockCipherBean(Spec<org.bouncycastle.crypto.BufferedBlockCipher> blockCipherSpec, KeyStore keyStore, String keyAlias, String keyPassword, Nonce nonce) Creates a new instance by specifying all properties.- Parameters:
blockCipherSpec- Block cipher specification.keyStore- Key store containing encryption key.keyAlias- Name of encryption key entry in key store.keyPassword- Password used to decrypt key entry in keystore.nonce- Nonce/IV generator.
-
-
Method Details
-
getBlockCipherSpec
- Returns:
- Block cipher specification.
-
setBlockCipherSpec
Sets the block cipher specification.- Parameters:
blockCipherSpec- Describes a block cipher in terms of algorithm, mode, and padding.
-
newCipher
Description copied from class:AbstractBlockCipherBeanCreates a new cipher adapter instance suitable for the block cipher used by this class.- Specified by:
newCipherin classAbstractBlockCipherBean- Parameters:
header- Ciphertext header.mode- True for encryption; false for decryption.- Returns:
- Block cipher adapter that wraps an initialized block cipher that is ready for use in the given mode.
-