Documentation
¶
Overview ¶
Package sshkeys parses and classifies the SSH public keys users register. The accepted set is deliberately small: no DSA, no certificates, no authorized_keys options (a registered key grants exactly "authenticate as the account", nothing a line could widen), no short RSA keys.
Index ¶
Constants ¶
const ( // MaxLineLen bounds a registered authorized_keys line. MaxLineLen = 8 << 10 // MaxCommentLen bounds the comment kept with a key. MaxCommentLen = 128 // MinRSABits is the smallest RSA modulus accepted. MinRSABits = 3072 )
Bounds.
Variables ¶
var ErrInvalid = errors.New("invalid ssh public key")
ErrInvalid wraps every refusal of a key.
Functions ¶
func IsSecurityKeyType ¶
IsSecurityKeyType reports whether an SSH algorithm name is a FIDO-backed key.
Types ¶
type Key ¶
type Key struct {
// Type is the SSH algorithm name.
Type string
// Blob is the key in SSH wire format.
Blob []byte
// Fingerprint is "SHA256:<unpadded base64>".
Fingerprint string
// Comment is the trailing comment of the line, possibly empty.
Comment string
// SecurityKey is true for the FIDO-backed "sk-" types.
SecurityKey bool
// Public is the key itself, for the SSH server's comparison.
Public ssh.PublicKey
}
Key is a parsed, accepted public key.