sshagent

package module
v0.0.4 Latest Latest
Warning

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

Go to latest
Published: Oct 10, 2023 License: MIT Imports: 11 Imported by: 0

README

go-sshagent

Package go-sshagent provides a simple SSH Agent implementation, written in Go, mainly to be used within tests.

Build Status Coverage Status

Documentation

Overview

Package sshagent provides an SSH agent implementation that's bootstraped with the given signers, which cannot be changed.

It is intended to be used on testing only.

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
}

Agent is the ssh agent implementation.

func New

func New(signers ...ssh.Signer) *Agent

New create a new agent with the given signers.

func (*Agent) Add

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

func (*Agent) Close

func (a *Agent) Close() error

Close the agent and cleanup.

func (*Agent) List

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

func (*Agent) Lock

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

func (*Agent) Ready

func (a *Agent) Ready() bool

Ready tells whether the agent is ready or not.

func (*Agent) Remove

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

func (*Agent) RemoveAll

func (a *Agent) RemoveAll() error

func (*Agent) Sign

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

func (*Agent) Signers

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

func (*Agent) Socket

func (a *Agent) Socket() string

Socket returns the unix socket address in which the agent is listening.

func (*Agent) Start

func (a *Agent) Start() error

Start the agent in a random socket.

func (*Agent) Unlock

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

type ErrUnsupportedOperation

type ErrUnsupportedOperation struct {
	Op string
}

ErrUnsupportedOperation is returned on operations that are not implemented.

func (ErrUnsupportedOperation) Error

func (e ErrUnsupportedOperation) Error() string

Jump to

Keyboard shortcuts

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