Class UnixSocketAgentConnection
java.lang.Object
com.hierynomus.sshj.userauth.agent.UnixSocketAgentConnection
- All Implemented Interfaces:
AgentConnection,Closeable,AutoCloseable
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.
-
Constructor Summary
Constructors -
Method Summary
-
Constructor Details
-
UnixSocketAgentConnection
- Throws:
IOException
-
-
Method Details
-
getInputStream
- Specified by:
getInputStreamin interfaceAgentConnection
-
getOutputStream
- Specified by:
getOutputStreamin interfaceAgentConnection
-
close
- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable- Throws:
IOException
-