I want to extract all trusted root certificates from the windows certificate store in *.PEM format. The functionality to look at certificates in the windows certificate store seems reside within the wincrypt library (crypt32.dll).
Reading this documentation it seems easy to get all the properties from a certificate, but I'm completely lost on how to put it together so it satisfies the criteria for certificate. Checking this topic gave me hope that wincrypt would help me accomplish this task maybe via CryptEncodeObjectEx.
In any case, my question is how can I do this in the most simple way?