Skip to main content

validate_pubkey

Function validate_pubkey 

Source
pub fn validate_pubkey(raw: &str) -> Result<String, PubkeyValidationError>
Expand description

Parse and validate a .pub file’s contents into a single canonical authorized_keys line. Rejects multi-line input (which would silently install several keys, including embedded command= clauses), unknown algorithms, and unparseable base64 bodies. The returned string is trimmed of trailing whitespace / CR so the remote grep -qxF dedup step matches byte-for-byte across pushes.