Working with openssl to extract information from a pkcs12 certificate

Try this:

$ openssl pkcs12 -in ~/cert.p12 -nodes \
    -passin pass:"my password" | openssl x509 -noout -subject

Or this for the common name (ruby to strip trailing whitespace):

$ openssl pkcs12 -in ~/cert.p12 -nodes \
    -passin pass:"my password" | openssl x509 -noout -subject \
    | awk -F'[=/]' '{print $6}'`.strip`

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)