agent

package
v0.0.0-...-a9fa5a0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 18, 2014 License: BSD-3-Clause Imports: 9 Imported by: 0

Documentation

Overview

Package agent implements a client to an ssh-agent daemon.

References:

[PROTOCOL.agent]:    http://www.openbsd.org/cgi-bin/cvsweb/src/usr.bin/ssh/PROTOCOL.agent

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AgentClient

type AgentClient struct {
	// contains filtered or unexported fields
}

AgentClient is a client for an ssh-agent process.

func NewAgentClient

func NewAgentClient(rwc io.ReadWriteCloser) *AgentClient

NewAgentClient creates and returns a new *AgentClient using the passed in io.ReadWriter as a connection to a ssh agent.

func (*AgentClient) Close

func (c *AgentClient) Close() error

Close closes the connection to the daemon.

func (*AgentClient) Insert

func (ac *AgentClient) Insert(s interface{}, comment string) error

Insert adds a private key to the agent. Currently, only *rsa.PrivateKey is supported.

func (*AgentClient) List

func (ac *AgentClient) List() ([]*AgentKey, error)

List returns the identities known to the agent.

func (*AgentClient) Sign

func (ac *AgentClient) Sign(key ssh.PublicKey, data []byte) ([]byte, error)

Sign has the agent sign the data using a protocol 2 key as defined in [PROTOCOL.agent] section 2.6.2.

func (*AgentClient) Signers

func (c *AgentClient) Signers() ([]ssh.Signer, error)

Signers implements the ssh.ClientKeyring interface.

type AgentKey

type AgentKey struct {
	Comment string
	// contains filtered or unexported fields
}

AgentKey represents a protocol 2 key as defined in [PROTOCOL.agent], section 2.5.2.

func (*AgentKey) Key

func (ak *AgentKey) Key() (ssh.PublicKey, error)

Key returns an agent's public key as one of the supported key or certificate types.

func (*AgentKey) String

func (ak *AgentKey) String() 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.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL