Read Remote Machine Certificate

5.3k views Asked by At

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);
1

There are 1 answers

7
Crypt32 On BEST ANSWER

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.