简体   繁体   English

在Windows上使用带有OpenSSL的受信任证书

[英]Using trusted certificate on Windows with OpenSSL

I'm using OpenSSL on Windows and would like to use a certificate in Windows Certificate Storage as a trusted CA container with CASSL_CTX_load_verify_locations() . 我在Windows上使用OpenSSL,并且想将Windows证书存储中的证书用作带有CASSL_CTX_load_verify_locations()的受信任CA容器。 Unfortunately, OpenSSL only supports PEM files and don't allow direct access to the Windows Certificate Storage. 不幸的是,OpenSSL仅支持PEM 文件 ,不允许直接访问Windows证书存储。 How can I make this work on Windows, do I have to use the Windows CryptoAPI and dump the certificate as a PEM file to disk or is there a better way of doing this? 我如何才能在Windows上执行此操作,我是否必须使用Windows CryptoAPI并将证书作为PEM文件转储到磁盘,还是有更好的方法呢?

OpenSSL also supports DER format or PKCS #8 format. OpenSSL还支持DER格式或PKCS#8格式。 You can get certificate in PKCS #8 or DER format using CryptoAPI and then load them into the certificate store given by OpenSSL. 您可以使用CryptoAPI获取PKCS#8或DER格式的证书,然后将其加载到OpenSSL给出的证书存储中。 So, there is better way of doing it. 因此,有更好的方法。 Once you have certificate in DER format, you can used d2i functions to get certificate into X509 certificate. 获得DER格式的证书后,就可以使用d2i函数将证书转换为X509证书。

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

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