Class UnixSocketAgentConnection

java.lang.Object
com.hierynomus.sshj.userauth.agent.UnixSocketAgentConnection
All Implemented Interfaces:
AgentConnection, Closeable, AutoCloseable

public class UnixSocketAgentConnection extends Object implements AgentConnection
An AgentConnection over a unix-domain socket, as used by OpenSSH's SSH_AUTH_SOCK on Linux and macOS.

Unix-domain sockets are only in the JDK from Java 16 onwards. sshj's main sources target Java 8, so the Java 16 socket classes are reached reflectively here: this compiles everywhere and works at runtime on a Java 16+ JVM (such as the JetBrains Runtime). On an older runtime the constructor throws an IOException explaining that you must supply your own AgentConnection.