在DER格式ASN1一个X509证书EN codeD? [英] Is a X509 certificate in DER format ASN1 encoded?

查看:541
本文介绍了在DER格式ASN1一个X509证书EN codeD?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用OpenSSL加密和解密基于CMS / SMIME文件。通常我加载使用 rcert = PEM_read_bio_X509(tbio,NULL,0,NULL)证书; 但这仅是对PEM格式的文​​件,我猜。我还没有发现任何 der.h 头或类似的东西。

I'm using OpenSSl to encrypt and decrypt files based on CMS/SMIME. Normally I load certificates with rcert = PEM_read_bio_X509(tbio, NULL, 0, NULL); but this is only for PEM formatted files I guess. I haven't found any der.h header or something similar.

那么,有没有在OpenSSL的方式来加载DER格式的证书吗?我已经找到了它使用OpenSSL的实习生 ASN1 格式加载功能。

So is there a way in OpenSSL to load DER formatted certificates? I've found the load function for ASN1 format which uses OpenSSL intern.

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

但这样的用于DER是二进制?

But can that be used for DER which is binary?

推荐答案

DER的确是EN codeD用ASN.1,而 d2i _ *()家庭功能是加载一个DER文件的方式。

DER is indeed encoded using ASN.1, and the d2i_*() family of functions is the way to load a DER file.

这篇关于在DER格式ASN1一个X509证书EN codeD?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆