sshutil

package
v0.3.7 Latest Latest
Warning

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

Go to latest
Published: Jan 11, 2024 License: Apache-2.0 Imports: 18 Imported by: 0

Documentation

Index

Constants

View Source
const (
	LocalStore = "LocalStore"
)

Variables

This section is empty.

Functions

func CheckKeyType

func CheckKeyType(filePath string, passPhrase string) (*sshkey.PrivateKeyFile, error)

CheckKeyType Check the information in the PrivateKey file

func JSONDump

func JSONDump(data interface{}) string

func LoadKeyfile

func LoadKeyfile(filePath string, passPhrase string) (*sshkey.PrivateKeyFile, *agent.AddedKey, error)

LoadKeyfile Read privateKey file from local filesystem

Types

type KeyRing

type KeyRing struct {
	NotifyCallback func(action string, data interface{})
	// contains filtered or unexported fields
}

KeyRing saves the state of ssh-agent

func NewKeyRing

func NewKeyRing(s *store.Settings) *KeyRing

NewKeyRing an Agent that holds keys in memory.

func (*KeyRing) Add

func (k *KeyRing) Add(key agent.AddedKey) error

func (*KeyRing) AddKey

func (k *KeyRing) AddKey(keyID string) error

AddKey loads PrivateKeyFile into ssh-agent

func (*KeyRing) AddKeySettings

func (k *KeyRing) AddKeySettings(key sshkey.PrivateKeyFile) (string, error)

AddKeySettings saves PrivateKeyFile informatio in the store

func (*KeyRing) AddKeys

func (k *KeyRing) AddKeys() error

func (*KeyRing) DeleteKeySettings

func (k *KeyRing) DeleteKeySettings(sha256 string) error

DeleteKeySettings Delete PrivateKeyFile informatio in the store

func (*KeyRing) Extension

func (k *KeyRing) Extension(extensionType string, contents []byte) ([]byte, error)

func (*KeyRing) KeyList

func (k *KeyRing) KeyList() ([]sshkey.PrivateKeyFile, error)

KeyList wails function to display the key list with

func (*KeyRing) List

func (k *KeyRing) List() ([]*agent.Key, error)

func (*KeyRing) Lock

func (k *KeyRing) Lock(passphrase []byte) error

func (*KeyRing) Remove

func (k *KeyRing) Remove(key ssh.PublicKey) error

func (*KeyRing) RemoveAll

func (k *KeyRing) RemoveAll() error

func (*KeyRing) RemoveKey

func (k *KeyRing) RemoveKey(sha256 string) error

func (*KeyRing) Sign

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

func (*KeyRing) SignWithFlags

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

func (*KeyRing) Signers

func (k *KeyRing) Signers() ([]ssh.Signer, error)

func (*KeyRing) Unlock

func (k *KeyRing) Unlock(passphrase []byte) error

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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