Documentation ¶
Overview ¶
Package ssh implements an ssh-agent.
Index ¶
- Variables
- type Agent
- func (a *Agent) Add(key agent.AddedKey) error
- func (a *Agent) List() ([]*agent.Key, error)
- func (a *Agent) Lock(passphrase []byte) error
- func (a *Agent) Remove(key gossh.PublicKey) error
- func (a *Agent) RemoveAll() error
- func (a *Agent) Sign(key gossh.PublicKey, data []byte) (*gossh.Signature, error)
- func (a *Agent) Signers() ([]gossh.Signer, error)
- func (a *Agent) Unlock(passphrase []byte) error
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) Lock ¶
Lock locks the agent. Sign and Remove will fail, and List will empty an empty list.
func (*Agent) RemoveAll ¶
RemoveAll removes all identities. This is implemented by causing piv-agent to exit.
func (*Agent) Sign ¶
Sign has the agent sign the data using a protocol 2 key as defined in [PROTOCOL.agent] section 2.6.2.
Click to show internal directories.
Click to hide internal directories.