pub fn write_key_to_file(path: &Path, secret_key: &str) -> Result<(), String>
Write a secret key to a file with restricted permissions.