ssh

package
v0.3.3 Latest Latest
Warning

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

Go to latest
Published: Apr 4, 2024 License: BSD-2-Clause, BSD-3-Clause Imports: 9 Imported by: 0

Documentation

Overview

package ssh provides utilities to manage SSH host keys in Ed25519 format. Some code is copied with minor edits from golang.org/x/crypto/ssh, see separate LICENCE which applies from the write() method and forward.

Index

Constants

View Source
const (
	PEMTypePrivateKey = "OPENSSH PRIVATE KEY"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type HostKey

type HostKey struct {
	Private ed25519.PrivateKey
	Check   uint32
	Comment string
}

HostKey represents the private output of the following command:

ssh-keygen -t ed25519 -c "some comment"

func NewHostKey

func NewHostKey(rand io.Reader, comment string) (*HostKey, error)

NewHostKey generates a new host key in Ed25519 format

func (*HostKey) Fingerprint

func (hk *HostKey) Fingerprint() (string, error)

Fingerprint outputs a host key's SHA256 fingerprint

func (*HostKey) WriteEFI

func (hk *HostKey) WriteEFI(varUUID *uuid.UUID, name string) error

WriteEFI writes a host key to EFI-NVRAM in PEM format

Jump to

Keyboard shortcuts

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