OpenPgpContextGetPublicKeys Method

Get the public keys for the specified mailbox addresses.

Definition

Namespace: MimeKit.Cryptography
Assembly: MimeKit.Cryptography (in MimeKit.Cryptography.dll) Version: 5.0.0
C#
public abstract IList<PgpPublicKey> GetPublicKeys(
	IEnumerable<MailboxAddress> mailboxes,
	CancellationToken cancellationToken = default
)

Parameters

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

Return Value

IListPgpPublicKey
The encryption keys.

Remarks

Gets a list of valid public keys for the specified mailbox addresses that can be used for encryption.

Exceptions

ArgumentNullException mailboxes is .
OperationCanceledException The operation was canceled via the cancellation token.
PublicKeyNotFoundException A public key for one or more of the mailboxes could not be found.

See Also