Interface ConnectorFactory.ConnectorDescriptor

Enclosing interface:
ConnectorFactory

public static interface ConnectorFactory.ConnectorDescriptor
ConnectorFactory.ConnectorDescriptors describe available Connectors a ConnectorFactory may provide.

A ConnectorFactory may support connecting to different SSH agents. Agents are identified by name; a user can choose a specific agent for instance via the IdentityAgent setting in ~/.ssh/config.

OpenSSH knows two built-in names: "none" for not using any agent, and "SSH_AUTH_SOCK" for using an agent that communicates over a Unix domain socket given by the value of environment variable SSH_AUTH_SOCK. Other agents can be specified in OpenSSH by specifying the socket file directly. (The "standard" OpenBSD OpenSSH knows only this communication mechanism.) "SSH_AUTH_SOCK" is also the default in OpenBSD OpenSSH if nothing is configured.

A particular ConnectorFactory may support more communication mechanisms or different agents. For instance, a factory on Windows might support Pageant, Win32-OpenSSH, or even git bash ssh-agent, and might accept internal names like "pageant", "openssh", "SSH_AUTH_SOCK" in ConnectorFactory.create(String, File) to choose among them.

The ConnectorFactory.ConnectorDescriptor interface and the ConnectorFactory.getSupportedConnectors() and ConnectorFactory.getDefaultConnector() methods provide a way for code using a ConnectorFactory to learn what the factory supports and thus implement some way by which a user can influence the default behavior if IdentityAgent is not set or ConnectorFactory.create(String, File) is called with identityAgent == null.
  • Method Details

    • getIdentityAgent

      @NonNull String getIdentityAgent()
      Retrieves the internal name of a supported Connector. The internal name is the one a user can specify for instance in the IdentityAgent setting in ~/.ssh/config to select the connector.
      Returns:
      the internal name; not empty
    • getDisplayName

      @NonNull String getDisplayName()
      Retrieves a display name for a Connector, suitable for showing in a UI.
      Returns:
      the display name; properly localized and not empty