To export a certificate CER file to PEM format

Source: Internet
Author: User
Tags openssl rsa pkcs12

(1) The certificate of the pilot push services, for example, we named "MAGIC_CERT.P12", note that the export will let you enter the password.

(2) Re-export the key for the Push services certificate (Private key), for example, we named "MAGIC_KEY.P12":

5. Convert the P12 file to a PEM file.

(1) Convert two p12 files to a PEM format file, respectively.

Open terminal, and you can convert by typing a command.

The first one:

OpenSSL pkcs12-clcerts-nokeys-out magic_cert.pem-in MAGIC_CERT.P12

The second one:

OpenSSL pkcs12-nocerts-out magic_key.pem-in MAGIC_KEY.P12

Note that you will be prompted to enter the password you exported earlier when you exported the certificate in the keychain.

Note: If the final PEM does not require a password when it is used on the server system, you can execute a command to remove the password:

OpenSSL rsa-in Magic_key.pem-outmagic_key_nopwd.pem

Finally, two PEM files are generated, such as "Magic_cert.pem", "Magic_key.pem or Magic_key_nopwd.pem".

(2) Merge two PEM files into a PEM file required by the server system.

The command line execution is still available:

Cat Magic_cert.pem Magic_key.pem >MAGIC-DEV.PEM

Or do not require a password:

Cat Magic_cert.pem Magic_key_nopwd.pem >MAGIC-DEV.PEM

Eventually, a "Magic-dev.pem" is generated for use by the service-side system.

6, OK, finish the call.

To export a certificate CER file to PEM format

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.