Documentation
¶
Overview ¶
Package key implements the authama key-naming convention. Name grammar: <profile>_<service>-<algo> with exactly one underscore (the profile prefix); the rest is kebab-case.
Index ¶
- func AlgoOf(name string) (string, error)
- func BuildKeyName(profile, service, algo string) (string, error)
- func DeriveKeyName(profile, alias, algo string) (string, error)
- func IsKnownAlgo(algo string) bool
- func NormalizeSegment(value string) string
- func SplitKeyName(name string) (profile, remainder string, err error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func BuildKeyName ¶
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 ¶
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 ¶
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 ¶
NormalizeSegment lowercases and collapses any non-alphanumeric run to a single dash, trimming leading/trailing dashes.
func SplitKeyName ¶
SplitKeyName splits a name into (profile, remainder) on the first underscore.
Types ¶
This section is empty.