Extracting x509 certificates from a p7m file

A client emailed me a new TLS certificate for their server as a p7m file. Normally I’d get this from the CA as a PEM encoded x509 certificate.

Fortunately openssl can easily convert this

openssl pkcs7 -inform DER -in certificate.p7m -print_certs -out certificate.pem

I used a text editor to separate the SSL certificate from the intermediate certificates, since I have Apache configured to expect these in separate file.

Advertisements
Tagged with: ,
Posted in linux, openssl
One comment on “Extracting x509 certificates from a p7m file
  1. Normally I’d get this from the CA as a PEM encoded x509 certificate.?

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: