Interface Decryptor
-
- All Known Implementing Classes:
BouncyCastleEncryptedPrivateKeyInfoDecryptor
public interface DecryptorSomething that can decrypt encrypted data given a password.- Author:
- Apache MINA SSHD Project
-
-
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 GeneralSecurityExceptionDecrypts 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
nullor throw aGeneralSecurityException.The caller is responsible for eventually clearing the
passwordand the decrypted data returned.- Parameters:
encrypted- data to decryptpassword- decryption key- Returns:
- decrypted data, possibly
nullif decryption failed - Throws:
GeneralSecurityException- may be thrown if decryption failed
-
-