pub fn load_key_file(path: &Path) -> Result<NostrSecretKey, KeyFileError>Expand description
Loads an operator key file written by generate_key_file.
The file must be a regular file (not a symbolic link) with a mode not
open to group or others, holding one nsec1… string optionally followed by a
newline. The contents are read into memory that is zeroised afterwards.
§Errors
Returns KeyFileError::File for a symbolic link, a non-regular file, a
mode wider than 0600, an over-long file or an operating-system
failure, KeyFileError::NotOneLine when the file is not one line of
text, and KeyFileError::InvalidKey when the line is not a valid
nsec. No error carries any part of the file.