[SFTP/SCP Only] Path of the private key file used to authenticate the client in SFTP/SCP.
Namespace: EnterpriseDT.Net.FtpAssembly: edtFTPnetPRO (in edtFTPnetPRO.dll) Version: 9.4.0.40
Syntax
C# |
---|
public string ClientPrivateKeyFile { get; set; } |
Visual Basic |
---|
Public Property ClientPrivateKeyFile As String Get Set |
Visual C++ |
---|
public: property String^ ClientPrivateKeyFile { String^ get (); void set (String^ value); } |
Field Value
Path of the private key file used to authenticate the client.Remarks
This property applies to SFTP only. Use the Protocol property to select the protocol.
This property must be set before a connection with the server is made. The SFTP server must have been set up with the corresponding public key before this authentication method is used. For this property to be used, AuthenticationMethod must be set to PublicKey or PublicKeyAndPassword.
Examples
This example illustrates an SFTP client using public key
authentication connecting to a server:
Copy | |
---|---|
SecureFTPConnection ftp = new SecureFTPConnection(); ftp.Protocol = FileTransferProtocol.SFTP; ftp.ServerAddress = "my-server-name"; ftp.UserName = "my-username"; ftp.AuthenticationMethod = AuthenticationType.PublicKey; ftp.ClientPrivateKeyFile = "pathtokeyfile"; ftp.ClientPrivateKeyPassphrase = "passwordforkeyfile"; ftp.ServerValidation = SecureFTPServerValidationType.None; ftp.Connect(); ftp.Close(); |