filter

package
v0.0.0-...-3234629 Latest Latest
Warning

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

Go to latest
Published: Jan 30, 2023 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrNoMatchingKey = errors.New("no matching key")
)

Functions

func New

func New(agent agent.Agent, fingerprints []string) agent.Agent

New returns an agent.Agent that will only sign if the pubkey matches the given fingerprint.

Types

type Filter

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

Filter implements an agent.Agent forwarder that only forwards keys matching selected fingerprints. TODO: support multiple fingerprints.

func (*Filter) Add

func (f *Filter) Add(key agent.AddedKey) error

Add adds a private key to the agent.

func (*Filter) List

func (f *Filter) List() ([]*agent.Key, error)

List returns the identities known to the agent.

func (*Filter) Lock

func (f *Filter) Lock(passphrase []byte) error

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

func (*Filter) Remove

func (f *Filter) Remove(key ssh.PublicKey) error

Remove removes all identities with the given public key.

func (*Filter) RemoveAll

func (f *Filter) RemoveAll() error

RemoveAll removes all identities.

func (*Filter) Sign

func (f *Filter) 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 (*Filter) Signers

func (f *Filter) Signers() ([]ssh.Signer, error)

Signers returns signers for all the known keys.

func (*Filter) Unlock

func (f *Filter) 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