Class PrivateKeyAuthenticationMethod
- Namespace
- Renci.SshNet
- Assembly
- Renci.SshNet.dll
Provides functionality to perform private key authentication.
public class PrivateKeyAuthenticationMethod : AuthenticationMethod, IDisposableInheritance
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
usernamestring-
The username.
keyFilesIPrivateKeySource[]-
The key files.
Exceptions
- ArgumentException
-
usernameis whitespace or null.
Properties
KeyFiles
Gets the key files used for authentication.
public ICollection<IPrivateKeySource> KeyFiles { get; }Property Value
Name
Gets the name of the authentication method.
public override string Name { get; }Property Value
Methods
Authenticate(Session)
Authenticates the specified session.
public override AuthenticationResult Authenticate(Session session)Parameters
sessionSession-
The session to authenticate.
Returns
- AuthenticationResult
-
Result of authentication process.
Dispose(bool)
Releases unmanaged and - optionally - managed resources.
protected override void Dispose(bool disposing)