sshkey

package
v1.5.1 Latest Latest
Warning

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

Go to latest
Published: Dec 30, 2025 License: MIT Imports: 5 Imported by: 0

Documentation

Overview

package sshkey provides utilities for parsing and validating SSH key data. It includes functions to parse authorized_keys lines, extract Keymaster-specific metadata, and check for weak cryptographic algorithms.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CheckHostKeyAlgorithm

func CheckHostKeyAlgorithm(key ssh.PublicKey) string

CheckHostKeyAlgorithm inspects the public key's algorithm and returns a warning message if the algorithm is considered weak or deprecated.

func Parse

func Parse(rawKey string) (algorithm, keyData, comment string, err error)

Parse splits a raw public key string (like one from an authorized_keys file) into its three core components: algorithm, key data, and comment. It correctly handles leading options in the line (e.g., from="...",command="...").

func ParseSerial

func ParseSerial(line string) (int, error)

ParseSerial extracts the Keymaster serial number from the header comment line of a Keymaster-managed authorized_keys file.

Types

This section is empty.

Jump to

Keyboard shortcuts

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