Class: Net::SSH::UserAuth::Agent

Class | Net::SSH::UserAuth::Agent
In: | lib/net/ssh/userauth/agent.rb
Parent: | Object

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).

### Methods

close connect! identities read_raw_packet send_raw_packet sign

### Constants

SSH2_AGENT_REQUEST_VERSION | = | 1
SSH2_AGENT_REQUEST_IDENTITIES | = | 11
SSH2_AGENT_IDENTITIES_ANSWER | = | 12
SSH2_AGENT_SIGN_REQUEST | = | 13
SSH2_AGENT_SIGN_RESPONSE | = | 14
SSH2_AGENT_FAILURE | = | 30
SSH2_AGENT_VERSION_RESPONSE | = | 103
SSH_COM_AGENT2_FAILURE | = | 102
SSH_AGENT_REQUEST_RSA_IDENTITIES | = | 1
SSH_AGENT_RSA_IDENTITIES_ANSWER | = | 2
SSH_AGENT_FAILURE | = | 5

### Attributes

buffers | [W] | The buffer factory to use to obtain buffer instances.
keys | [W] | The key factory to use to obtain key instances.
socket_factory | [W] | 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 | [W] | The name of the socket to open.
version | [W] | The version of the SSH protocol version to report.

### Public Instance 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( data )
sign( key, data )

Using the agent and the given public key, sign the given data. The signature is returned in SSH2 format.

[Validate]