Showing posts with label openssl. Show all posts
Showing posts with label openssl. Show all posts

Saturday, 25 October 2014

Export private and public keys from a PKCS12 keystore


Both keys into the same PEM file
openssl pkcs12 -in keystore.p12 -passin "pass:password" -nodes -out keypair.pem

Separate PEM files
openssl pkcs12 -in keystore.p12 -passin "pass:password" -nodes -nocerts -out private_key.pem
openssl pkcs12 -in keystore.p12 -passin "pass:password"  -nokeys -out public_key.pem 

Tuesday, 6 November 2012

View certificate chains with Open SSL

openssl s_client -showcerts -connect <host>:<port>

Check certificate expiry as follows

 openssl s_client -connect google.com:443 < /dev/null | openssl x509 -text | grep "Not After"