Is there a way to access the windows local machine personal key storage with Java using SunMSCAPI?
Usually, you can use either WINDOWS-ROOT (which is roughly the equivalent to the trusted storage in Java) or WINDOWS-MY (which contains the personal certificates which is roughly equivalent to the key storage in Java) to retrieve certificates from the windows certificate storage.
This works fine for users, but even when impersonating the SYSTEM user, I was not able to retrieve the local machine's personal certificates.
There exist some questions regarding this that use JNA (which I would like to avoid, especially since it seems to be complicated to retrieve the private key from there).
Also, someone used psexec to impersonate the SYSTEM user (using psexec -s). I also tried this, but have not been successful.
In the end, there is also an open bug in the Java Bug System.
If anyone has an idea on how to retrieve certificates from the local machine personal storage in windows using Java, I would be grateful.