OpenSSL Debugging commands

Check an MD5 hash of the public key to ensute that it matches with the CSR or private key

openssl x509 -noout -modulus -in certificat.cer | openssl.exe md5
openssl rsa -noout -modulus -in key.key | openssl.exe md5
openssl req -noout -modulus -in reqCSR.csr | openssl.exe md5

Commands that allows to convert to different formts

  • Convert a DERfile (.crt .cer. der) to PEM
openssl x509 -inform der -in certificate.cer -out certificate.pem
  • Convert PEM file to DER
openssl x509 -outform der -in certificate.pem -out certificate.der
openssl pkey -in privateKey.key -pubout -outform pem | sha256sum
openssl x509 -in certificate.crt -pubkey -noout -outform pem | sha256sum
openssl req -in CSR.csr -pubkey -noout -outform pem | sha256sum
This entry was posted in Uncategorized. Bookmark the permalink.

Leave a Reply