Interface Cipher

    • Method Detail

      • init

        void init​(Cipher.Mode mode,
                  byte[] key,
                  byte[] iv)
           throws java.lang.Exception
        Initialize the cipher for encryption or decryption with the given key and initialization vector
        Parameters:
        mode - Encrypt/Decrypt initialization
        key - Key bytes
        iv - Initialization vector bytes
        Throws:
        java.lang.Exception - If failed to initialize
      • update

        default void update​(byte[] input)
                     throws java.lang.Exception
        Performs in-place encryption or decryption on the given data.
        Parameters:
        input - The input/output bytes
        Throws:
        java.lang.Exception - If failed to execute
        See Also:
        update(byte[], int, int)
      • update

        void update​(byte[] input,
                    int inputOffset,
                    int inputLen)
             throws java.lang.Exception
        Performs in-place encryption or decryption on the given data.
        Parameters:
        input - The input/output bytes
        inputOffset - The offset of the data in the data buffer
        inputLen - The number of bytes to update - starting at the given offset
        Throws:
        java.lang.Exception - If failed to execute
      • checkSupported

        static boolean checkSupported​(java.lang.String xform,
                                      int keyLength)
        Parameters:
        xform - The full cipher transformation - e.g., AES/CBC/NoPadding - never null/empty
        keyLength - The required key length in bits - always positive
        Returns:
        true if the cipher transformation and required key length are supported
        See Also:
        Cipher.getMaxAllowedKeyLength(String)