System.out.println(“This part is not getting printed in case of PFX file”);
// }
puk = (PublicKey) cert.getPublicKey();
This code is working properly when i read from .cer file. Please help
解决方案
Use the KeyStore class and treat the file as a PKCS#12 KeyStore. Use KeyStore.getInstance(“PKCS12”) to get an instance of a PKCS12 keystore.