public final class Decrypter extends Object implements Serializable
Constructor and Description |
---|
Decrypter(PrivateKey key)
Create a new instance of Decrypter
|
Modifier and Type | Method and Description |
---|---|
CredData |
decrypt()
Decrypt the stored credential with this object private key.
|
Credentials |
getCredentials() |
void |
setCredentials(Credentials cred)
Set the credentials to be decrypted.
|
public Decrypter(PrivateKey key)
key
- the private key that will be used for decryptionpublic void setCredentials(Credentials cred)
decrypt()
will clear the key and credentials.cred
- the credentials to be decrypted.public CredData decrypt() throws IllegalAccessException, KeyException
IllegalAccessException
- if the key is null or have already been used to decrypt a credential
or if no credentials has been provided before this call.KeyException
- decryption failure, malformed datapublic Credentials getCredentials()