Package org.apache.commons.crypto.cipher
Class OpenSslCommonMode
java.lang.Object
org.apache.commons.crypto.cipher.AbstractOpenSslFeedbackCipher
org.apache.commons.crypto.cipher.OpenSslCommonMode
This class do the real work(Encryption/Decryption) for non-authenticated modes, such as CTR, CBC.
It will call the OpenSSL API to implement encryption/decryption
-
Field Summary
Fields inherited from class org.apache.commons.crypto.cipher.AbstractOpenSslFeedbackCipher
algorithmMode, cipherMode, context, padding
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionint
doFinal
(byte[] input, int inputOffset, int inputLen, byte[] output, int outputOffset) int
doFinal
(ByteBuffer input, ByteBuffer output) void
init
(int mode, byte[] key, AlgorithmParameterSpec params) int
update
(byte[] input, int inputOffset, int inputLen, byte[] output, int outputOffset) int
update
(ByteBuffer input, ByteBuffer output) void
updateAAD
(byte[] aad) Methods inherited from class org.apache.commons.crypto.cipher.AbstractOpenSslFeedbackCipher
checkState, clean
-
Constructor Details
-
OpenSslCommonMode
OpenSslCommonMode(long context, int algorithmMode, int padding)
-
-
Method Details
-
doFinal
public int doFinal(byte[] input, int inputOffset, int inputLen, byte[] output, int outputOffset) throws ShortBufferException, IllegalBlockSizeException, BadPaddingException - Specified by:
doFinal
in classAbstractOpenSslFeedbackCipher
- Throws:
ShortBufferException
IllegalBlockSizeException
BadPaddingException
-
doFinal
public int doFinal(ByteBuffer input, ByteBuffer output) throws ShortBufferException, IllegalBlockSizeException, BadPaddingException - Specified by:
doFinal
in classAbstractOpenSslFeedbackCipher
- Throws:
ShortBufferException
IllegalBlockSizeException
BadPaddingException
-
init
public void init(int mode, byte[] key, AlgorithmParameterSpec params) throws InvalidAlgorithmParameterException - Specified by:
init
in classAbstractOpenSslFeedbackCipher
- Throws:
InvalidAlgorithmParameterException
-
update
public int update(byte[] input, int inputOffset, int inputLen, byte[] output, int outputOffset) throws ShortBufferException - Specified by:
update
in classAbstractOpenSslFeedbackCipher
- Throws:
ShortBufferException
-
update
- Specified by:
update
in classAbstractOpenSslFeedbackCipher
- Throws:
ShortBufferException
-
updateAAD
public void updateAAD(byte[] aad) - Specified by:
updateAAD
in classAbstractOpenSslFeedbackCipher
-