Class SVNSSHAuthentication

java.lang.Object
org.tmatesoft.svn.core.auth.SVNAuthentication
org.tmatesoft.svn.core.auth.SVNSSHAuthentication

public class SVNSSHAuthentication extends SVNAuthentication
The SVNSSHAuthentication class represents a kind of credentials used to authenticate a user over an SSH tunnel.

To obtain an ssh user credential, specify the SSH kind to credentials getter method of ISVNAuthenticationManager: getFirstAuthentication(), getNextAuthentication().

Since:
1.2
Version:
1.3
See Also:
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    private com.trilead.ssh2.auth.AgentProxy
     
    private char[]
     
    private char[]
     
    private int
     
    private java.io.File
     
    private char[]
     
  • Constructor Summary

    Constructors
    Modifier
    Constructor
    Description
    private
    SVNSSHAuthentication(java.lang.String userName, char[] password, java.io.File keyFile, char[] keyValue, char[] passphrase, com.trilead.ssh2.auth.AgentProxy agentProxy, int portNumber, boolean storageAllowed, SVNURL url, boolean isPartial)
     
     
    SVNSSHAuthentication(java.lang.String userName, char[] privateKey, java.lang.String passphrase, int portNumber, boolean storageAllowed)
    Deprecated.
    Use method
     
    SVNSSHAuthentication(java.lang.String userName, char[] privateKey, java.lang.String passphrase, int portNumber, boolean storageAllowed, SVNURL url, boolean isPartial)
    Deprecated.
    Use method
     
    SVNSSHAuthentication(java.lang.String userName, com.trilead.ssh2.auth.AgentProxy agentProxy, int portNumber, SVNURL url, boolean isPartial)
    Deprecated.
    Use method
     
    SVNSSHAuthentication(java.lang.String userName, java.io.File keyFile, java.lang.String passphrase, int portNumber, boolean storageAllowed)
    Deprecated.
    Use method
     
    SVNSSHAuthentication(java.lang.String userName, java.io.File keyFile, java.lang.String passphrase, int portNumber, boolean storageAllowed, SVNURL url, boolean isPartial)
    Deprecated.
    Use method
     
    SVNSSHAuthentication(java.lang.String userName, java.lang.String password, int portNumber, boolean storageAllowed)
     
    SVNSSHAuthentication(java.lang.String userName, java.lang.String password, int portNumber, boolean storageAllowed, SVNURL url, boolean isPartial)
  • Method Summary

    Modifier and Type
    Method
    Description
    Creates a deep copy of this credentials object.
    void
    Disposes sensitive data (e.g.
    com.trilead.ssh2.auth.AgentProxy
    Tells whether this authentication object has a SSH agent connection
    java.lang.String
    Deprecated.
    char[]
    Returns the password to the ssh private key.
    java.lang.String
    Deprecated.
    char[]
    Returns password.
    int
    Returns the number of the port across which an ssh tunnel is established.
    char[]
    Returns ssh private key.
    java.io.File
    Returns the File representation referring to the file with the user's ssh private key.
    boolean
    Tells whether this authentication object contains a user's private key.
    newInstance(java.lang.String userName, char[] keyValue, char[] passphrase, int portNumber, boolean storageAllowed, SVNURL url, boolean isPartial)
    Creates a user credential object for authenticating over an ssh tunnel.
    newInstance(java.lang.String userName, char[] password, int portNumber, boolean storageAllowed, SVNURL url, boolean isPartial)
    Creates a user credential object for authenticating over an ssh tunnel.
    newInstance(java.lang.String userName, com.trilead.ssh2.auth.AgentProxy agentProxy, int portNumber, SVNURL url, boolean isPartial)
    Creates a user credential object for authenticating over an ssh tunnel.
    newInstance(java.lang.String userName, java.io.File keyFile, char[] passphrase, int portNumber, boolean storageAllowed, SVNURL url, boolean isPartial)
    Creates a user credential object for authenticating over an ssh tunnel.

    Methods inherited from class org.tmatesoft.svn.core.auth.SVNAuthentication

    copyOf, getKind, getURL, getUserName, isPartial, isStorageAllowed

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • myPassword

      private char[] myPassword
    • myPassphrase

      private char[] myPassphrase
    • myPrivateKeyFile

      private java.io.File myPrivateKeyFile
    • myAgentProxy

      private com.trilead.ssh2.auth.AgentProxy myAgentProxy
    • myPortNumber

      private int myPortNumber
    • myPrivateKeyValue

      private char[] myPrivateKeyValue
  • Constructor Details

    • SVNSSHAuthentication

      public SVNSSHAuthentication(java.lang.String userName, java.lang.String password, int portNumber, boolean storageAllowed)
    • SVNSSHAuthentication

      public SVNSSHAuthentication(java.lang.String userName, java.lang.String password, int portNumber, boolean storageAllowed, SVNURL url, boolean isPartial)
      Since:
      1.3.1
    • SVNSSHAuthentication

      public SVNSSHAuthentication(java.lang.String userName, java.io.File keyFile, java.lang.String passphrase, int portNumber, boolean storageAllowed)
      Deprecated.
      Use method
    • SVNSSHAuthentication

      public SVNSSHAuthentication(java.lang.String userName, java.io.File keyFile, java.lang.String passphrase, int portNumber, boolean storageAllowed, SVNURL url, boolean isPartial)
      Deprecated.
      Use method
      Since:
      1.3.1
    • SVNSSHAuthentication

      public SVNSSHAuthentication(java.lang.String userName, char[] privateKey, java.lang.String passphrase, int portNumber, boolean storageAllowed)
      Deprecated.
      Use method
    • SVNSSHAuthentication

      public SVNSSHAuthentication(java.lang.String userName, char[] privateKey, java.lang.String passphrase, int portNumber, boolean storageAllowed, SVNURL url, boolean isPartial)
      Deprecated.
      Use method
      Since:
      1.3.1
    • SVNSSHAuthentication

      public SVNSSHAuthentication(java.lang.String userName, com.trilead.ssh2.auth.AgentProxy agentProxy, int portNumber, SVNURL url, boolean isPartial)
      Deprecated.
      Use method
    • SVNSSHAuthentication

      private SVNSSHAuthentication(java.lang.String userName, char[] password, java.io.File keyFile, char[] keyValue, char[] passphrase, com.trilead.ssh2.auth.AgentProxy agentProxy, int portNumber, boolean storageAllowed, SVNURL url, boolean isPartial)
  • Method Details

    • newInstance

      public static SVNSSHAuthentication newInstance(java.lang.String userName, char[] password, int portNumber, boolean storageAllowed, SVNURL url, boolean isPartial)
      Creates a user credential object for authenticating over an ssh tunnel.
      Parameters:
      userName - the name of a user to authenticate
      password - the user's password
      portNumber - the number of a port to establish an ssh tunnel over
      storageAllowed - if true then this credential is allowed to be stored in the global auth cache, otherwise not
      url - url these credentials are applied to
      Since:
      1.8.9
    • newInstance

      public static SVNSSHAuthentication newInstance(java.lang.String userName, java.io.File keyFile, char[] passphrase, int portNumber, boolean storageAllowed, SVNURL url, boolean isPartial)
      Creates a user credential object for authenticating over an ssh tunnel.
      Parameters:
      userName - the name of a user to authenticate
      keyFile - the user's ssh private key file
      passphrase - a password to the ssh private key
      portNumber - the number of a port to establish an ssh tunnel over
      storageAllowed - if true then this credential is allowed to be stored in the global auth cache, otherwise not
      url - url these credentials are applied to
      Since:
      1.8.9
    • newInstance

      public static SVNSSHAuthentication newInstance(java.lang.String userName, char[] keyValue, char[] passphrase, int portNumber, boolean storageAllowed, SVNURL url, boolean isPartial)
      Creates a user credential object for authenticating over an ssh tunnel.
      Parameters:
      userName - the name of a user to authenticate
      privateKey - the user's ssh private key
      passphrase - a password to the ssh private key
      portNumber - the number of a port to establish an ssh tunnel over
      storageAllowed - if true then this credential is allowed to be stored in the global auth cache, otherwise not
      url - url these credentials are applied to
      Since:
      1.8.9
    • newInstance

      public static SVNSSHAuthentication newInstance(java.lang.String userName, com.trilead.ssh2.auth.AgentProxy agentProxy, int portNumber, SVNURL url, boolean isPartial)
      Creates a user credential object for authenticating over an ssh tunnel.
      Parameters:
      userName - the name of a user to authenticate
      agentProxy - SSH agent proxy
      portNumber - the number of a port to establish an ssh tunnel over
      url - url these credentials are applied to
      Since:
      1.8.9
    • getPassword

      public java.lang.String getPassword()
      Deprecated.
      Returns password. This is used when an ssh private key is not used.
      Returns:
      the user's password
    • getPasswordValue

      public char[] getPasswordValue()
      Returns password. This is used when an ssh private key is not used.
      Returns:
      password
      Since:
      1.8.9
    • getPassphrase

      public java.lang.String getPassphrase()
      Deprecated.
      Returns the password to the ssh private key.
      Returns:
      the password to the private key
      See Also:
    • getPassphraseValue

      public char[] getPassphraseValue()
      Returns the password to the ssh private key.
      Returns:
      the password to the private key
      Since:
      1.8.9
      See Also:
    • getPrivateKeyFile

      public java.io.File getPrivateKeyFile()
      Returns the File representation referring to the file with the user's ssh private key. If the private key is encrypted with a passphrase, it should have been provided to an appropriate constructor.
      Returns:
      the user's private key file
    • getPrivateKey

      public char[] getPrivateKey()
      Returns ssh private key. If the private key is encrypted with a passphrase, it should have been provided to an appropriate constructor.
      Returns:
      the user's private key file
    • getPortNumber

      public int getPortNumber()
      Returns the number of the port across which an ssh tunnel is established.
      Returns:
      the port number to establish an ssh tunnel over
    • hasPrivateKey

      public boolean hasPrivateKey()
      Tells whether this authentication object contains a user's private key.
      Returns:
      true if either getPrivateKey() or getPrivateKeyFile() returns non-null
      Since:
      1.2.0
    • getAgentProxy

      public com.trilead.ssh2.auth.AgentProxy getAgentProxy()
      Tells whether this authentication object has a SSH agent connection
    • dismissSensitiveData

      public void dismissSensitiveData()
      Description copied from class: SVNAuthentication
      Disposes sensitive data (e.g. password) stored in this object.
      Overrides:
      dismissSensitiveData in class SVNAuthentication
    • copy

      public SVNAuthentication copy()
      Description copied from class: SVNAuthentication
      Creates a deep copy of this credentials object. Sensitive data (e.g. password) is copied too.
      Overrides:
      copy in class SVNAuthentication
      Returns:
      copy of this object.