Class Decryptor
java.lang.Object
org.mozilla.jss.SecretDecoderRing.Decryptor
Decrypts data with the SecretDecoderRing.
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionDecryptor
(CryptoToken token) Creates a Decryptor for use with the given CryptoToken. -
Method Summary
Modifier and TypeMethodDescriptionbyte[]
decrypt
(byte[] ciphertext) Decrypts the given ciphertext.
-
Field Details
-
token
-
keyManager
-
-
Constructor Details
-
Decryptor
Creates a Decryptor for use with the given CryptoToken.
-
-
Method Details
-
decrypt
public byte[] decrypt(byte[] ciphertext) throws NotInitializedException, GeneralSecurityException, TokenException Decrypts the given ciphertext. It must have been created previously with the SecretDecoderRing, either the JSS version or the NSS version. The key used for decryption must exist on the token that was passed into the constructor. The token will be searched for a key whose keyID matches the keyID in the encoded SecretDecoderRing result.- Parameters:
ciphertext
- A DER-encoded Encoding object, created from a previous call to Encryptor.encrypt(), or with the NSS SecretDecoderRing.- Returns:
- The decrypted plaintext.
- Throws:
InvalidKeyException
- If no key can be found with the matching keyID.NotInitializedException
GeneralSecurityException
TokenException
-