sshutil

package
v0.9.4 Latest Latest
Warning

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

Go to latest
Published: Jul 20, 2026 License: GPL-3.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GenerateKey

func GenerateKey(comment string) (*PublicKey, *PrivateKey, error)

Types

type PrivateKey

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

func ParsePrivateKey

func ParsePrivateKey(content []byte, comment string) (*PrivateKey, error)

ParsePrivateKey unmarshals an SSH private key and attaches the given comment. The data already contains the comment, but it's better to present this awkward API than attempt to reimplement the parsing ourselves.

func (PrivateKey) Equal

func (k PrivateKey) Equal(other PrivateKey) bool

func (PrivateKey) MarshalText

func (k PrivateKey) MarshalText() ([]byte, error)

func (PrivateKey) SignHostKey

func (k PrivateKey) SignHostKey(key PublicKey) (*PublicKey, error)

func (PrivateKey) SignUserKey

func (k PrivateKey) SignUserKey(key PublicKey, principals []string) (*PublicKey, error)

type PublicKey

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

func ParsePublicKey

func ParsePublicKey(content []byte) (*PublicKey, error)

func (PublicKey) Comment

func (k PublicKey) Comment() string

func (PublicKey) Equal

func (k PublicKey) Equal(other PublicKey) bool

func (PublicKey) Fingerprint

func (k PublicKey) Fingerprint() string

func (PublicKey) String

func (k PublicKey) String() string

Jump to

Keyboard shortcuts

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