IApplication Pkcs 7MimeDecrypt Async(Secure Mime Context, Cancellation Token) Method
Asynchronously decrypt the enveloped-data.
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#
Task<MimeEntity> DecryptAsync(
SecureMimeContext ctx,
CancellationToken cancellationToken = default
)Parameters
- ctx SecureMimeContext
- The S/MIME context to use for decrypting.
- cancellationToken CancellationToken (Optional)
- The cancellation token.
Return Value
TaskMimeEntityThe decrypted MimeEntity.
Remarks
Asynchronously decrypts the enveloped-data using the specified SecureMimeContext.
Exceptions
| ArgumentNullException | ctx is . |
| InvalidOperationException | The "smime-type" parameter on the Content-Type header is not "enveloped-data". |
| ObjectDisposedException | The IApplicationPkcs7Mime has been disposed. |
| OperationCanceledException | The operation was canceled via the cancellation token. |
| CmsException | An error occurred in the cryptographic message syntax subsystem. |