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

Function load_private_key

crates/openshell-cli/src/tls.rs:195–201  ·  view source on GitHub ↗
(pem: &[u8])

Source from the content-addressed store, hash-verified

193}
194
195fn load_private_key(pem: &[u8]) -> Result<PrivateKeyDer<'static>> {
196 let mut cursor = Cursor::new(pem);
197 let key = rustls_pemfile::private_key(&mut cursor)
198 .into_diagnostic()?
199 .ok_or_else(|| miette::miette!("no private key found in TLS key PEM"))?;
200 Ok(key)
201}
202
203pub fn build_rustls_config(materials: &TlsMaterials) -> Result<rustls::ClientConfig> {
204 let mut roots = RootCertStore::empty();

Callers 1

build_rustls_configFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected