Interface Decryptor
- All Known Implementing Classes:
BouncyCastleEncryptedPrivateKeyInfoDecryptor
public interface Decryptor
Something that can decrypt encrypted data given a password.
-
Method Summary
Modifier and TypeMethodDescriptionbyte[]
decrypt
(byte[] encrypted, char[] password) Decrypts encrypted bytes, using the given password as decryption key.
-
Method Details
-
decrypt
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 aGeneralSecurityException
.The caller is responsible for eventually clearing the
password
and the decrypted data returned.- Parameters:
encrypted
- data to decryptpassword
- decryption key- Returns:
- decrypted data, possibly
null
if decryption failed - Throws:
GeneralSecurityException
- may be thrown if decryption failed
-