Class UnixDomainSocketConnector

    • Constructor Detail

      • UnixDomainSocketConnector

        public UnixDomainSocketConnector​(String socketFile)
        Creates a new instance.
        Parameters:
        socketFile - to use; if null or empty, use environment variable SSH_AUTH_SOCK
    • Method Detail

      • connect

        public boolean connect()
                        throws IOException
        Description copied from interface: Connector
        Connects to an SSH agent if there is one running. If called when already connected just returns true.
        Returns:
        true if an SSH agent is available and connected, if no SSH agent is available
        Throws:
        IOException - if connecting to the SSH agent failed
      • rpc

        public byte[] rpc​(byte command,
                          byte[] message)
                   throws IOException
        Description copied from interface: Connector
        Performs a remote call to the SSH agent and returns the result.
        Parameters:
        command - to send
        message - to send; must have at least 5 bytes, and must have 5 unused bytes at the front.
        Returns:
        the result received
        Throws:
        IOException - if an error occurs