Hello Diego,

I'm a little bit at a loss on what is causing your problem. 
'cm.getPermCerts()' function call returns all the certs for me without 
entering the password. I wonder if there is an extra configuration on 
your token that enforces password input for any crypto operation.

Do you witness the same behavior with "Internal Key Storage Token" token?

-Dennis

Diego Augusto wrote:
> Hi Dennis!
> 
> Thank you for the answer...
> 
> I still have a question... In the following code, when I comment the
> first line, I can't see the public info of the certificates without
> specifying a password. But when I remove the comment of it, it works.
> 
> cm.getPermCerts(); // THIS line
> 
> Enumeration<CryptoToken> ect = null;
> ect = (Enumeration<CryptoToken>) cm.getAllTokens();
> 
> CryptoToken ct = null;
> //ct = cm.getTokenByName("ePass Token");
> //ct = cm.getExternalTokens();
> 
> while (ect.hasMoreElements()) {
>     ct = ect.nextElement();
>     System.out.println("CryptoToken.name= " + ct.getName());
>     System.out.println("getCertificates().before");
>     X509Certificate x509col[] = ct.getCryptoStore().getCertificates();
>     System.out.println("getCertificates().after");
>     for (X509Certificate cert : x509col) {
>         System.out.println("sdn=" + cert.getSubjectDN().toString());
>     }
> }
> 
> 
> Why does it happens?
> 
> Thanks!
> 
_______________________________________________
dev-tech-crypto mailing list
dev-tech-crypto@lists.mozilla.org
https://lists.mozilla.org/listinfo/dev-tech-crypto

Reply via email to