MCPcopy Create free account
hub / github.com/NVIDIA/OpenShell / write_pem

Function write_pem

crates/openshell-server/src/certgen.rs:759–767  ·  view source on GitHub ↗
(path: &Path, contents: &str, owner_only: bool)

Source from the content-addressed store, hash-verified

757}
758
759fn write_pem(path: &Path, contents: &str, owner_only: bool) -> Result<()> {
760 std::fs::write(path, contents)
761 .into_diagnostic()
762 .wrap_err_with(|| format!("failed to write {}", path.display()))?;
763 if owner_only {
764 set_file_owner_only(path)?;
765 }
766 Ok(())
767}
768
769fn sibling_temp_dir(dir: &Path) -> PathBuf {
770 // Use a sibling so std::fs::rename succeeds (same filesystem).

Callers 3

write_local_bundleFunction · 0.85
write_local_tls_bundleFunction · 0.85
write_local_jwt_bundleFunction · 0.85

Calls 1

set_file_owner_onlyFunction · 0.85

Tested by

no test coverage detected