From 23f894be98c979d5dbf6fbb9f2ec20fe75b37290 Mon Sep 17 00:00:00 2001 From: Franck Cuny Date: Sun, 13 Nov 2022 15:20:52 -0800 Subject: doc: update README --- src/x509-info/README.md | 62 +++++++++++++++++++++++++++++++++++++++++++------ 1 file changed, 55 insertions(+), 7 deletions(-) (limited to 'src') diff --git a/src/x509-info/README.md b/src/x509-info/README.md index 39fc564..61d450e 100644 --- a/src/x509-info/README.md +++ b/src/x509-info/README.md @@ -4,14 +4,62 @@ At this point it's pretty clear that I'll never remember the syntax for `openssl` to show various information about a certificate. At last I will not have to google for that syntax ever again. +## Usage + ``` shell -$ x509-info github.com - Subject: CN=github.com O=GitHub, Inc. L=San Francisco - Issuer: CN=DigiCert TLS Hybrid ECC SHA384 2020 CA1 O=DigiCert Inc L= - DNS Names: github.com, www.github.com - Validity Period - Not before: 2022-03-14T17:00:00-07:00 - Not After: 2023-03-15T16:59:59-07:00 +> x509-info --help +Usage: x509-info [OPTIONS] + +Arguments: + + Domain to check + +Options: + -p, --port + Port to check + + [default: 443] + + -f, --format + [default: short] + + Possible values: + - short: Format the output as one line of plain text + - long: Format the output as plain text + + -h, --help + Print help information (use `-h` for a summary) + + -V, --version + Print version information ``` +The default format will print a short message: + +``` shell +> x509-info twitter.com +twitter.com is valid until Mon, 12 Dec 2022 15:59:59 -0800 (29 days left) +``` + +It's possible to get more details: + +``` shell +> x509-info --format long twitter.com +certificate + version: V3 + serial: 0d:e1:52:69:6b:2f:96:70:d6:c7:db:18:ce:1c:71:a0 + subject: C=US, ST=California, L=San Francisco, O=Twitter, Inc., CN=twitter.com + issuer: C=US, O=DigiCert Inc, CN=DigiCert TLS RSA SHA256 2020 CA1 + validity + not before : Sun, 12 Dec 2021 16:00:00 -0800 + not after : Mon, 12 Dec 2022 15:59:59 -0800 + validity days : 364 + remaining days: 29 + SANs: + DNS:twitter.com + DNS:www.twitter.com +``` + +## Notes + Could the same be achieved with a wrapper around `openssl` ? yes. -- cgit v1.2.3