public class AEADBlockCipherBean extends AbstractBlockCipherBean
Modifier and Type | Field and Description |
---|---|
static int |
MAC_SIZE_BITS
Mac size in bits.
|
Constructor and Description |
---|
AEADBlockCipherBean()
Creates a new instance.
|
AEADBlockCipherBean(Spec<org.bouncycastle.crypto.modes.AEADBlockCipher> blockCipherSpec,
KeyStore keyStore,
String keyAlias,
String keyPassword,
Nonce nonce)
Creates a new instance by specifying all properties.
|
Modifier and Type | Method and Description |
---|---|
void |
decrypt(InputStream input,
OutputStream output)
Decrypts the data from the input stream onto the output stream using a symmetric cipher.
|
void |
encrypt(InputStream input,
OutputStream output)
Encrypts the data from the input stream onto the output stream using a symmetric cipher.
|
Spec<org.bouncycastle.crypto.modes.AEADBlockCipher> |
getBlockCipherSpec() |
protected AEADBlockCipherAdapter |
newCipher(CiphertextHeader header,
boolean mode)
Creates a new cipher adapter instance suitable for the block cipher used by this class.
|
void |
setBlockCipherSpec(Spec<org.bouncycastle.crypto.modes.AEADBlockCipher> blockCipherSpec)
Sets the AEAD block cipher specification.
|
process, process
decrypt, encrypt, getKeyAlias, getKeyStore, getNonce, lookupKey, setKeyAlias, setKeyPassword, setKeyStore, setNonce
public static final int MAC_SIZE_BITS
public AEADBlockCipherBean()
public AEADBlockCipherBean(Spec<org.bouncycastle.crypto.modes.AEADBlockCipher> blockCipherSpec, KeyStore keyStore, String keyAlias, String keyPassword, Nonce nonce)
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.public Spec<org.bouncycastle.crypto.modes.AEADBlockCipher> getBlockCipherSpec()
public void setBlockCipherSpec(Spec<org.bouncycastle.crypto.modes.AEADBlockCipher> blockCipherSpec)
blockCipherSpec
- Describes a block cipher in terms of algorithm, mode, and padding.public void encrypt(InputStream input, OutputStream output)
CipherBean
The caller is responsible for providing and managing the streams (e.g. closing them when finished).
encrypt
in interface CipherBean
encrypt
in class AbstractCipherBean
input
- Input stream containing plaintext data to encrypt.output
- Output stream containing ciphertext produced by cipher in encryption mode.public void decrypt(InputStream input, OutputStream output)
CipherBean
The caller is responsible for providing and managing the streams (e.g. closing them when finished).
decrypt
in interface CipherBean
decrypt
in class AbstractCipherBean
input
- Input stream containing ciphertext data to decrypt.output
- Output stream containing plaintext produced by cipher in decryption mode.protected AEADBlockCipherAdapter newCipher(CiphertextHeader header, boolean mode)
AbstractBlockCipherBean
newCipher
in class AbstractBlockCipherBean
header
- Ciphertext header.mode
- True for encryption; false for decryption.Copyright © 2003-2024 Virginia Tech. All Rights Reserved.