Interface Decryptor

All Known Implementing Classes:
BouncyCastleEncryptedPrivateKeyInfoDecryptor

public interface Decryptor
Something that can decrypt encrypted data given a password.
  • Method Summary

    Modifier and Type
    Method
    Description
    byte[]
    decrypt(byte[] encrypted, char[] password)
    Decrypts encrypted bytes, using the given password as decryption key.
  • Method Details

    • decrypt

      byte[] decrypt(byte[] encrypted, char[] password) throws 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:
      GeneralSecurityException - may be thrown if decryption failed