Class

Agent

Extends:

This class implements a simple client for the ssh-agent protocol. It does not implement any specific protocol, but instead copies the behavior of the ssh-agent functions in the OpenSSH library (3.8).

This means that although it behaves like a SSH1 client, it also has some SSH2 functionality (like signing data).

Constants
SSH2_AGENT_FAILURE
SSH2_AGENT_IDENTITIES_ANSWER
SSH2_AGENT_REQUEST_IDENTITIES
SSH2_AGENT_REQUEST_VERSION
SSH2_AGENT_SIGN_REQUEST
SSH2_AGENT_SIGN_RESPONSE
SSH2_AGENT_VERSION_RESPONSE
SSH_AGENT_FAILURE
SSH_AGENT_REQUEST_RSA_IDENTITIES
SSH_AGENT_RSA_IDENTITIES_ANSWER
SSH_COM_AGENT2_FAILURE
Public Attributes
buffers The buffer factory to use to obtain buffer instances.
keys The key factory to use to obtain key instances.
socket_factory The socket factory used to connect to the agent process. It must respond to #open, and accept a single parameter (the name of the socket to open).
socket_name The name of the socket to open.
version The version of the SSH protocol version to report.
Public Methods
close Closes this socket. This agent reference is no longer able to query the agent.
connect! Connect to the agent process using the socket factory and socket name given by the attribute writers. If the agent on the other end of the socket reports that it is an SSH2-compatible agent, this will fail (it only supports the ssh-agent distributed by OpenSSH).
identities Return an array of all identities (public keys) known to the agent. Each key returned is augmented with a comment property which is set to the comment returned by the agent for that key.
read_raw_packet
send_raw_packet
sign Using the agent and the given public key, sign the given data. The signature is returned in SSH2 format.
Private Methods
agent_failed Returns true if the parameter indicates a "failure" response from the agent, and false otherwise.
read_packet Read the next packet from the agent. This will return a two-part tuple consisting of the packet type, and the packet’s body (which is returned as a Net::SSH::Util::ReaderBuffer).
send_packet Send a new packet of the given type, with the associated data.
send_with_reply Send the given packet and return the subsequent reply from the agent. (See #send_packet and #read_packet).
Comments

Have your say
Please use Textile formatting (click here for a cheat sheet). Use <code/> and <pre/> for code samples.
Click here to login with OpenID to to post comments.