(path: PathBuf, contents: &[u8])
| 5 | use std::path::{Path, PathBuf}; |
| 6 | |
| 7 | fn write_private_key(path: PathBuf, contents: &[u8]) -> Result<(), Error> { |
| 8 | use std::io::Write; |
| 9 | use std::os::unix::fs::PermissionsExt; |
| 10 | |
| 11 | let mut file = fs::File::create(&path)?; |
| 12 | let mut perms = fs::metadata(&path)?.permissions(); |
| 13 | perms.set_mode(0o600); |
| 14 | fs::set_permissions(&path, perms)?; |
| 15 | file.write_all(contents)?; |
| 16 | Ok(()) |
| 17 | } |
| 18 | |
| 19 | pub fn generate_certificates(certs_path: &PathBuf, rest_host: &str) -> Result<(), Error> { |
| 20 | /* Generate the CA certificate */ |
no outgoing calls
no test coverage detected