added check for JVM parameter removal.
@@ -840,6 +840,12 @@ private void checkEncryptedPrivateKeyInfo(char[] password, byte[] encodedEncPKIn
KeyFactory fact = KeyFactory.getInstance("RSA", BC);
PrivateKey privKey = fact.generatePrivate(privKeySpec);
EncryptedPrivateKeyInfo encPKInfo = new EncryptedPrivateKeyInfo(encodedEncPKInfo);
+ AlgorithmParameters algParams = encPKInfo.getAlgParameters();
+
+ if (algParams == null)
+ {
+ return; // this PBE type is not supported on the JVM
+ }
Cipher cipher = Cipher.getInstance(encPKInfo.getAlgName(), "BC");
@@ -849,7 +855,6 @@ private void checkEncryptedPrivateKeyInfo(char[] password, byte[] encodedEncPKIn
Key pbeKey = skFac.generateSecret(pbeKeySpec);
- AlgorithmParameters algParams = encPKInfo.getAlgParameters();
cipher.init(Cipher.DECRYPT_MODE, pbeKey, algParams);
