Table of Contents

Class PasswordAuthenticationMethod

Namespace
Renci.SshNet
Assembly
Renci.SshNet.dll

Provides functionality to perform password authentication.

public class PasswordAuthenticationMethod : AuthenticationMethod, IDisposable

Inheritance

Implements

Inherited Members

Constructors

PasswordAuthenticationMethod(string, string)

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

public PasswordAuthenticationMethod(string username, string password)

Parameters

username string

The username.

password string

The password.

Exceptions

ArgumentException

username is whitespace or null.

ArgumentException

password is null.

PasswordAuthenticationMethod(string, byte[])

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

public PasswordAuthenticationMethod(string username, byte[] password)

Parameters

username string

The username.

password byte[]

The password.

Exceptions

ArgumentException

username is whitespace or null.

ArgumentException

password is null.

Properties

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.

Exceptions

ArgumentNullException

session is null.

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.

~PasswordAuthenticationMethod()

Finalizes an instance of the Renci.SshNet.PasswordAuthenticationMethod class.

protected ~PasswordAuthenticationMethod()

PasswordExpired

Occurs when user's password has expired and needs to be changed.

public event EventHandler<AuthenticationPasswordChangeEventArgs> PasswordExpired

Event Type

EventHandler<AuthenticationPasswordChangeEventArgs>