Interface SpillCipher

    • Method Summary

      All Methods Instance Methods Abstract Methods 
      Modifier and Type Method Description
      void close()
      Destroys the cipher, preventing future use.
      int decrypt​(byte[] encryptedData, int inputOffset, int length, byte[] destination, int destinationOffset)
      Decrypts the contents of the input buffer into the destination buffer, returning the number of bytes written into the destination buffer
      int decryptedMaxLength​(int encryptedLength)
      Calculates the required buffer size to decrypt data with the given encrypted length
      int encrypt​(byte[] data, int inputOffset, int length, byte[] destination, int destinationOffset)
      Encrypts the contents of the input buffer into the destination buffer returning the number of bytes written into the destination buffer
      int encryptedMaxLength​(int inputLength)
      Calculates the maximum required buffer size to encrypt input data with the given length
    • Method Detail

      • encryptedMaxLength

        int encryptedMaxLength​(int inputLength)
        Calculates the maximum required buffer size to encrypt input data with the given length
      • encrypt

        int encrypt​(byte[] data,
                    int inputOffset,
                    int length,
                    byte[] destination,
                    int destinationOffset)
        Encrypts the contents of the input buffer into the destination buffer returning the number of bytes written into the destination buffer
        Returns:
        The length of the encrypted content in the destination buffer
      • decryptedMaxLength

        int decryptedMaxLength​(int encryptedLength)
        Calculates the required buffer size to decrypt data with the given encrypted length
      • decrypt

        int decrypt​(byte[] encryptedData,
                    int inputOffset,
                    int length,
                    byte[] destination,
                    int destinationOffset)
        Decrypts the contents of the input buffer into the destination buffer, returning the number of bytes written into the destination buffer
        Returns:
        The length of the decrypted content in destination buffer
      • close

        void close()
        Destroys the cipher, preventing future use. Implementations should allow this to be called multiple times without failing.
        Specified by:
        close in interface AutoCloseable