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 TypeMethodDescriptionintdoFinal(byte[] input, int inputOffset, int inputLen, byte[] output, int outputOffset) intdoFinal(ByteBuffer input, ByteBuffer output) voidinit(int mode, byte[] key, AlgorithmParameterSpec params) intupdate(byte[] input, int inputOffset, int inputLen, byte[] output, int outputOffset) intupdate(ByteBuffer input, ByteBuffer output) voidupdateAAD(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:
doFinalin classAbstractOpenSslFeedbackCipher- Throws:
ShortBufferExceptionIllegalBlockSizeExceptionBadPaddingException
-
doFinal
public int doFinal(ByteBuffer input, ByteBuffer output) throws ShortBufferException, IllegalBlockSizeException, BadPaddingException - Specified by:
doFinalin classAbstractOpenSslFeedbackCipher- Throws:
ShortBufferExceptionIllegalBlockSizeExceptionBadPaddingException
-
init
public void init(int mode, byte[] key, AlgorithmParameterSpec params) throws InvalidAlgorithmParameterException - Specified by:
initin classAbstractOpenSslFeedbackCipher- Throws:
InvalidAlgorithmParameterException
-
update
public int update(byte[] input, int inputOffset, int inputLen, byte[] output, int outputOffset) throws ShortBufferException - Specified by:
updatein classAbstractOpenSslFeedbackCipher- Throws:
ShortBufferException
-
update
- Specified by:
updatein classAbstractOpenSslFeedbackCipher- Throws:
ShortBufferException
-
updateAAD
public void updateAAD(byte[] aad) - Specified by:
updateAADin classAbstractOpenSslFeedbackCipher
-