Top Description Methods
org.apache.sshd.common.util.security

public Interface Decryptor

Known Direct Implementers
org.apache.sshd.common.util.security.bouncycastle.BouncyCastleEncryptedPrivateKeyInfoDecryptor
Imports
java.security.GeneralSecurityException

Something that can decrypt encrypted data given a password.
Author
Apache MINA SSHD Project

Method Summary

Modifier and TypeMethod and Description
public byte[]

Returns:

decrypted data, possibly null if decryption failed
decrypt
(byte[]
data to decrypt
encrypted
,
char[]
decryption key
password
)

Decrypts encrypted bytes, using the given password as decryption key.

Method Detail

decryptback to summary
public 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:byte[]

data to decrypt

password:char[]

decryption key

Returns:byte[]

decrypted data, possibly null if decryption failed

Exceptions
GeneralSecurityException:
may be thrown if decryption failed