class Net::SSH::Authentication::Agent

def sign(key, data, flags = 0)

signature is returned in SSH2 format.
Using the agent and the given public key, sign the given data. The
def sign(key, data, flags = 0)
  type, reply = send_and_wait(SSH2_AGENT_SIGN_REQUEST, :string, Buffer.from(:key, key), :string, data, :long, flags)
  raise AgentError, "agent could not sign data with requested identity" if agent_failed(type)
  raise AgentError, "bad authentication response #{type}" if type != SSH2_AGENT_SIGN_RESPONSE
  return reply.read_string
end