简体   繁体   English

如何访问C#中的“证书注册请求”存储?

[英]How can I access the “certificate enrollment requests” store in C#?

How do I access via C# the keys stored in the Certificate Enrollment Requests store? 如何通过C#访问“证书注册请求”存储中存储的密钥?

证书注册请求

I tried using: 我尝试使用:

var requestCertStore = new X509Store("Certificate Enrollment Requests", 
                                     StoreLocation.LocalMachine);
requestCertStore.Open(OpenFlags.MaxAllowed);
var certs = requestCertStore.Certificates;

but the certs collection does not contain the certificate I'm looking to access in the "Certificate Enrollment Requests" store. certs集合不包含我要在“证书注册请求”存储中访问的证书。 I also don't see any StoreName enum that corresponds to this store, so using the new X509Store(StoreName storeName, StoreLocation storeLocation) constructor isn't an option. 我也没有看到与此商店对应的任何StoreName枚举 ,因此不能使用new X509Store(StoreName storeName, StoreLocation storeLocation)构造函数。

Is it not possible to retrieve these certs via C#/.NET? 是否无法通过C#/。NET检索这些证书?

The solution is to use "REQUEST" instead of "Certificate Enrollment Requests" : 解决方案是使用"REQUEST"代替"Certificate Enrollment Requests"

var requestCertStore = new X509Store("REQUEST", StoreLocation.LocalMachine);
requestCertStore.Open(OpenFlags.MaxAllowed);
var certs = requestCertStore.Certificates;

I found the hint here: Delete a pending certificate request . 我在这里找到了提示: 删除待处理的证书请求

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

相关问题 C# Active Directory - 如何从注册服务目录 object 加载“certificateTemplates”属性? - C# Active Directory - How can I load the “certificateTemplates” Property from an Enrollment Services directory object? 如何使用c#以编程方式将证书安装到本地计算机存储中? - How can I install a certificate into the local machine store programmatically using c#? 我们如何在 windows 存储 + C# 中存储和检索包含私钥的证书 - How can we store and retrieve a certificate containing private key in a windows store + C# C#,如何将证书添加到HttpClientHandler? - C#, How can I add the certificate to the HttpClientHandler? 如何在C#中实现密钥库(证书)soapui? - How can i implement keystore (certificate) soapui in C#? 如何使用C#访问SQLite? - How can I access SQLite with C#? 如何在C#中访问它? - How can I access this in C#? 如何通过C#代码获取中间证书和受信任的根证书的到期日期? - How can I get the expiration date of an intermediate certificate and trusted root certificate by C# code? C#BouncyCastle-如何为该证书创建sha512ECDSA证书和有效的证书吊销列表? - C# BouncyCastle-How can I create a sha512ECDSA certificate and a valid certificate revocation list for this certificate? 如何使用C#从本地计算机商店读取PFX证书 - How to Read PFX Certificate from local machine Store with C#
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM