Skip to content

Instantly share code, notes, and snippets.

@daniDLL
Last active September 24, 2020 08:07
Show Gist options
  • Save daniDLL/70f7a65c04f70ce71821c323ee3c8b3b to your computer and use it in GitHub Desktop.
Save daniDLL/70f7a65c04f70ce71821c323ee3c8b3b to your computer and use it in GitHub Desktop.
Check Match Certificates
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
1. Extract .key from .pem:
`openssl pkey -in cert.pem -out cert.key`
2. Extract .crt from .pem:
`openssl crl2pkcs7 -nocrl -certfile cert.pem | openssl pkcs7 -print_certs -out cert.crt`
3. Extract .pem from .pfx
`openssl pkcs12 -in cert.pfx -nocerts -out cert.pem -nodes`
4. Extract .crt from .pfx
`openssl pkcs12 -in cert.pfx -nokeys -out cert.crt -nodes`
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment