Register / Login  |  Desktop view  |  Jump to bottom of page

General Issues » Open the local machine store

Author: Anonymous, Visitor
24/10/2006 17:44:27
Hello,

Thanks to the exemple provided (ListAllCerts.java), i have succeeded in listing certificates from the personnal store, but for the current user.

I would like to do the same (open the personnal store) but for the local machine.

Does anyone ever tried to do this ?

Thanks for your help.

Author: tommy, Visitor
24/10/2006 22:13:52
Hi,

The bad news is that JCAPI is hardcoded to use CERT_SYSTEM_STORE_CURRENT_USER as the high word of the input flags to the MS CAPI function 'CertOpenStore()', which shortly means that you can only get the certificates for the current user.
The good news is that the high word is already defined in a global variable that is OR:ed with the flags for each invocation of the CertOpenStore() function, which means that it's simple to solve your issue. We can just add a new Java method (and some constants for the different system store registry locations) which will give the user the opportunity to change the global variable via JNI.

We can add this new functionality into the next JCAPI maintenance release (which is currently under development) and supply you with a release candidate at the end of this week.

Regards,
Tommy


Author: tommy, Visitor
29/10/2006 21:38:08
Hi,

We have now added your needed functionality into JCAPI. This is a very early release candidate of the next version (v1.2), so we have decided to not publish it on our public download page. Instead you can download it from the link below.
Note: make sure that you delete the old JCAPI DLL file before you use the new JCAPI JAR file:
C:\Documents and Settings\your user\Local Settings\Temp\JCAPI.dll

The following new methods have been added into the JCAPIProperties class:

The new class JCAPISystemStoreRegistryLocation defines the following static registry locations for your convenience:

In your specific case when using the local machine, you could use the following code:

JCAPISystemStoreRegistryLocation location =
new JCAPISystemStoreRegistryLocation(JCAPISystemStoreRegistryLocation.CERT_SYSTEM_STORE_LOCAL_MACHINE);
JCAPIProperties.getInstance().setSystemStoreRegistryLocation(location);


Please let us know if you encounter any problems.

Regards,
Tommy

Filename JCAPI.jar
Description JCAPI v1.2 RC-1
Filesize 103 Kbytes
Downloaded 44 time(s)
[Disk] Download





Register / Login  |  Desktop view  |  Jump to top of page