Class SftpKeyAuthentication

  • All Implemented Interfaces:
    SftpAuthenticationProvider

    public class SftpKeyAuthentication
    extends java.lang.Object
    implements SftpAuthenticationProvider
    SftpAuthenticationProvider using keys.

    It has the following behaviour :

    • If the private key is not accepted by the target server, then an exception will be thrown.
    • Multiple private keys are supported, provided you specify a ConfigBuilder implementation that allows it.
    • Specifying the username+password in the destination (e.g. 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.
    • The private key and known_hosts file are expected to be in OpenSSH format

    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 Detail

      • SftpKeyAuthentication

        public SftpKeyAuthentication()
      • SftpKeyAuthentication

        public SftpKeyAuthentication​(java.lang.String filename,
                                     java.lang.String pkeyPassword)
    • Method Detail

      • getPrivateKeyFilename

        public java.lang.String getPrivateKeyFilename()
      • setPrivateKeyFilename

        public void setPrivateKeyFilename​(java.lang.String filename)
        The name of the file where the private key is held
        Parameters:
        filename - name of file holding the private key
      • getPrivateKeyPassword

        public java.lang.String getPrivateKeyPassword()
        The password for the private key (if it has one)
        Returns:
        private key password
      • setPrivateKeyPassword

        public void setPrivateKeyPassword​(java.lang.String pw)
        The password for the private key (if it has one)
        Parameters:
        pw -