Table of Contents

Struct PrivateKeyCredential.Key

Namespace
Tmds.Ssh
Assembly
Tmds.Ssh.dll

Represents a private key.

protected readonly struct PrivateKeyCredential.Key : IDisposable
Implements
Inherited Members

Constructors

Key(ReadOnlyMemory<char>, Func<string?>, bool)

Creates a key from raw key data with password prompt.

public Key(ReadOnlyMemory<char> rawKey, Func<string?> passwordPrompt, bool queryKey = true)

Parameters

rawKey ReadOnlyMemory<char>

Raw private key data.

passwordPrompt Func<string>

Callback to prompt for password.

queryKey bool

Whether to check if the server knows the key before prompting for a decryption password.

Key(ReadOnlyMemory<char>, string?)

Creates a key from raw key data with password.

public Key(ReadOnlyMemory<char> rawKey, string? password = null)

Parameters

rawKey ReadOnlyMemory<char>

Raw private key data.

password string

Password for decrypting the key.

Key(ECDsa)

Creates a key from an ECDSA instance.

public Key(ECDsa ecdsa)

Parameters

ecdsa ECDsa

The ECDsa private key.

Key(RSA)

Creates a key from an RSA instance.

public Key(RSA rsa)

Parameters

rsa RSA

The RSA private key.

Methods

Dispose()

Disposes the private key.

public void Dispose()