MCPcopy Create free account
hub / github.com/chirpstack/chirpstack / read_algo

Function read_algo

chirpstack/src/certificate.rs:98–110  ·  view source on GitHub ↗

we are using String here, because else we run into lifetime issues.

(cert: &str)

Source from the content-addressed store, hash-verified

96
97// we are using String here, because else we run into lifetime issues.
98fn read_algo(cert: &str) -> Result<&'static SignatureAlgorithm> {
99 let cert = pem::parse(cert).context("Parse PEM")?;
100 let (_remainder, x509) =
101 x509_parser::parse_x509_certificate(cert.contents()).context("Parse x509")?;
102
103 let alg_oid = x509
104 .signature_algorithm
105 .algorithm
106 .iter()
107 .ok_or_else(|| anyhow!("Parse certificate error"))?
108 .collect::<Vec<_>>();
109 Ok(SignatureAlgorithm::from_oid(&alg_oid)?)
110}

Callers 1

get_ca_certFunction · 0.85

Calls 1

iterMethod · 0.80

Tested by

no test coverage detected