Open Pgp ContextGet Secret Key Async Method
Asynchronously get the secret key for a specified key identifier.
Definition
Namespace: MimeKit.Cryptography
Assembly: MimeKit.Cryptography (in MimeKit.Cryptography.dll) Version: 5.0.0
The secret key.
Assembly: MimeKit.Cryptography (in MimeKit.Cryptography.dll) Version: 5.0.0
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
TaskPgpSecretKeyThe secret key.
Remarks
Asynchronously gets the secret key for a specified key identifier.
Exceptions
| OperationCanceledException | The operation was canceled via the cancellation token. |
| PrivateKeyNotFoundException | The secret key specified by the keyId could not be found. |