forderud / WindowsClientAuth

Windows examples of certificates for client authentication in web and TLS socket scenarios
MIT License
3 stars 0 forks source link

Access certificates in "Local Computer" store from C++/UWP #13

Open forderud opened 1 year ago

forderud commented 1 year ago

Associated Microsoft doc. issue: https://github.com/MicrosoftDocs/winrt-api/issues/2288

The current C++ & C# samples projects are only able to utilize client certificates stored in the Current User\Personal store. This is fine for end-user authentication purposes, but not so good for machine/computer authentication.

Task: Figure out how to use client certificates stored in the Local Computer\Personal store as already done by Intune: image

Associated doc:

forderud commented 1 year ago

The problem might be worked around by instead storing the certificate under Local Computer\Trusted People. It can then be retrieved using X509Store(StoreName.TrustedPeople, StoreLocation.CurrentUser) in C# and query.StoreName(L"TrustedPeople") in C++.

However, I've not been able to utilize certificates stored in "Trusted People" for a mTLS handshake yet. Don't understand why it doesn't work..