public class SftpKeyAuthentication extends java.lang.Object implements SftpAuthenticationProvider
SftpAuthenticationProvider
using keys.
It has the following behaviour :
ConfigBuilder
implementation that allows it.sftp://lchan:myPassword@1.2.3.4:22//opt/sftp
), will
override the username used to login but no other credentials. The only valid authentication is via the specified private
key.In the adapter configuration file this class is aliased as sftp-key-authentication which is the preferred alternative to the fully qualified classname when building your configuration.
Constructor and Description |
---|
SftpKeyAuthentication() |
SftpKeyAuthentication(java.lang.String filename,
java.lang.String pkeyPassword) |
Modifier and Type | Method and Description |
---|---|
SftpClient |
connect(SftpClient sftp,
FileTransferConnection.UserInfo ui) |
java.lang.String |
getPrivateKeyFilename() |
java.lang.String |
getPrivateKeyPassword()
The password for the private key (if it has one)
|
void |
setPrivateKeyFilename(java.lang.String filename)
The name of the file where the private key is held
|
void |
setPrivateKeyPassword(java.lang.String pw)
The password for the private key (if it has one)
|
public SftpKeyAuthentication()
public SftpKeyAuthentication(java.lang.String filename, java.lang.String pkeyPassword)
public SftpClient connect(SftpClient sftp, FileTransferConnection.UserInfo ui) throws FileTransferException, java.io.IOException, PasswordException
connect
in interface SftpAuthenticationProvider
FileTransferException
java.io.IOException
PasswordException
public java.lang.String getPrivateKeyFilename()
public void setPrivateKeyFilename(java.lang.String filename)
filename
- name of file holding the private keypublic java.lang.String getPrivateKeyPassword()
public void setPrivateKeyPassword(java.lang.String pw)
pw
-