agent

package
v0.7.0 Latest Latest
Warning

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

Go to latest
Published: Oct 5, 2024 License: MIT Imports: 21 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrOperationUnsupported = errors.New("operation unsupported")
View Source
var SSH_TPM_AGENT_ADD = "tpm-add-key"

Functions

func LoadKeys

func LoadKeys(keyDir string) ([]*key.SSHTPMKey, error)

func MarshalTPMKeyMsg added in v0.6.0

func MarshalTPMKeyMsg(cert *sshagent.AddedKey) []byte

Types

type AddedKey added in v0.6.0

type AddedKey struct {
	PrivateKey           *keyfile.TPMKey
	Certificate          *ssh.Certificate
	Comment              string
	LifetimeSecs         uint32
	ConfirmBeforeUse     bool
	ConstraintExtensions []sshagent.ConstraintExtension
}

func ParseTPMKeyMsg added in v0.6.0

func ParseTPMKeyMsg(req []byte) (*AddedKey, error)

type Agent

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

func NewAgent

func NewAgent(listener *net.UnixListener, agents []agent.ExtendedAgent, tpmFetch func() transport.TPMCloser, ownerPassword func() ([]byte, error), pin func(*key.SSHTPMKey) ([]byte, error)) *Agent

func (*Agent) Add

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

func (*Agent) AddKey

func (a *Agent) AddKey(k *key.SSHTPMKey) error

func (*Agent) AddTPMKey added in v0.2.0

func (a *Agent) AddTPMKey(addedkey []byte) ([]byte, error)

func (*Agent) Close

func (a *Agent) Close() error

func (*Agent) Extension

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

func (*Agent) List

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

func (*Agent) LoadKeys

func (a *Agent) LoadKeys(keyDir string) error

func (*Agent) Lock

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

func (*Agent) Remove

func (a *Agent) Remove(sshkey 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) SignWithFlags

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

func (*Agent) Signers

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

func (*Agent) Stop

func (a *Agent) Stop()

func (*Agent) Unlock

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

func (*Agent) Wait

func (a *Agent) Wait()

type TPMKeyMsg added in v0.6.0

type TPMKeyMsg struct {
	Type        string `sshtype:"17|25"`
	PrivateKey  []byte
	CertBytes   []byte
	Constraints []byte `ssh:"rest"`
}

Jump to

Keyboard shortcuts

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