Unable to create .pem file from .p12 (private key + public key)

◇◆丶佛笑我妖孽 提交于 2020-04-18 05:44:45

问题


I am trying to create .pem file from .p12 file with below command,

openssl x509 -inform der -in Certificates.p12 -out Certificates.pem

But getting below error:

4412094060:error:0DFFF0A8:asn1 encoding routines:CRYPTO_internal:wrong tag:/BuildRoot/Library/Caches/com.apple.xbs/Sources/libressl/libressl-22.260.1/libressl-2.6/crypto/asn1/tasn_dec.c:1125:
4412094060:error:0DFFF03A:asn1 encoding routines:CRYPTO_internal:nested asn1 error:/BuildRoot/Library/Caches/com.apple.xbs/Sources/libressl/libressl-22.260.1/libressl-2.6/crypto/asn1/tasn_dec.c:306:Type=X509_CINF
4412094060:error:0DFFF03A:asn1 encoding routines:CRYPTO_internal:nested asn1 error:/BuildRoot/Library/Caches/com.apple.xbs/Sources/libressl/libressl-22.260.1/libressl-2.6/crypto/asn1/tasn_dec.c:627:Field=cert_info, Type=X509

Any idea how to resolve it?


回答1:


Below command worked fine,

openssl pkcs12 -in Certificates.p12 -out Certificates.pem -nodes -clcerts


来源:https://stackoverflow.com/questions/60754143/unable-to-create-pem-file-from-p12-private-key-public-key

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!