Saturday, 15 June 2013

java - How to get PrivateKey from keystore.pkcs12 file -


I'm trying to get a private key from the keystore file,

  keyStore Load (KeyStoreinputStream, "keystorepass" .toCharArray ()); Private key key = (Personal) keystore. Gateke (aka, new characters [0]);  

New four [0] -> I have not given a password for the private key at the time of generation.

Reduce exception:

  java.security.UnrecoverableKeyException: get key failed: last block on java.security properly Pad is not given. KASTOR.GETKE (Keystore.Java: 792) by: javax.crypto.BadPaddingException: com.sun.crypto.provider.CipherCore.doFinal (CipherCore.java:811) com.sun.crypto.provider at the last block. CipherCore.doFinal (CipherCore.java:676) has not been properly padded on com.sun. 

The new four [0] is not correct if there is no key password, then use null.


No comments:

Post a Comment