lairtech
lairtech

Reputation: 2417

UWP- How to get Local Machine certificates?

How can we access Local Machine certificates in UWP? CertificateStores::FindAllAsync is not working. It works for the user store.

Upvotes: 0

Views: 558

Answers (1)

Roy Li - MSFT
Roy Li - MSFT

Reputation: 8681

To certs from the Local Machine store, you could Use FindAllAsync(CertificateQuery). Pass store name through Certificate query like this:

    var query = new CertificateQuery();
    query.StoreName = "ROOT";
    return CertificateStores.FindAllAsync(query)

FindAllAsync() only get certificates from the App’s store. If the app has shareusercertificates capability, this call will also retrieves certs from the User store.

Upvotes: 1

Related Questions