Linux come visualizzare un certificato in formato PEM da riga di comando

28 aprile 2017

Se vogliamo visualuzzare le informazioni di un certificato in formato PEM da riga di comando possiamo utilizzare openssl.
L'output del seguente comando fornirà le informazioni cercate:
# ​openssl x509 -in certificato.pem -noout -text
Certificate:
Data:
Version: 3 (0x2)
Serial Number:
01:c8:2e:ca:df:3a:bf:91:73:7e:36:ed:2a:31:6e:cc:32:1a
Signature Algorithm: sha256WithRSAEncryption
Issuer: C=US, O=Let's Encrypt, CN=Let's Encrypt Authority X3
Validity
Not Before: Apr 25 01:08:00 2017 GMT
Not After : Jul 24 01:08:00 2017 GMT
.....................................................