Click or drag to resize
MimeKit

ApplicationPkcs7MimeDecrypt Method (SecureMimeContext, CancellationToken)

Decrypt the enveloped-data.

Namespace:  MimeKit.Cryptography
Assembly:  MimeKit (in MimeKit.dll) Version: 2.14.0
Syntax
C#
public MimeEntity Decrypt(
	SecureMimeContext ctx,
	CancellationToken cancellationToken = default
)

Parameters

ctx
Type: MimeKit.CryptographySecureMimeContext
The S/MIME context to use for decrypting.
cancellationToken (Optional)
Type: System.ThreadingCancellationToken
The cancellation token.

Return Value

Type: MimeEntity
The decrypted MimeEntity.
Exceptions
ExceptionCondition
ArgumentNullExceptionctx is null.
InvalidOperationException The "smime-type" parameter on the Content-Type header is not "enveloped-data".
OperationCanceledException The operation was cancelled via the cancellation token.
CmsException An error occurred in the cryptographic message syntax subsystem.
Remarks
Decrypts the enveloped-data using the specified SecureMimeContext.
See Also