GnuPGContextGetSecretKey Method

Get the secret key for a specified key identifier.

Definition

Namespace: MimeKit.Cryptography
Assembly: MimeKit.Cryptography (in MimeKit.Cryptography.dll) Version: 5.0.0
C#
protected override PgpSecretKey GetSecretKey(
	long keyId,
	CancellationToken cancellationToken
)

Parameters

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

Return Value

PgpSecretKey
The secret key.

Remarks

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.

See Also