public class BufferedBlockCipherAdapter extends Object implements BlockCipherAdapter
BufferedBlockCipher
.Constructor and Description |
---|
BufferedBlockCipherAdapter(org.bouncycastle.crypto.BufferedBlockCipher delegate)
Creates a new instance that delegates to the given cipher.
|
Modifier and Type | Method and Description |
---|---|
int |
doFinal(byte[] out,
int outOff)
Finish the encryption/decryption operation (e.g. apply padding).
|
int |
getOutputSize(int len)
Gets the size of the output buffer required to hold the output of an input buffer of the given size.
|
void |
init(boolean forEncryption,
org.bouncycastle.crypto.CipherParameters params)
Initialize the underlying cipher.
|
int |
processBytes(byte[] in,
int inOff,
int len,
byte[] out,
int outOff)
Process an array of bytes, producing output if necessary.
|
void |
reset()
Reset the cipher.
|
public BufferedBlockCipherAdapter(org.bouncycastle.crypto.BufferedBlockCipher delegate)
delegate
- Adapted cipher.public int getOutputSize(int len)
BlockCipherAdapter
getOutputSize
in interface BlockCipherAdapter
len
- Length of input buffer.public void init(boolean forEncryption, org.bouncycastle.crypto.CipherParameters params) throws CryptoException
CipherAdapter
init
in interface CipherAdapter
forEncryption
- True for encryption mode, false for decryption mode.params
- Cipher initialization parameters.CryptoException
- on underlying cipher initialization errors.public int processBytes(byte[] in, int inOff, int len, byte[] out, int outOff) throws CryptoException
CipherAdapter
processBytes
in interface CipherAdapter
in
- Input data.inOff
- Offset at which the input data starts.len
- The number of bytes in the input data to process.out
- Array to receive any data produced by cipher.outOff
- Offset into output array.CryptoException
- on underlying cipher data handling errors.public int doFinal(byte[] out, int outOff) throws CryptoException
BlockCipherAdapter
doFinal
in interface BlockCipherAdapter
out
- Output buffer to receive final processing output.outOff
- Offset into output buffer where processed data should start.CryptoException
- on underlying cipher finalization errors.public void reset()
CipherAdapter
reset
in interface CipherAdapter
Copyright © 2003-2024 Virginia Tech. All Rights Reserved.