Decrypt the ciphertext using the given view key. @param {ViewKey} viewKey The view key of the account that encrypted the ciphertext. @param {Group} nonce The nonce used to encrypt the ciphertext. @returns {Plaintext} The decrypted plaintext.
(&self, view_key: ViewKey, nonce: Group)
| 52 | /// |
| 53 | /// @returns {Plaintext} The decrypted plaintext. |
| 54 | pub fn decrypt(&self, view_key: ViewKey, nonce: Group) -> Result<Plaintext, String> { |
| 55 | Ok(Plaintext::from(self.0.decrypt(*view_key, *nonce).map_err(|e| e.to_string())?)) |
| 56 | } |
| 57 | |
| 58 | /// Decrypt a ciphertext using the view key of the transition signer, transition public key, and |
| 59 | /// (program, function, index) tuple. |