86 $this->key->setPublicKey();
114 return !isset(
$format) ? $this->key->getPublicKey() : $this->key->getPublicKey(
$format);
143 $packet = pack(
'Na*', strlen($packet), $packet);
144 if (strlen($packet) != fputs($this->fsock, $packet)) {
145 user_error(
'Connection closed during signing');
148 $length = current(unpack(
'N', fread($this->fsock, 4)));
149 $type = ord(fread($this->fsock, 1));
151 user_error(
'Unable to retreive signature');
154 $signature_blob = fread($this->fsock, $length - 1);
157 return substr($signature_blob, strlen(
'ssh-rsa') + 12);
setPublicKey($key)
Set Public Key.
__construct($fsock)
Default Constructor.
setPublicKeyBlob($key_blob)
Set Public Key.
catch(Exception $e) $message
const SSH_AGENTC_SIGN_REQUEST
setSignatureMode($mode)
Set Signature Mode.
const SSH_AGENT_SIGN_RESPONSE
getPublicKey($format=null)
Get Public Key.
sign($message)
Create a signature.