C $ C $等价的C的C#安装证书 [英] C code equivalent of C# to install certificate

查看:149
本文介绍了C $ C $等价的C的C#安装证书的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我发现下面的code到A证书安装到信任的发布者本地计算机。但是,code是在C#我想在C.做如何将其转换为C一样的吗?

I found the below code to install a certificate into local machines trusted publisher. But the code is in C# I want the same to be done in C. How to convert this to C?

private static void InstallCertificate(string cerFileName)
{
  X509Certificate2 certificate = new X509Certificate2(cerFileName);
  X509Store store = new X509Store(StoreName.TrustedPublisher,StoreLocation.LocalMachine);
  store.Open(OpenFlags.ReadWrite);
  store.Add(certificate);
  store.Close();
 }

所有的Windows API可用?

Any Windows APIS available?

推荐答案

尝试一下libpkix LIB

Try to look at libpkix lib

libpkix文库的目的是提供一种广泛有用的C
  库,用于构建和验证X.509证书链,
  符合最新的IETF PKIX标准(即RFC 3280)。这个
  项目的目标是为所有强制提供完整的支持
  RFC 2459的特性,以及多个可选特征

The purpose of the libpkix library is to provide a widely useful C library for building and validating chains of X.509 certificates, compliant with the latest IETF PKIX standards (namely, RFC 3280). This project aims to provide complete support for all the mandatory features of RFC 3280, as well as a number of optional features.

这篇关于C $ C $等价的C的C#安装证书的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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