sshagent

package
v1.1.0 Latest Latest
Warning

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

Go to latest
Published: Jan 17, 2024 License: MPL-2.0 Imports: 6 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ProxyAgent

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

func NewProxyAgent

func NewProxyAgent(log types.Logger) *ProxyAgent

NewProxyAgent creates a new ProxyAgent.

func (*ProxyAgent) Add

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

Add adds a private key to the agent(local). It will not add from extended agent.

func (*ProxyAgent) AddIdentities

func (a *ProxyAgent) AddIdentities(key ...agent.AddedKey) error

AddIdentities adds identities to the agent(local). It not adds identities to the extended agent.

func (*ProxyAgent) Extension

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

Extension not supported.

func (*ProxyAgent) GetExtendedAgentSocketPath added in v1.1.0

func (a *ProxyAgent) GetExtendedAgentSocketPath() string

GetExtendedAgentSocketPath returns the extended agent path.

func (*ProxyAgent) List

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

List returns the identities known to the agent(local + extended).

func (*ProxyAgent) Lock

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

Lock locks the agent (local + extended).

func (*ProxyAgent) Remove

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

Remove removes identities with the given public key (local). It will not remove from extended agent.

func (*ProxyAgent) RemoveAll

func (a *ProxyAgent) RemoveAll() error

RemoveAll removes all identities (local). It will not remove all from extended agent.

func (*ProxyAgent) SetExtendedAgent

func (a *ProxyAgent) SetExtendedAgent(socketPath string)

SetExtendedAgent sets the extended agent path.

func (*ProxyAgent) Sign

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

Sign returns a signature by signing data with the given public key (local + extended). Prioritize signing from the local. If signing from the local source fails, then try extended.

func (*ProxyAgent) SignWithFlags

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

SignWithFlags returns a signature by signing data with the given public key (local + extended). Prioritize signing from the local. If signing from the local source fails, then try extended.

func (*ProxyAgent) Signers

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

Signers returns signers for all signers (local + extended).

func (*ProxyAgent) Unlock

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

Unlock undoes the effect of Lock (local + extended).

type SSHAgent

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

func New

func New(socketPath string, log types.Logger) (*SSHAgent, error)

New creates a new SSHAgent.

func (*SSHAgent) AddIdentities

func (s *SSHAgent) AddIdentities(key ...agent.AddedKey) error

AddIdentities adds identities to the agent(local). It not adds identities to the extended agent.

func (*SSHAgent) Close

func (s *SSHAgent) Close() error

Close closes the ssh auth socket.

func (*SSHAgent) GetExtendedAgentSocketPath added in v1.1.0

func (s *SSHAgent) GetExtendedAgentSocketPath() string

GetExtendedAgentSocketPath returns the extended agent path.

func (*SSHAgent) Listen

func (s *SSHAgent) Listen()

Listen starts listening on the ssh auth socket.

func (*SSHAgent) SetExtendedAgent

func (s *SSHAgent) SetExtendedAgent(p string)

SetExtendedAgent sets the extended agent path.

Jump to

Keyboard shortcuts

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