4

It is possible to write a Java program to read one certificate (getting private and public key) stored in windows certificate store ?

Thanks

Zé Carlos
  • 3,627
  • 5
  • 43
  • 51

1 Answers1

7

If you are on Java 6, you can use the MSCAPI keystore to read it. Just open your keystore like this,

      KeyStore msCertStore = KeyStore.getInstance("Windows-MY", "SunMSCAPI");
ZZ Coder
  • 74,484
  • 29
  • 137
  • 169
  • Thanks. "Windows-MY" refers to ROOT\Personal. And what if i need to look for certificates in other location, for exemple ROOT\MyOwnFolder ? – Zé Carlos Jun 11 '10 at 23:11
  • 2
    No. You can't read arbitrary store with MSCAPI keystore. The only other store you can read is "WINDOWS-ROOT". – ZZ Coder Jun 12 '10 at 01:49