简体   繁体   English

读远程机器证书

[英]Read Remote Machine Certificate

We can use the X509 store to load the store and find the certificates in local machine but how to do the same for a certificate sitting on remote server? 我们可以使用X509商店加载商店并在本地机器中查找证书,但如何对远程服务器上的证书执行相同操作?

I know we can configure a network account to have permissions on the certificate in remote machine but how to use this network account to read certificate details? 我知道我们可以配置网络帐户以获得远程计算机上的证书的权限,但如何使用此网络帐户来读取证书详细信息?

X509Store store = new X509Store(StoreName.My, StoreLocation.LocalMachine);
store.Open(OpenFlags.ReadOnly);
X509Certificate2Collection results = store.Certificates.Find(X509FindType.FindBySubjectName, "CertName", false);

You can use this X509Store overload: https://msdn.microsoft.com/en-us/library/f07btzah(v=vs.110).aspx 您可以使用此X509Store重载: httpsX509Store = X509Store

where you can specify remote server path: \\\\RemoteServerName\\My in the storeName parameter. 您可以在其中指定远程服务器路径: storeName参数中的\\\\RemoteServerName\\My

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

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