简体   繁体   English

是DER格式ASN1编码的X509证书吗?

[英]Is a X509 certificate in DER format ASN1 encoded?

I'm using OpenSSl to encrypt and decrypt files based on CMS/SMIME. 我正在使用OpenSSl来加密和解密基于CMS / SMIME的文件。 Normally I load certificates with rcert = PEM_read_bio_X509(tbio, NULL, 0, NULL); 通常我用rcert = PEM_read_bio_X509(tbio, NULL, 0, NULL);加载证书rcert = PEM_read_bio_X509(tbio, NULL, 0, NULL); but this is only for PEM formatted files I guess. 但这仅适用于PEM格式的文​​件。 I haven't found any der.h header or something similar. 我没有找到任何der.h标题或类似的东西。

So is there a way in OpenSSL to load DER formatted certificates? 那么在OpenSSL中是否有一种方法可以加载DER格式的证书? I've found the load function for ASN1 format which uses OpenSSL intern. 我找到了使用OpenSSL实习生的ASN1格式的加载函数。

if  (format == FORMAT_ASN1)
        x=d2i_X509_bio(cert,NULL);

But can that be used for DER which is binary? 但这可以用于二进制的DER吗?

DER确实使用ASN.1编码,而d2i_*()函数系列是加载DER文件的方法。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM