how to extract issuer certificate from other certificate
openssl
Solution
- `openssl x509 -in cert.x509 -text` Find the URL of the signing certificate.
- `curl (url) >signer.der` Download the signing certificate to a file (DER format in my case).
- `openssl x509 -inform der -in signer.der -out signer.pem` Convert signing certificate to PEM (X.509) format.
- `openssl x509 -in signer.pem -text` Confirm your results. Repeat procedure as necessary all the way up the certificate chain.
Problem
I have a certificate in X.509 format. Using openssl I want to extract the issuer's certificate into a file, also in X.509 format (so that I can whitelist the issuer in my web service). How do I do this? The following command did not work, it only printed the issuer information in text form. `openssl x509 -in cert.x509 -issuer -out issuer.x509`