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

Function build_ca

crates/openshell-cli/tests/helpers/mod.rs:84–90  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

82/// Generate a self-signed CA certificate and its key pair.
83#[allow(dead_code)]
84pub fn build_ca() -> (Certificate, KeyPair) {
85 let key_pair = KeyPair::generate().unwrap();
86 let mut params = CertificateParams::new(Vec::<String>::new()).unwrap();
87 params.is_ca = IsCa::Ca(BasicConstraints::Unconstrained);
88 let cert = params.self_signed(&key_pair).unwrap();
89 (cert, key_pair)
90}
91
92/// Generate a server certificate signed by `ca`, valid for `localhost`.
93///

Calls

no outgoing calls

Tested by

no test coverage detected