phpseclib API Documentation
Class

System_SSH_Agent_Identity

class System_SSH_Agent_Identity

Pure-PHP ssh-agent client identity object

Instantiation should only be performed by SystemSSHAgent class. This could be thought of as implementing an interface that CryptRSA implements. ie. maybe a NetSSHAuthPublicKey interface or something. The methods in this interface would be getPublicKey, setSignatureMode and sign since those are the methods phpseclib looks for to perform public key authentication.

Properties

Crypt_RSA $key Key Object
string $key_blob Key Blob
resource $fsock Socket Resource

Methods

System_SSH_Agent_Identity System_SSH_Agent_Identity(resource $fsock)

Default Constructor.

setPublicKey(Crypt_RSA $key)

Set Public Key

setPublicKeyBlob(string $key_blob)

Set Public Key

mixed getPublicKey(int $format = null)

Get Public Key

setSignatureMode(int $mode)

Set Signature Mode

string sign(string $message)

Create a signature

Details

at line 133
public System_SSH_Agent_Identity System_SSH_Agent_Identity(resource $fsock)

Default Constructor.

Parameters

resource $fsock

Return Value

System_SSH_Agent_Identity

at line 146
public setPublicKey(Crypt_RSA $key)

Set Public Key

Called by SystemSSHAgent::requestIdentities()

Parameters

Crypt_RSA $key

at line 161
public setPublicKeyBlob(string $key_blob)

Set Public Key

Called by SystemSSHAgent::requestIdentities(). The key blob could be extracted from $this->key but this saves a small amount of computation.

Parameters

string $key_blob

at line 175
public mixed getPublicKey(int $format = null)

Get Public Key

Wrapper for $this->key->getPublicKey()

Parameters

int $format optional

Return Value

mixed

at line 189
public setSignatureMode(int $mode)

Set Signature Mode

Doesn't do anything as ssh-agent doesn't let you pick and choose the signature mode. ie. ssh-agent's only supported mode is CRYPTRSASIGNATURE_PKCS1

Parameters

int $mode

at line 202
public string sign(string $message)

Create a signature

See "2.6.2 Protocol 2 private key signature request"

Parameters

string $message

Return Value

string