Skip to main content

parse_keys_file

Function parse_keys_file 

Source
pub fn parse_keys_file(path: &Path) -> Result<Vec<TrustedKey>>
Expand description

Parses a trusted-keys file. One key per line, # comments and blank lines skipped, in either form:

<64-char hex>            # trusted, speaks as any channel
<name> <64-char hex>     # trusted, bound to that channel name

The name column is additive: files written before it existed parse unchanged, and a key with no name keeps exactly its old permissions. Binding is opt-in per key, so adding one line cannot lock anybody else out.

§Errors

Filesystem failures, and std::io::ErrorKind::InvalidData for a line that is not a valid ed25519 public key, or that binds one name to two keys. An invalid line fails the whole parse: a partial signer list would silently drop the ability to verify somebody’s pushes.