How Do I Convert a Certificate to PEM Format?
Certificate formats can be converted mutually.
It is recommended that OpenSSL be used to convert certificates in other formats into the PEM format. The following examples illustrate some popular conversion methods.
Converting the Certificate Format to PEM
| Format | Conversion Method (Using OpenSSL) |
|---|---|
| CER/CRT | Rename the cert.crt certificate file to cert.pem. |
| PFX |
|
| P7B |
|
| DER |
|
PKCS8 Certificate Encoding Format
Currently, HUAWEI CLOUD WAF, ELB, and CDN do not support the PKCS8 format. An error will occur if you upload a certificate in PKCS8 format to SCM and then push the certificate to WAF, ELB, and CDN.
- If the private key file of a certificate starts with -----BEGIN PRIVATE KEY-----, the certificate is in PKCS8 format.
- If the private key file of a certificate starts with -----BEGIN RSA PRIVATE KEY-----, the certificate is in PKCS1 format.
If your public or private key is in PKCS8 format, perform the following operations to use the PKCS8 certificate to WAF, ELB, and CDN services:
- Check whether the certificate is in PEM format.
- If yes, go to Step 2.
- If no, convert the certificate format to PEM by referring to Converting the Certificate Format to PEM and then go to 2.
- Run the following commands to convert format from PKCS8 to PKCS1:
- Upload the converted certificate to SCM. For more details, see Uploading an External Certificate.
- Push the uploaded certificate to other HUAWEI CLOUD service. For more details, see Pushing an SSL Certificate to Other Cloud Services.
Did this article solve your problem?
Thank you for your score!Your feedback would help us improve the website.