ssh

package
v0.21.0 Latest Latest
Warning

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

Go to latest
Published: Mar 8, 2024 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Overview

Package ssh implements an ssh-agent.

Index

Constants

This section is empty.

Variables

View Source
var ErrNotImplemented = errors.New("not implemented in piv-agent")

ErrNotImplemented is returned from any unimplemented method.

View Source
var ErrUnknownKey = errors.New("requested signature of unknown key")

ErrUnknownKey is returned when a signature is requested for an unknown key.

Functions

This section is empty.

Types

type Agent

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

Agent implements the crypto/ssh Agent interface https://pkg.go.dev/golang.org/x/crypto/ssh/agent#Agent

func NewAgent

func NewAgent(p *piv.KeyService, pe *pinentry.PINEntry, log *zap.Logger,
	loadKeyfile bool, n *notify.Notify, cancel context.CancelFunc) *Agent

NewAgent returns a new Agent.

func (*Agent) Add

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

Add adds a private key to the agent.

func (*Agent) List

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

List returns the identities known to the agent.

func (*Agent) Lock

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

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

Remove removes all identities with the given public key.

func (*Agent) RemoveAll

func (a *Agent) RemoveAll() error

RemoveAll removes all identities. This is implemented by causing piv-agent to exit.

func (*Agent) Sign

func (a *Agent) Sign(key gossh.PublicKey, data []byte) (*gossh.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) Signers

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

Signers returns signers for all the known keys.

func (*Agent) Unlock

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

Unlock undoes the effect of Lock

Jump to

Keyboard shortcuts

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