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

Function build_client_cert

crates/openshell-cli/tests/helpers/mod.rs:108–114  ·  view source on GitHub ↗
(ca: &Certificate, ca_key: &KeyPair)

Source from the content-addressed store, hash-verified

106/// Returns `(cert_pem, key_pem)`.
107#[allow(dead_code)]
108pub fn build_client_cert(ca: &Certificate, ca_key: &KeyPair) -> (String, String) {
109 let key_pair = KeyPair::generate().unwrap();
110 let mut params = CertificateParams::new(Vec::<String>::new()).unwrap();
111 params.extended_key_usages = vec![ExtendedKeyUsagePurpose::ClientAuth];
112 let cert = params.signed_by(&key_pair, ca, ca_key).unwrap();
113 (cert.pem(), key_pair.serialize_pem())
114}

Calls

no outgoing calls

Tested by

no test coverage detected