Windows Secure Mime ContextCan Encrypt Method
Check whether the cryptography context can encrypt to a particular recipient.
Definition
Namespace: MimeKit.Cryptography
Assembly: MimeKit.Cryptography (in MimeKit.Cryptography.dll) Version: 5.0.0
if the cryptography context can be used to encrypt to the designated recipient; otherwise, .
Assembly: MimeKit.Cryptography (in MimeKit.Cryptography.dll) Version: 5.0.0
C#
public override bool CanEncrypt(
MailboxAddress mailbox,
CancellationToken cancellationToken = default
)Parameters
- mailbox MailboxAddress
- The recipient's mailbox address.
- cancellationToken CancellationToken (Optional)
- The cancellation token.
Return Value
Booleanif the cryptography context can be used to encrypt to the designated recipient; otherwise, .
Implements
ICryptographyContextCanEncrypt(MailboxAddress, CancellationToken)Remarks
Checks whether the cryptography context can be used to encrypt to a particular recipient.
Exceptions
| ArgumentNullException | mailbox is . |
| OperationCanceledException | The operation was canceled via the cancellation token. |