user7336033
user7336033

Reputation: 297

Cannot find certificate in client side while calling web service

I've a windows service application developed in C#.Net which is communicating with Web service developed in Java (from client). This web service is certificate validated that's why every time I need to read the certificate before calling the web service. But when ever I'm trying to get the certificate by Subject name or Thumbnail then I'm getting different error for each type. And cannot read the certificate at all.

Here is my code:

 <clientCertificate storeLocation="CurrentUser" storeName="My" findValue="‎176455DB76886FF2BA3C122F8B36322F647CB2FD"  x509FindType="FindByThumbprint" />

If I try to find the certificate using Thumbnail like above then I'm hitting below error:

invalid hexadecimal string format. inner exception null

Here is the second way I'm trying to call the certificate:

<clientCertificate storeLocation="CurrentUser" storeName="My" findValue="‎CN=EO_UA_test, T=Privatmoney, OU=EO_UA_test, O=EO_UA_test, L=Dnepropetrovsk, C=UA"  x509FindType="FindBySubjectName" />

And here is the error I'm hitting while applying the above technique:

Cannot find the X.509 certificate using the following search criteria: StoreName 'My', StoreLocation 'CurrentUser', FindType 'FindBySubjectName', FindValue '‎CN=EO_UA_test, T=Privatmoney, OU=EO_UA_test, O=EO_UA_test, L=Dnepropetrovsk, C=UA'.

For the 2nd error I've tried without "CN=" but still I'm getting the same error. Also, I've checked the certificate using MMC.exe and I can find my certificate is existing under CurrentUser->personal Please suggest me on the above.

Upvotes: 0

Views: 673

Answers (1)

Thomas
Thomas

Reputation: 93

If you have copied the thumbprint from the MMC Certificates console, Details section->Thumbprint - this also copies an unvisible character in front of the first one. Just position the cursor before the first character and press the backspace once.

(I am sorry if this doesn't help, and it is not an answer to you. I don't have enough points to write comments:)

Upvotes: 2

Related Questions