Click or drag to resize
MimeKit

CryptographyContextCanEncrypt Method

Check whether or not the cryptography context can encrypt to a particular recipient.

Namespace:  MimeKit.Cryptography
Assembly:  MimeKit (in MimeKit.dll) Version: 3.0.0
Syntax
C#
public abstract bool CanEncrypt(
	MailboxAddress mailbox,
	CancellationToken cancellationToken = default
)

Parameters

mailbox
Type: MimeKitMailboxAddress
The recipient's mailbox address.
cancellationToken (Optional)
Type: System.ThreadingCancellationToken
The cancellation token.

Return Value

Type: Boolean
true if the cryptography context can be used to encrypt to the designated recipient; otherwise, false.
Exceptions
ExceptionCondition
ArgumentNullExceptionmailbox is null.
OperationCanceledException The operation was canceled via the cancellation token.
Remarks
Checks whether or not the cryptography context can be used to encrypt to a particular recipient.
See Also