Skip to content

cmdscale/x509-certificate-printer

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

cert-printer

A Rust CLI tool that parses and prints X.509 certificate information in both human-readable and PEM formats.

Usage

cargo run -- <certificate_file>

The tool accepts certificates in DER or PEM format.

Library Usage

The x509_certificate_printer crate exposes a PrettyPrinter trait:

use x509_certificate_printer::PrettyPrinter;
use x509_parser::prelude::*;

let der_cert = std::fs::read("cert.der")?;
let (_, x509) = parse_x509_certificate(&der_cert)?;

println!("{}", x509.pretty_print());
println!("{}", x509.to_pem());

Trait Methods

  • pretty_print(&self) -> String - Returns human-readable certificate details
  • to_pem(&self) -> String - Returns PEM-encoded certificate

Credits

This code is verbatim taken from x509-parser/examples/print-cert.rs and AI-refactored into a library with a CLI interface.

About

Basic Prettyprinter for Crate x509_parser

Resources

License

Apache-2.0, MIT licenses found

Licenses found

Apache-2.0
LICENSE-APACHE
MIT
LICENSE-MIT

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages