requestIdentities() public method

See "2.5.2 Requesting a list of protocol 2 keys" Returns an array containing zero or more \phpseclib\System\SSH\Agent\Identity objects
public requestIdentities ( ) : array
return array
Example #1
0
 /**
  * Login with an ssh-agent provided key
  *
  * @param String $username
  * @param \phpseclib\System\SSH\Agent $agent
  * @return Boolean
  * @access private
  */
 function _ssh_agent_login($username, $agent)
 {
     $this->agent = $agent;
     $keys = $agent->requestIdentities();
     foreach ($keys as $key) {
         if ($this->_privatekey_login($username, $key)) {
             return true;
         }
     }
     return false;
 }