Jo Grant wrote:
I'm using JSS 3.4 (with NSS 3.10) in a Java application.  The Java app
cannot see token events (such as smart card insertions and removals)
unless I exit the app and restart.  The public JSS methods
PK11Module.getTokens() and CryptoManager.getModules() return JSS's
snapshot of the tokens and modules present when the app started.  The
private JSS methods PK11Module.reloadTokens() and
CryptoManager.reloadModules() return NSS's snapshot of the tokens and
modules present when the app started (I made them public and called
them; this is what I saw).

When the Certificate Manager window is opened (or
chrome://pippki/content/certManager.xul is reloaded in the browser) the
certificates list is current, displaying only the certs on the inserted
tokens (therefore, I know that this functionality exists somewhere in
Mozilla).

How do I get JSS to take a current snapshot of the modules and tokens
without restarting the app?

NSS always returns the current list of available certs, including any inserted tokens (note: many tokes need to be authenticated before their certs are visible). If you aren't seeing an 'up-to-date' list then either: 1) you need to make sure the tokens are authenticated. NSS will automatically call the password callback to try to authenticate these tokens. Most server apps only initialize the tokens at startup, and do not allow tokens to be added on the fly. Since JSS was designed to support those apps, it may be that JSS is doing the same. 2) you need to make sure JSS is not caching it's view of the certificates. Mozilla keeps a cert cache for fast display, but refreshes that cache when the dialog is first launched.

Mozilla 1.5 has an monitoring thread which detects token insertion events using SECMOD_WaitForAnyTokenEvent(), so not only is the display up-to-date when the dialog is displayed, but also handles real-time token insertions. When you plug in a token, the display is automatically refreshed.

bob
Thanks.

_______________________________________________
mozilla-crypto mailing list
[email protected]
http://mail.mozilla.org/listinfo/mozilla-crypto

Attachment: smime.p7s
Description: S/MIME Cryptographic Signature

Reply via email to