Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add an example to print trust anchors. #24

Merged
merged 1 commit into from
Oct 13, 2021
Merged

Add an example to print trust anchors. #24

merged 1 commit into from
Oct 13, 2021

Conversation

jsha
Copy link
Contributor

@jsha jsha commented May 27, 2021

Also remove a ; that was breaking compile for me.

@@ -0,0 +1,29 @@
// Print the Subject of all extracted trust anchors.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should probably be an inner attribute (that is, start with //!).

use std::io::{BufRead, Error};
use x509_parser::prelude::*;

struct Printer {}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For this, makes sense to replace {} with just ;.

println!("{}", cert.tbs_certificate.subject);
Ok(())
}
fn load_pem_file(&mut self, rd: &mut dyn BufRead) -> Result<(), Error> {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ideally add an empty line between these two methods.

@djc
Copy link
Member

djc commented Oct 11, 2021

@jsha are you interested in rebasing this for the next release?

@jsha jsha force-pushed the printer branch 2 times, most recently from 0aa1c18 to 3b23214 Compare October 11, 2021 16:50
@jsha
Copy link
Contributor Author

jsha commented Oct 11, 2021

Done!

@djc djc merged commit ccdac5d into rustls:main Oct 13, 2021
@djc
Copy link
Member

djc commented Oct 13, 2021

Thanks!

@jsha jsha deleted the printer branch June 12, 2022 16:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants