CryptoContext.decrypt

Decrypts the ciphertext input stream and writes the resulting cleartext to the output stream.

When non-null, session_key should be a null-terminated string, such as the one returned by gmime.decrypt_result.DecryptResult.getSessionKey from a previous decryption. If the session_key is not valid, decryption will fail.

If the encrypted input stream was also signed, the returned #GMimeDecryptResult will have a non-null list of signatures, each with a #GMimeSignatureStatus (among other details about each signature).

On success, the returned #GMimeDecryptResult will contain a list of certificates, one for each recipient, that the original encrypted stream was encrypted to.

Note: It *may* be possible to maliciously design an encrypted stream such that recursively decrypting it will result in an endless loop, causing a denial of service attack on your application.

Parameters

flags gmime.types.DecryptFlags

a set of #GMimeDecryptFlags

sessionKey string

the session key to use or null

istream gmime.stream.Stream

input/ciphertext stream

ostream gmime.stream.Stream

output/cleartext stream

Return Value

Type: gmime.decrypt_result.DecryptResult

a #GMimeDecryptResult on success or null on error.

Throws