pkg

package
v0.6.0 Latest Latest
Warning

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

Go to latest
Published: Jun 12, 2025 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Agent

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

func MustNewAgent

func MustNewAgent(path string) *Agent

MustNewAgent creates a new Agent instance and connects to the agent socket. It panics if the connection fails. This is for compatibility with existing code. Prefer NewAgent for error handling.

func NewAgent added in v0.4.0

func NewAgent(path string) (*Agent, error)

NewAgent creates a new Agent instance and connects to the agent socket. It returns an error if the connection fails.

func (*Agent) Add added in v0.0.3

func (a *Agent) Add(key agent.AddedKey) error

Add adds a private key to the agent.

func (*Agent) Extension added in v0.0.4

func (a *Agent) Extension(extensionType string, contents []byte) ([]byte, error)

func (*Agent) List added in v0.0.3

func (a *Agent) List() ([]*agent.Key, error)

List returns the identities known to the agent.

func (*Agent) Lock added in v0.0.3

func (a *Agent) Lock(passphrase []byte) error

Lock locks the agent. Sign and Remove will fail, and List will empty an empty list.

func (*Agent) Remove added in v0.0.3

func (a *Agent) Remove(key ssh.PublicKey) error

Remove removes all identities with the given public key.

func (*Agent) RemoveAll added in v0.0.3

func (a *Agent) RemoveAll() error

RemoveAll removes all identities.

func (*Agent) Sign added in v0.0.3

func (a *Agent) Sign(key ssh.PublicKey, data []byte) (*ssh.Signature, error)

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

func (*Agent) SignWithFlags added in v0.0.4

func (a *Agent) SignWithFlags(key ssh.PublicKey, data []byte, flags agent.SignatureFlags) (*ssh.Signature, error)

func (*Agent) Signers added in v0.0.3

func (a *Agent) Signers() ([]ssh.Signer, error)

Signers returns signers for all the known keys.

func (*Agent) Unlock added in v0.0.3

func (a *Agent) Unlock(passphrase []byte) error

Unlock undoes the effect of Lock

type MuxAgent

type MuxAgent struct {
	AddTargets          []*Agent
	Targets             []*Agent
	SelectTargetCommand string
	// contains filtered or unexported fields
}

func NewMuxAgent

func NewMuxAgent(targets []*Agent, addTargets []*Agent, selectTargetCommand string) *MuxAgent

func (*MuxAgent) Add

func (m *MuxAgent) Add(key agent.AddedKey) error

Add implements agent.Agent

func (*MuxAgent) Extension added in v0.0.4

func (m *MuxAgent) Extension(extensionType string, contents []byte) ([]byte, error)

Extension implements agent.ExtendedAgent.

func (*MuxAgent) List

func (m *MuxAgent) List() ([]*agent.Key, error)

List implements agent.Agent

func (*MuxAgent) Lock

func (m *MuxAgent) Lock(passphrase []byte) error

Lock implements agent.Agent

func (*MuxAgent) Remove

func (m *MuxAgent) Remove(key ssh.PublicKey) error

Remove implements agent.Agent

func (*MuxAgent) RemoveAll

func (m *MuxAgent) RemoveAll() error

RemoveAll implements agent.Agent

func (*MuxAgent) Sign

func (m *MuxAgent) Sign(key ssh.PublicKey, data []byte) (*ssh.Signature, error)

Sign implements agent.Agent

func (*MuxAgent) SignWithFlags added in v0.0.4

func (m *MuxAgent) SignWithFlags(key ssh.PublicKey, data []byte, flags agent.SignatureFlags) (*ssh.Signature, error)

SignWithFlags implements agent.ExtendedAgent.

func (*MuxAgent) Signers

func (m *MuxAgent) Signers() ([]ssh.Signer, error)

Signers implements agent.Agent

func (*MuxAgent) Unlock

func (m *MuxAgent) Unlock(passphrase []byte) error

Unlock implements agent.Agent

func (*MuxAgent) Update added in v0.4.0

func (m *MuxAgent) Update(targets []*Agent, addTargets []*Agent, selectTargetCommand string)

Update changes the configuration of the MuxAgent. It is thread-safe.

Directories

Path Synopsis
Package config defines the application's configuration structure.
Package config defines the application's configuration structure.

Jump to

Keyboard shortcuts

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