public class JceBlockCipherWithCBCImplicitIVImpl extends java.lang.Object implements TlsBlockCipherImpl
Constructor and Description |
---|
JceBlockCipherWithCBCImplicitIVImpl(JcaTlsCrypto crypto,
javax.crypto.Cipher cipher,
java.lang.String algorithm,
boolean isEncrypting) |
Modifier and Type | Method and Description |
---|---|
int |
doFinal(byte[] input,
int inputOffset,
int inputLength,
byte[] output,
int outputOffset)
Perform the cipher encryption/decryption returning the output in output.
|
int |
getBlockSize()
Return the blocksize (in bytes) of the underlying block cipher.
|
void |
init(byte[] iv,
int ivOff,
int ivLen)
Initialise the parameters for operator.
|
void |
setKey(byte[] key,
int keyOff,
int keyLen)
Set the key to be used by the block cipher implementation supporting this service.
|
public JceBlockCipherWithCBCImplicitIVImpl(JcaTlsCrypto crypto, javax.crypto.Cipher cipher, java.lang.String algorithm, boolean isEncrypting) throws java.security.GeneralSecurityException
java.security.GeneralSecurityException
public void setKey(byte[] key, int keyOff, int keyLen)
TlsBlockCipherImpl
setKey
in interface TlsBlockCipherImpl
key
- array holding the block cipher key.keyOff
- offset into the array the key starts at.keyLen
- length of the key in the array.public void init(byte[] iv, int ivOff, int ivLen)
TlsBlockCipherImpl
init
in interface TlsBlockCipherImpl
iv
- array holding the initialization vector (IV).ivOff
- offset into the array the IV starts at.ivLen
- length of the IV in the array.public int doFinal(byte[] input, int inputOffset, int inputLength, byte[] output, int outputOffset)
TlsBlockCipherImpl
Note: we have to use doFinal() here as it is the only way to guarantee output from the underlying cipher.
doFinal
in interface TlsBlockCipherImpl
input
- array holding input data to the cipher.inputOffset
- offset into input array data starts at.inputLength
- length of the input data in the array.output
- array to hold the cipher output.outputOffset
- offset into output array to start saving output.public int getBlockSize()
TlsBlockCipherImpl
getBlockSize
in interface TlsBlockCipherImpl