hi harish,
did u manage to get it working? we are also trying the same.... it will be 
great to learn from you how it worked?
thanks a ton in advance.
regards,
vikram

On Tuesday, November 22, 2011 3:26:55 PM UTC+8, Harish wrote:
>
> We have a requirement of reading the class A certificates that are
> installed on a USB token which is connected to the android device (not
> a tablet). The USB dongle also has associated public and private keys
> with it. We were able to achieve this on the desktop using the
> following lines of code
> -------------
> --------------------------
> String pkcs11ConfigFile = "D:\\NCSA\\java\\SmartCardSecurity\
> \pkcs11.cfg";
> Provider pkcs11Provider = new
> sun.security.pkcs11.SunPKCS11(pkcs11ConfigFile);
> Security.addProvider(pkcs11Provider);
>
>             //PIN is used to protect the information strored in the
> card
>             char[] pin = ...;//password
>             KeyStore smartCardKeyStore =
> KeyStore.getInstance("PKCS11");
>             smartCardKeyStore.load(null, pin);
>
>             //Get the enumeration of the entris in the keystore
>             Enumeration aliasesEnum = smartCardKeyStore.aliases();
>             while (aliasesEnum.hasMoreElements()) {
>                 //Print certificate
>                 X509Certificate cert = (X509Certificate)
> smartCardKeyStore.getCertificate(alias);
>                 System.out.println("Certificate: " + cert);
>             }
> ----------------------------------------
> But need some pointers to get the same thing working on a android
> phone. Found that bouncy castle is the provider on the device.
>
> Regards
> Harish
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Android Security Discussions" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to android-security-discuss+unsubscr...@googlegroups.com.
To post to this group, send email to android-security-discuss@googlegroups.com.
Visit this group at http://groups.google.com/group/android-security-discuss.
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to