Click or drag to resize
MimeKit

OpenPgpContextGetPublicKeysAsync Method

Asynchronously get the public keys for the specified mailbox addresses.

Namespace: MimeKit.Cryptography
Assembly: MimeKit (in MimeKit.dll) Version: 4.7.1
Syntax
C#
public virtual Task<IList<PgpPublicKey>> GetPublicKeysAsync(
	IEnumerable<MailboxAddress> mailboxes,
	CancellationToken cancellationToken = default
)

Parameters

mailboxes  IEnumerableMailboxAddress
The mailboxes.
cancellationToken  CancellationToken  (Optional)
The cancellation token.

Return Value

TaskIListPgpPublicKey
The encryption keys.
Exceptions
ExceptionCondition
ArgumentNullExceptionmailboxes is null.
OperationCanceledException The operation was canceled via the cancellation token.
PublicKeyNotFoundException A public key for one or more of the mailboxes could not be found.
Remarks
Asynchronously gets a list of valid public keys for the specified mailbox addresses that can be used for encryption.
See Also