Class 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

    • 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 java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • OpenSslCommonMode

        OpenSslCommonMode​(long context,
                          int algorithmMode,
                          int padding)
    • 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 class AbstractOpenSslFeedbackCipher
        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 class AbstractOpenSslFeedbackCipher
        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 class AbstractOpenSslFeedbackCipher
        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 class AbstractOpenSslFeedbackCipher
        Throws:
        javax.crypto.ShortBufferException
      • update

        public int update​(java.nio.ByteBuffer input,
                          java.nio.ByteBuffer output)
                   throws javax.crypto.ShortBufferException
        Specified by:
        update in class AbstractOpenSslFeedbackCipher
        Throws:
        javax.crypto.ShortBufferException