key

package
v3.6.1 Latest Latest
Warning

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

Go to latest
Published: Nov 1, 2026 License: MIT Imports: 3 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package key implements the ssh-manager key-naming convention. Name grammar: <profile>_<service>-<algo> with exactly one underscore (the profile prefix); the rest is kebab-case.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AlgoOf

func AlgoOf(name string) (string, error)

AlgoOf returns the trailing -<algo> token of a key name (default ed25519).

func BuildKeyName

func BuildKeyName(profile, service, algo string) (string, error)

BuildKeyName builds a canonical key name. The profile must reduce to a single token (dashes are removed). An empty algo defaults to ed25519.

func DeriveKeyName

func DeriveKeyName(profile, alias, algo string) (string, error)

DeriveKeyName derives a canonical key name from a profile + host alias. The alias is the service token (e.g. "hpc.example.edu" -> "sc-its-hpc-edu").

func IsKnownAlgo

func IsKnownAlgo(algo string) bool

IsKnownAlgo reports whether algo is a key type ssh-keygen -t understands. Callers validate a declared type up front rather than letting a typo surface as a mid-mint ssh-keygen failure, after the snapshot and directory work.

func NormalizeSegment

func NormalizeSegment(value string) string

NormalizeSegment lowercases and collapses any non-alphanumeric run to a single dash, trimming leading/trailing dashes.

func SplitKeyName

func SplitKeyName(name string) (profile, remainder string, err error)

SplitKeyName splits a name into (profile, remainder) on the first underscore.

Types

This section is empty.

Jump to

Keyboard shortcuts

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