package agent
import "k8s.io/kubernetes/Godeps/_workspace/src/golang.org/x/crypto/ssh/agent"
Package agent implements a client to an ssh-agent daemon.
References:
[PROTOCOL.agent]: http://cvsweb.openbsd.org/cgi-bin/cvsweb/src/usr.bin/ssh/PROTOCOL.agent?rev=HEAD
Index ¶
- func ForwardToAgent(client *ssh.Client, keyring Agent) error
- func ForwardToRemote(client *ssh.Client, addr string) error
- func RequestAgentForwarding(session *ssh.Session) error
- func ServeAgent(agent Agent, c io.ReadWriter) error
- type Agent
- type Key
Functions ¶
func ForwardToAgent ¶
ForwardToAgent routes authentication requests to the given keyring.
func ForwardToRemote ¶
ForwardToRemote routes authentication requests to the ssh-agent process serving on the given unix socket.
func RequestAgentForwarding ¶
RequestAgentForwarding sets up agent forwarding for the session. ForwardToAgent or ForwardToRemote should be called to route the authentication requests.
func ServeAgent ¶
func ServeAgent(agent Agent, c io.ReadWriter) error
ServeAgent serves the agent protocol on the given connection. It returns when an I/O error occurs.
Types ¶
type Agent ¶
type Agent interface { // List returns the identities known to the agent. List() ([]*Key, error) // Sign has the agent sign the data using a protocol 2 key as defined // in [PROTOCOL.agent] section 2.6.2. Sign(key ssh.PublicKey, data []byte) (*ssh.Signature, error) // Insert adds a private key to the agent. If a certificate // is given, that certificate is added as public key. Add(s interface{}, cert *ssh.Certificate, comment string) error // Remove removes all identities with the given public key. Remove(key ssh.PublicKey) error // RemoveAll removes all identities. RemoveAll() error // Lock locks the agent. Sign and Remove will fail, and List will empty an empty list. Lock(passphrase []byte) error // Unlock undoes the effect of Lock Unlock(passphrase []byte) error // Signers returns signers for all the known keys. Signers() ([]ssh.Signer, error) }
Agent represents the capabilities of an ssh-agent.
func NewClient ¶
func NewClient(rw io.ReadWriter) Agent
NewClient returns an Agent that talks to an ssh-agent process over the given connection.
func NewKeyring ¶
func NewKeyring() Agent
NewKeyring returns an Agent that holds keys in memory. It is safe for concurrent use by multiple goroutines.
type Key ¶
Key represents a protocol 2 public key as defined in [PROTOCOL.agent], section 2.5.2.
func (*Key) Marshal ¶
Marshal returns key blob to satisfy the ssh.PublicKey interface.
func (*Key) String ¶
String returns the storage form of an agent key with the format, base64 encoded serialized key, and the comment if it is not empty.
func (*Key) Type ¶
Type returns the public key type.
func (*Key) Verify ¶
Verify satisfies the ssh.PublicKey interface, but is not implemented for agent keys.
Source Files ¶
client.go forward.go keyring.go server.go
- Version
- v0.19.0
- Published
- Jun 10, 2015
- Platform
- linux/amd64
- Imports
- 17 packages
- Last checked
- 1 minute ago –
Tools for package owners.