Click or drag to resize
MimeKit

OpenPgpContextGetPublicKeyRingAsync Method

Asynchronously get the public keyring that contains the specified key asynchronously.

Namespace: MimeKit.Cryptography
Assembly: MimeKit (in MimeKit.dll) Version: 4.7.1
Syntax
C#
protected abstract Task<PgpPublicKeyRing> GetPublicKeyRingAsync(
	long keyId,
	CancellationToken cancellationToken
)

Parameters

keyId  Int64
The public key identifier.
cancellationToken  CancellationToken
The cancellation token.

Return Value

TaskPgpPublicKeyRing
The public keyring that contains the specified key or null if the keyring could not be found.
Exceptions
ExceptionCondition
OperationCanceledException The operation was canceled via the cancellation token.
Remarks

Asynchronously gets the public keyring that contains the specified key.

Note  Note
Implementations should first try to obtain the keyring stored (or cached) locally. Failing that, if AutoKeyRetrieve is enabled, they should use RetrievePublicKeyRingAsync(Int64, CancellationToken) to attempt to retrieve the keyring from the configured KeyServer.
See Also