Help us shape the future of Go! Take the 2026 Go Developer Survey

sshcert

package
v0.45.0 Latest Latest
Warning

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

Go to latest
Published: Oct 30, 2026 License: Apache-2.0, Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GenerateKeys

func GenerateKeys() (RawPublicKey, RawPrivateKey, error)

GenerateKeys generates a ed25519 keypair in on-disk format

func Parse

func Parse(raw RawCertificate) (*ssh.Certificate, error)

Parse parses a certificate

func ParsePublicKey added in v0.23.0

func ParsePublicKey(raw RawPublicKey) (ssh.PublicKey, error)

ParsePublicKey parses exactly one authorized-key-formatted SSH public key. Comments are accepted, but authorized_keys options, trailing records, and certificates are not. Callers that persist the key can use ssh.MarshalAuthorizedKey on the result to obtain its canonical form.

Types

type RawCertificate

type RawCertificate string

RawCertificate is a cert in the on-disk certificate format

func (RawCertificate) Expiry added in v0.1.1

func (r RawCertificate) Expiry() (time.Time, error)

Expiry extracts the expiration time from the certificate. Returns the ValidBefore time from the certificate, or an error if parsing fails.

type RawPrivateKey

type RawPrivateKey string

RawPrivateKey is a private key in the on-disk private key format

type RawPublicKey

type RawPublicKey string

RawPublicKey is a public key in the on-disk format

Jump to

Keyboard shortcuts

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