对于此证书,以下呼叫的参数应该是什么?我尝试了以下操作,但没有用。
X509CertificateInitiatorClientCredential.ClientCertificate.SetCertificate(
StoreLocation.LocalMachine
,StoreName.CertificateAuthority
,X509FindType.FindBySubjectName
,"CN=MPCA" // also tried without CN=
);
答案 0 :(得分:0)
证书工具的TrustedRootCertificateAuthorities
商店名称映射到.NET X509 API中的StoreName.Root
。
X509CertificateInitiatorClientCredential.ClientCertificate.SetCertificate(
StoreLocation.LocalMachine
,StoreName.Root
,X509FindType.FindBySerialNumber
,"FA###########434" // serial found by enumerating all certs
);
或者:
X509CertificateInitiatorClientCredential.ClientCertificate.SetCertificate(
StoreLocation.LocalMachine
,StoreName.Root
,X509FindType.FindBySubjectName
,"MPCA" // Without CN=
);