{"modulePath":"code.cloudfoundry.org/cli","version":"v6.1.1+incompatible","isLatest":false,"isStandardLibrary":false,"goos":"all","goarch":"all","docs":"# package agent\n\n\tPackage agent implements a client to an ssh-agent daemon.\n\nReferences:\n\n\t[PROTOCOL.agent]:    http://www.openbsd.org/cgi-bin/cvsweb/src/usr.bin/ssh/PROTOCOL.agent\n\n## Functions\n\n```go\nfunc ForwardToAgent(client *ssh.Client, keyring Agent) error\n```\nForwardToAgent routes authentication requests to the given keyring.\n\n```go\nfunc ForwardToRemote(client *ssh.Client, addr string) error\n```\nForwardToRemote routes authentication requests to the ssh-agent process serving on the given unix socket.\n\n```go\nfunc RequestAgentForwarding(session *ssh.Session) error\n```\nRequestAgentForwarding sets up agent forwarding for the session. SetupForwardKeyring or SetupForwardAgent should be called to route the authentication requests.\n\n```go\nfunc ServeAgent(agent Agent, c io.ReadWriter) error\n```\nServeAgent serves the agent protocol on the given connection. It returns when an I/O error occurs.\n\n## Types\n\n```go\ntype Agent interface {\n\t// List returns the identities known to the agent.\n\tList() ([]*Key, error)\n\n\t// Sign has the agent sign the data using a protocol 2 key as defined\n\t// in [PROTOCOL.agent] section 2.6.2.\n\tSign(key ssh.PublicKey, data []byte) (*ssh.Signature, error)\n\n\t// Insert adds a private key to the agent. If a certificate\n\t// is given, that certificate is added as public key.\n\tAdd(s interface{}, cert *ssh.Certificate, comment string) error\n\n\t// Remove removes all identities with the given public key.\n\tRemove(key ssh.PublicKey) error\n\n\t// RemoveAll removes all identities.\n\tRemoveAll() error\n\n\t// Lock locks the agent. Sign and Remove will fail, and List will empty an empty list.\n\tLock(passphrase []byte) error\n\n\t// Unlock undoes the effect of Lock\n\tUnlock(passphrase []byte) error\n\n\t// Signers returns signers for all the known keys.\n\tSigners() ([]ssh.Signer, error)\n}\n```\nAgent represents the capabilities of an ssh-agent.\n\n```go\nfunc NewClient(rw io.ReadWriter) Agent\n```\nNewClient returns an Agent that talks to an ssh-agent process over the given connection.\n\n```go\nfunc NewKeyring() Agent\n```\nNewKeyring returns an Agent that holds keys in memory.  It is safe for concurrent use by multiple goroutines.\n\n```go\ntype Key struct {\n\tFormat  string\n\tBlob    []byte\n\tComment string\n}\n```\nKey represents a protocol 2 public key as defined in \\[PROTOCOL.agent], section 2.5.2.\n\n```go\nfunc (k *Key) Marshal() []byte\n```\nMarshal returns key blob to satisfy the ssh.PublicKey interface.\n\n```go\nfunc (k *Key) String() string\n```\nString returns the storage form of an agent key with the format, base64 encoded serialized key, and the comment if it is not empty.\n\n```go\nfunc (k *Key) Type() string\n```\nType returns the public key type.\n\n```go\nfunc (k *Key) Verify(data []byte, sig *ssh.Signature) error\n```\nVerify satisfies the ssh.PublicKey interface, but is not implemented for agent keys.\n\n","path":"code.cloudfoundry.org/cli/src/code.google.com/p/go.crypto/ssh/agent","name":"agent","synopsis":"Package agent implements a client to an ssh-agent daemon.","isRedistributable":true}
