Click or drag to resize
MimeKit

OpenPgpContextGetSecretKeyAsync Method

Asynchronously get the secret key for a specified key identifier.

Namespace: MimeKit.Cryptography
Assembly: MimeKit (in MimeKit.dll) Version: 4.3.0
Syntax
C#
protected virtual Task<PgpSecretKey> GetSecretKeyAsync(
	long keyId,
	CancellationToken cancellationToken
)

Parameters

keyId  Int64
The key identifier for the desired secret key.
cancellationToken  CancellationToken
The cancellation token.

Return Value

TaskPgpSecretKey
The secret key.
Exceptions
ExceptionCondition
OperationCanceledException The operation was canceled via the cancellation token.
PrivateKeyNotFoundException The secret key specified by the keyId could not be found.
Remarks
Asynchronously gets the secret key for a specified key identifier.
See Also