code: func createAgent(me *user.User, privateKeyByte []byte, certificateBytes []byte) (*teleagent.AgentServer, string, string, error) {
  	// create a path to the unix socket
  	sockDir, err := ioutil.TempDir("", "int-test")
  	if err != nil {
  		return nil, "", "", trace.Wrap(err)
  	}
  	sockPath := filepath.Join(sockDir, "agent.sock")
  
  	uid, err := strconv.Atoi(me.Uid)
  	if err != nil {
  		return nil, "", "", trace.Wrap(err)
  	}
  	gid, err := strconv.Atoi(me.Gid)
  	if err != nil {
  		return nil, "", "", trace.Wrap(err)
  	}
  
  	// transform the key and certificate bytes into something the agent can understand
  	publicKey, _, _, _, err := ssh.ParseAuthorizedKey(certificateBytes)
  	if err != nil {
  		return nil, "", "", trace.Wrap(err)
  	}
  	privateKey, err := ssh.ParseRawPrivateKey(privateKeyByte)
  	if err != nil {
  		return nil, "", "", trace.Wrap(err)
  	}
  	agentKey := agent.AddedKey{
  		PrivateKey:       privateKey,
  		Certificate:      publicKey.(*ssh.Certificate),
  		Comment:          "",
  		LifetimeSecs:     0,
  		ConfirmBeforeUse: false,
  	}
  
  	// create a (unstarted) agent and add the key to it
  	teleAgent := teleagent.NewServer()
  	teleAgent.Add(agentKey)
  
  	// start the SSH agent
  	err = teleAgent.ListenUnixSocket(sockPath, uid, gid, 0600)
  	if err != nil {
  		return nil, "", "", trace.Wrap(err)
  	}
  	go teleAgent.Serve()
  
  	return teleAgent, sockDir, sockPath, nil
  }
docs: // createAgent creates a SSH agent with the passed in private key and
  // certificate that can be used in tests. This is useful so tests don't
  // clobber your system agent.