def __find_key(self, key_fingerprint):
        write_field(self.sock, SSH2_AGENTC_REQUEST_IDENTITIES)
        length, response_code, count = struct.unpack("!IBI",
                                                     self.sock.recv(9))
        assert response_code == SSH2_AGENT_IDENTITIES_ANSWER
        resp = self.sock.recv(length - 5)
        fields = rsa.read_fields(resp)
        for i in xrange(count):
            try:
                key = rsa.RSAPublicKey(fields.next())
            except exceptions.KeyError:
                fields.next()
                continue
            fields.next()  # ignore filename for key
            if key.fingerprint() == key_fingerprint:
                return key
dataset/ETHPy150Open spotify/crtauth/crtauth/ssh.py/AgentSigner.__find_key/original