Open Pgp ContextDecrypt(Stream, Digital Signature Collection, Cancellation Token) Method
Decrypt the specified encryptedData and extracts the digital signers if the content was also signed.
Definition
Namespace: MimeKit.Cryptography
Assembly: MimeKit.Cryptography (in MimeKit.Cryptography.dll) Version: 5.0.0
The decrypted MimeEntity.
Assembly: MimeKit.Cryptography (in MimeKit.Cryptography.dll) Version: 5.0.0
C#
public MimeEntity Decrypt(
Stream encryptedData,
out DigitalSignatureCollection?? signatures,
CancellationToken cancellationToken = default
)Parameters
- encryptedData Stream
- The encrypted data.
- signatures DigitalSignatureCollection
- A list of digital signatures if the data was both signed and encrypted.
- cancellationToken CancellationToken (Optional)
- The cancellation token.
Return Value
MimeEntityThe decrypted MimeEntity.
Remarks
Decrypts the specified encryptedData and extracts the digital signers if the content was also signed.
Exceptions
| ArgumentNullException | encryptedData is . |
| PrivateKeyNotFoundException | The private key could not be found to decrypt the stream. |
| OperationCanceledException |
The user chose to cancel the password prompt. -or- The operation was canceled via the cancellation token. |
| UnauthorizedAccessException | 3 bad attempts were made to unlock the secret key. |
| PgpException | An OpenPGP error occurred. |