We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent fc11ca2 commit 0aa1c18Copy full SHA for 0aa1c18
Cargo.toml
@@ -19,6 +19,7 @@ webpki-roots = "0.22"
19
ring = "0.16.5"
20
untrusted = "0.7.0"
21
rustls = "0.20"
22
+x509-parser = "0.9.2"
23
24
[target.'cfg(windows)'.dependencies]
25
schannel = "0.1.15"
examples/print-trust-anchors.rs
@@ -0,0 +1,13 @@
1
+// Print the Subject of all extracted trust anchors.
2
+
3
+use rustls_native_certs;
4
+use std::error::Error;
5
+use x509_parser::prelude::*;
6
7
+fn main() -> Result<(), Box<dyn Error>> {
8
+ for cert in rustls_native_certs::load_native_certs()? {
9
+ let (_, cert) = parse_x509_certificate(&cert.0)?;
10
+ println!("{}", cert.tbs_certificate.subject);
11
+ }
12
+ Ok(())
13
+}
0 commit comments