Interface Decryptor

    • Method Summary

      All Methods Instance Methods Abstract Methods 
      Modifier and Type Method Description
      byte[] decrypt​(byte[] encrypted, char[] password)
      Decrypts encrypted bytes, using the given password as decryption key.
    • Method Detail

      • decrypt

        byte[] decrypt​(byte[] encrypted,
                       char[] password)
                throws java.security.GeneralSecurityException
        Decrypts encrypted bytes, using the given password as decryption key.

        The encrypted data must contain enough information about the encryption algorithm used so that it can be decrypted at all.

        If the password is wrong, the method may return wrongly decrypted data. If decryption fails, it may return null or throw a GeneralSecurityException.

        The caller is responsible for eventually clearing the password and the decrypted data returned.

        Parameters:
        encrypted - data to decrypt
        password - decryption key
        Returns:
        decrypted data, possibly null if decryption failed
        Throws:
        java.security.GeneralSecurityException - may be thrown if decryption failed