Class SSHCredential

java.lang.Object
org.wildfly.security.credential.SSHCredential
All Implemented Interfaces:
Cloneable, Credential

public class SSHCredential extends Object implements Credential
A credential holding the location, key identity and passphrase (instance of Credential) of a Private key in an external file and/or the name of the file containing the known hosts
Author:
Ashley Abdel-Sayed
  • Field Details

    • DEFAULT_SSH_DIRECTORY

      public static File DEFAULT_SSH_DIRECTORY
    • DEFAULT_PRIVATE_KEYS

      public static String[] DEFAULT_PRIVATE_KEYS
    • DEFAULT_KNOWN_HOSTS

      public static String DEFAULT_KNOWN_HOSTS
  • Method Details

    • getSshDirectory

      public File getSshDirectory()
      Get the SSH directory containing the private key file and known hosts file
      Returns:
      the SSH directory
    • getPrivateKeyIdentities

      public String[] getPrivateKeyIdentities()
      Get the list of private key file names
      Returns:
      the private key identities
    • getPassphrase

      public Credential getPassphrase()
      Get the passphrase used to decrypt the private key
      Returns:
      the passphrase
    • getKnownHostsFile

      public String getKnownHostsFile()
      Get the file containing the known SSH hosts
      Returns:
      the known hosts file name
    • clone

      public Credential clone()
      Description copied from interface: Credential
      Creates and returns a copy of this Credential.
      Specified by:
      clone in interface Credential
      Overrides:
      clone in class Object
      Returns:
      a copy of this Credential.
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • equals

      public boolean equals(Object obj)
      Overrides:
      equals in class Object
    • builder

      public static SSHCredential.Builder builder()