sshkeypair

package
v0.0.0-...-d0f4959 Latest Latest
Warning

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

Go to latest
Published: Nov 16, 2025 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type FileStatError

type FileStatError struct {
	Path string
	Err  error
}

FileStatError wraps os.Stat failures.

func (FileStatError) Error

func (e FileStatError) Error() string

func (FileStatError) Unwrap

func (e FileStatError) Unwrap() error

type KeyGenerateError

type KeyGenerateError struct {
	Err error
}

KeyGenerateError wraps RSA key generation failures.

func (KeyGenerateError) Error

func (e KeyGenerateError) Error() string

func (KeyGenerateError) Unwrap

func (e KeyGenerateError) Unwrap() error

type KeyPairInfo

type KeyPairInfo struct {
	PrivatePath   string
	PublicPath    string
	KeyGenerated  bool
	PublicCreated bool
}

KeyPairInfo describes the ensured key pair.

func EnsureKeyPair

func EnsureKeyPair(privatePath string, opts ...Option) (*KeyPairInfo, error)

EnsureKeyPair checks for an RSA SSH key pair and creates it when missing.

type KeyParseError

type KeyParseError struct {
	Path string
	Err  error
}

KeyParseError indicates unsupported or corrupt key data.

func (KeyParseError) Error

func (e KeyParseError) Error() string

func (KeyParseError) Unwrap

func (e KeyParseError) Unwrap() error

type KeyReadError

type KeyReadError struct {
	Path string
	Err  error
}

KeyReadError indicates failure to load a key from disk.

func (KeyReadError) Error

func (e KeyReadError) Error() string

func (KeyReadError) Unwrap

func (e KeyReadError) Unwrap() error

type KeyWriteError

type KeyWriteError struct {
	Path string
	Err  error
}

KeyWriteError wraps write/permission problems when writing keys.

func (KeyWriteError) Error

func (e KeyWriteError) Error() string

func (KeyWriteError) Unwrap

func (e KeyWriteError) Unwrap() error

type Option

type Option func(*ensureOptions) error

Option configures EnsureKeyPair behavior.

func WithComment

func WithComment(comment string) Option

WithComment overrides the comment appended to the public key line.

func WithKeyBits

func WithKeyBits(bits int) Option

WithKeyBits overrides the RSA key size.

type OptionError

type OptionError struct {
	Reason string
}

OptionError surfaces invalid option configurations.

func (OptionError) Error

func (e OptionError) Error() string

type PathError

type PathError struct {
	Reason string
}

PathError represents invalid input paths.

func (PathError) Error

func (e PathError) Error() string

Jump to

Keyboard shortcuts

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