I'm trying to create a p12 file (pkcs12). I know that i need a certificate and a private key to create it. I read the certificate from smart card, but i have problems with private key. I know that in smart card there is a private key, but i cannot extract it...is it true? There is another way to use the private key stored in smart card and use it to create the p12 file?
I want to use this code:
KeyStore store = KeyStore.getInstance("PKCS12");
store.load(null, null);
store.setKeyEntry("Eric's Key", privKey, null, certificate);
FileOutputStream fOut = new FileOutputStream("id.p12");
store.store(fOut, passwd);
Any suggestion please? Thanks