Accessing Windows Certificate Store certs via Java?

Benjin picture Benjin · Dec 8, 2015 · Viewed 17.2k times · Source

I'm looking to write something that can enumerate and use (to sign) certificates in CurrentUser/My and LocalMachine/My, but I haven't been able to find anything for the Windows cert store, only Java's own secret store. This link looks promising, but I can only use what ships with Java.

I found this question asked on SO before, but it's from five years ago, which is a long time in computer years. Thanks!

Answer

michael.kebe picture michael.kebe · Sep 14, 2018

Start Java with -Djavax.net.ssl.trustStoreType=WINDOWS-ROOT.

See https://www.oracle.com/technical-resources/articles/javase/security.html for more information.