gpt4 book ai didi

x509certificate - 将 pkcs12 文件转换为 pem 时出现问题

转载 作者:行者123 更新时间:2023-12-04 17:32:39 25 4
gpt4 key购买 nike

我正在尝试使用 openssl 将客户端证书从 pkcs12 类型转换为 pem 文件,但我的终端上显示此错误。有谁知道为什么会这样?我没有编辑或手动更改 p12 文件。即使我尝试从 .p12 文件中获取一些信息,它也会显示错误。

# openssl pkcs12 -in Desktop/cert.p12 -nokeys -out Desktop/cert-file.pem
139728018543680:error:0D0680A8:asn1 encoding routines:asn1_check_tlen:wrong tag:../crypto/asn1/tasn_dec.c:1130:
139728018543680:error:0D07803A:asn1 encoding routines:asn1_item_embed_d2i:nested asn1 error:../crypto/asn1/tasn_dec.c:290:Type=PKCS12

最佳答案

您的证书看起来像 PEM 证书,您正在再次将其转换为 PEM。

只需保留 -----BEGIN CERTIFICATE----------END CERTIFICATE----- 之间的内容即可编辑证书 然后尝试。它应该有效。

示例:

-----BEGIN CERTIFICATE-----
MIIGJjCCBA6gAwIBAgIJAMDVkmXEzJzZMA0GCSqGSIb3DQEBCwUAMIGiMRUwEwYD
YTESMBAGA1UEBxMJQ3liZXJqYXlhMSkwJwYDVQQKEyBJbmxhbmQgUmV2ZW51ZSBC
b2FyZCBPZiBNYWxheXNpYTEqMCgGA1UECxMhSW50ZXJuYXNpb25hbCBUYXhhdGlv
biBEZXBhcnRtZW50MB4XDTE4MDEwODEwMDk0M1oXDTQ2MDEyMTEwMDk0M1owgaIx
FTATBgNVBAMTDGhhc2lsLmdvdi5teTELMAkGA1UEBhMCTVkxETAPBgNVBAgTCE1h
bGF5c2lhMRIwEAYDVQQHEwlDeWJlcmpheWExKTAnBgNVBAoTIElubGFuZCBSZXZl
AQDR1Ws2Wmao88RyDs6Mlc3IfEDTanGB6+93ppe94CcA/9nwgiOXMEuMaiu7oF2m
/FMsu2vVoPpXnuqvtANoJsc7jcAXottvEF8sthibTOR98N++QHo9wbUl2uhfJzxK
uEH3Pa0ekSAZN1I0EUdfOmn8lY0fui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64tZWK07q9TJzo5asQ+2OdtcuuPVuPdBEC8eDtI0JpgKwX0PUxjsciXYwYFGAb3z
xooszCvWH+MJ0zv3jWYbr1DtgWnTSumb8GlhPuF3t+vfOZ1enlYnrHiRaDCXRLOo
t9yO0hsa9Sotz3Rbfc2MQuT9PRSW+2w8cTOtJZkh7QvX9q8TlwSENKRp
-----END CERTIFICATE-----

关于x509certificate - 将 pkcs12 文件转换为 pem 时出现问题,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/58042381/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com