Hola Hector,

La carga del DNie no se hace en este método, se hace en el método
initPKCS11Device, el cual también es invocado durante la
inicialización del applet y permite cargar el DNIe o cualquier otro
dispositivo con interfaz PKCS11 que configuremos en el ujiCrypto.conf.

---
Salut,
====================================
Ricardo Borillo Domenech
http://xml-utils.com / http://twitter.com/borillo



2010/3/23 Héctor Espí Hernández <[email protected]>:
>
> Revisando el código, me he dado cuenta de que en la función:
> initBrowserStores, falta la parte donde se carga el DNIe en Mozilla:
>
> public void initBrowserStores(SupportedBrowser navigator)
>     {
>         if (navigator.equals(SupportedBrowser.IEXPLORER))
>         {
>             IKeyStore keystore = (IKeyStore) new MsCapiKeyStore();
>
>             try
>             {
>                 keystore.load("".toCharArray());
>                 keystores.put(SupportedKeystore.MSCAPI, keystore);
>
>                 Security.addProvider(new MSCAPIProvider());
>             }
>             catch (Exception ex)
>             {
>                 String error = LabelManager.get("ERR_MS_KEYSTORE_LOAD");
>
>                 log.error(error, ex);
>                 JOptionPane.showMessageDialog(null, ex.getMessage(), error,
> JOptionPane.WARNING_MESSAGE);
>             }
>         }
>         else if (navigator.equals(SupportedBrowser.MOZILLA))
>         {
>             try
>             {
>                 Mozilla mozilla = new Mozilla();
>
>                 if (mozilla.isInitialized())
>                 {
>                     IKeyStore p11mozillaks = (IKeyStore) new
> PKCS11KeyStore(mozilla
>                             .getPkcs11ConfigInputStream(),
> mozilla.getPkcs11FilePath(), mozilla
>                             .getPkcs11InitArgsString());
>                     p11mozillaks.load(null);
>                     keystores.put(SupportedKeystore.MOZILLA, p11mozillaks);
>                 }
>                 // We have to look here for spanish dnie and ask for the
> password.
>
>             }
>             catch (Exception ex)
>             {
>                 System.out.println("ERR_MOZ_KEYSTORE_LOAD");
>                 ex.printStackTrace();
>                 //JOptionPane.showMessageDialog(null, ex.getMessage(),
> LabelManager
>                 //        .get("ERR_MOZ_KEYSTORE_LOAD"),
> JOptionPane.WARNING_MESSAGE);
>                 // throw new
> SignatureAppletException(LabelManager.get("ERR_MOZ_KEYSTORE_LOAD"));
>             }
>         }
>     }
>
> ¿Hasta donde da soporte CryptoApplet para la firma de PDF con DNIe?. ¿Tengo
> que desarrollar yo esta parte o alguien la tiene desarrollada?. ¿Podéis
> orientarme algo en el desarrollo?
>
> Gracias. Un saludo.
>
> --
> Héctor Espí Hernández
>
>
>
> --
> Héctor Espí Hernández
>
> _______________________________________________
> CryptoApplet mailing list
> [email protected]
> http://llistes.uji.es/mailman/listinfo/cryptoapplet
>
>
_______________________________________________
CryptoApplet mailing list
[email protected]
http://llistes.uji.es/mailman/listinfo/cryptoapplet

Responder a