Hello Diego,

You should be able to see the public info of the certificates without 
specifying the password.  For example, this worked for me:

  // initialize cryptomanager...
  CryptoManager manager = CryptoManager.getInstance();
  CryptoToken token = manager.getInternalKeyStorageToken();
  CryptoStore store = token.getCryptoStore();
  X509Certificate certs[] = store.getCertificates();
  for(i=0; i < certs.length; i++)
    System.out.println( certs[i].getNickname() );

You won't be able to see private key info until you specify the 
password, which seems like the behavior you want.

hth,
Dennis

Diego Augusto wrote:
> Hi all!
> 
> I'm using JSS and I have a question:
> Is there a way of get information of certificates without enter the
> password of a token?
> 
> We have identified some points that the password callback is called.
> See the following example:
> 
> //initialization code...
> CryptoManager cryptoManagerInstance = CryptoManager.getInstance();
> CryptoToken cryptoTokenInstance =
> cryptoManagerInstance.getAllTokens();
> 
> // for each token
> cryptoTokenInstance.isPresent(); //the password callback is called
> X509Certificate[] jssX509col = ct.getCryptoStore().getCertificates();
> //the password callback is called
> 
> cryptoTokenInstance.getCryptoStore().getPrivateKeys(); //the password
> callback is called
> 
> As we can see, for each call of 'isPresent' method and when getting
> the certificates of a token, the passwordCallback will be called. This
> behavior can be too annoying if the users needs enter the password for
> all crypto tokens (internal and external on Firefox) before select the
> desired certificate.
> 
> When getting the private keys of a token, the call of password
> callback occurs in the expected way.
> 
> I want to list all the certificates (and public keys) presents on the
> crypto token and after, when getting the correspondent private key of
> the user's selected certificate, ask for the password.
> 
> 
> Thanks!
> 
_______________________________________________
dev-tech-crypto mailing list
dev-tech-crypto@lists.mozilla.org
https://lists.mozilla.org/listinfo/dev-tech-crypto

Reply via email to