Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Read Remote Machine Certificate

We can use the X509store to load the store and find the certificates in local machine but how to do the same for a certificate sitting on remote server?

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);
like image 348
Rakesh Vasu Avatar asked Jun 19 '15 17:06

Rakesh Vasu


1 Answers

You can use this X509Store overload: https://msdn.microsoft.com/en-us/library/f07btzah(v=vs.110).aspx

where you can specify remote server path: \\RemoteServerName\My in the storeName parameter.

like image 84
Crypt32 Avatar answered Oct 07 '22 00:10

Crypt32