[英]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.