Package org.apache.commons.crypto.cipher
Class OpenSslCommonMode
- java.lang.Object
-
- org.apache.commons.crypto.cipher.AbstractOpenSslFeedbackCipher
-
- org.apache.commons.crypto.cipher.OpenSslCommonMode
-
final class OpenSslCommonMode extends AbstractOpenSslFeedbackCipher
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 Constructor Description OpenSslCommonMode(long context, int algorithmMode, int padding)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description int
doFinal(byte[] input, int inputOffset, int inputLen, byte[] output, int outputOffset)
int
doFinal(java.nio.ByteBuffer input, java.nio.ByteBuffer output)
void
init(int mode, byte[] key, java.security.spec.AlgorithmParameterSpec params)
int
update(byte[] input, int inputOffset, int inputLen, byte[] output, int outputOffset)
int
update(java.nio.ByteBuffer input, java.nio.ByteBuffer output)
void
updateAAD(byte[] aad)
-
Methods inherited from class org.apache.commons.crypto.cipher.AbstractOpenSslFeedbackCipher
checkState, clean
-
-
-
-
Method Detail
-
doFinal
public int doFinal(byte[] input, int inputOffset, int inputLen, byte[] output, int outputOffset) throws javax.crypto.ShortBufferException, javax.crypto.IllegalBlockSizeException, javax.crypto.BadPaddingException
- Specified by:
doFinal
in classAbstractOpenSslFeedbackCipher
- Throws:
javax.crypto.ShortBufferException
javax.crypto.IllegalBlockSizeException
javax.crypto.BadPaddingException
-
doFinal
public int doFinal(java.nio.ByteBuffer input, java.nio.ByteBuffer output) throws javax.crypto.ShortBufferException, javax.crypto.IllegalBlockSizeException, javax.crypto.BadPaddingException
- Specified by:
doFinal
in classAbstractOpenSslFeedbackCipher
- Throws:
javax.crypto.ShortBufferException
javax.crypto.IllegalBlockSizeException
javax.crypto.BadPaddingException
-
init
public void init(int mode, byte[] key, java.security.spec.AlgorithmParameterSpec params) throws java.security.InvalidAlgorithmParameterException
- Specified by:
init
in classAbstractOpenSslFeedbackCipher
- Throws:
java.security.InvalidAlgorithmParameterException
-
update
public int update(byte[] input, int inputOffset, int inputLen, byte[] output, int outputOffset) throws javax.crypto.ShortBufferException
- Specified by:
update
in classAbstractOpenSslFeedbackCipher
- Throws:
javax.crypto.ShortBufferException
-
update
public int update(java.nio.ByteBuffer input, java.nio.ByteBuffer output) throws javax.crypto.ShortBufferException
- Specified by:
update
in classAbstractOpenSslFeedbackCipher
- Throws:
javax.crypto.ShortBufferException
-
updateAAD
public void updateAAD(byte[] aad)
- Specified by:
updateAAD
in classAbstractOpenSslFeedbackCipher
-
-