question: private static KeySpec decryptPrivateKey ( final byte [ ] encryptedPrivateKey ) throws GeneralSecurityException { EncryptedPrivateKeyInfo epkInfo ; try { epkInfo = new EncryptedPrivateKeyInfo ( encryptedPrivateKey ) ; } catch ( final IOException ex ) { return null ; } final String pass = "android" ; final char [ ] password = pass . toCharArray ( ) ; final SecretKeyFactory skFactory = SecretKeyFactory . getInstance ( epkInfo . getAlgName ( ) ) ; final Key key = skFactory . generateSecret ( new PBEKeySpec ( password ) ) ; final Cipher cipher = Cipher . getInstance ( epkInfo . getAlgName ( ) ) ; cipher . init ( Cipher . DECRYPT_MODE , key , epkInfo . getAlgParameters ( ) ) ; try { return epkInfo . getKeySpec ( cipher ) ; } catch ( final InvalidKeySpecException ex ) { Log . e ( TAG , "Password for keyFile may be bad." , ex ) ; return null ; } }
target:  Decrypt an encrypted PKCS 8 format private key. Based on ghstark's post on Aug 6, 2006 at http://forums.sun.com/thread.jspa?threadID=758133&messageID=4330949