Table of Contents

Class PrivateKeyAuthenticationMethod

Namespace
Renci.SshNet
Assembly
Renci.SshNet.dll

Provides functionality to perform private key authentication.

public class PrivateKeyAuthenticationMethod : AuthenticationMethod, IDisposable

Inheritance

Implements

Inherited Members

Constructors

PrivateKeyAuthenticationMethod(string, params IPrivateKeySource[])

Initializes a new instance of the Renci.SshNet.PrivateKeyAuthenticationMethod class.

public PrivateKeyAuthenticationMethod(string username, params IPrivateKeySource[] keyFiles)

Parameters

username string

The username.

keyFiles IPrivateKeySource[]

The key files.

Exceptions

ArgumentException

username is whitespace or null.

Properties

KeyFiles

Gets the key files used for authentication.

public ICollection<IPrivateKeySource> KeyFiles { get; }

Property Value

ICollection<IPrivateKeySource>

Name

Gets the name of the authentication method.

public override string Name { get; }

Property Value

string

Methods

Authenticate(Session)

Authenticates the specified session.

public override AuthenticationResult Authenticate(Session session)

Parameters

session Session

The session to authenticate.

Returns

AuthenticationResult

Result of authentication process.

Dispose()

Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.

public void Dispose()

Dispose(bool)

Releases unmanaged and - optionally - managed resources.

protected virtual void Dispose(bool disposing)

Parameters

disposing bool

true to release both managed and unmanaged resources; false to release only unmanaged resources.