class Agent (View source)

Pure-PHP ssh-agent client identity factory

requestIdentities() method pumps out \phpseclib3\System\SSH\Agent\Identity objects

Traits

ReadBytes trait

Constants

SSH_AGENTC_REQUEST_IDENTITIES

SSH_AGENT_IDENTITIES_ANSWER

SSH_AGENTC_SIGN_REQUEST

SSH_AGENT_SIGN_RESPONSE

FORWARD_NONE

FORWARD_REQUEST

FORWARD_ACTIVE

SSH_AGENT_FAILURE

Unused

Methods

readBytes(int $length)

Read data

__construct($address = null)

Default Constructor

array
requestIdentities()

Request Identities

bool
startSSHForwarding(SSH2 $ssh)

Signal that agent forwarding should be requested when a channel is opened

registerChannelOpen(SSH2 $ssh)

On successful channel open

string
forwardData(string $data)

Forward data to SSH Agent and return data reply

Details

readBytes(int $length)

Read data

Parameters

int $length

Exceptions

RuntimeException on connection errors

Agent __construct($address = null)

Default Constructor

Parameters

$address

Return Value

Agent

Exceptions

BadConfigurationException if SSH_AUTH_SOCK cannot be found
RuntimeException on connection errors

array requestIdentities()

Request Identities

See "2.5.2 Requesting a list of protocol 2 keys" Returns an array containing zero or more \phpseclib3\System\SSH\Agent\Identity objects

Return Value

array

Exceptions

RuntimeException on receipt of unexpected packets

bool startSSHForwarding(SSH2 $ssh)

Signal that agent forwarding should be requested when a channel is opened

Parameters

SSH2 $ssh

Return Value

bool

registerChannelOpen(SSH2 $ssh)

On successful channel open

This method is called upon successful channel open to give the SSH Agent an opportunity to take further action. i.e. request agent forwarding

Parameters

SSH2 $ssh

string forwardData(string $data)

Forward data to SSH Agent and return data reply

Parameters

string $data

Return Value

string Data from SSH Agent

Exceptions

RuntimeException on connection errors