How to resolve error Salt must be 8 bytes long
<p>I am writing a program to sign a pdf using certificate (pfx file). For few of the certificates I am getting below exception.</p>

<pre><code>java.security.InvalidAlgorithmParameterException: Salt must be at least 8 bytes long
</code></pre>

<p>This happens when I execute the below code.</p>

<pre><code>Keystore ks = KeyStore.getInstance("pkcs12");
</code></pre>

<p>I am getting an exception in the below java file at line number 123.
<a href="http://grepcode.com/file/repository.grepcode.com/java/root/jdk/openjdk/8-b132/com/sun/crypto/provider/HmacPKCS12PBESHA1.java?av=h" rel="nofollow">http://grepcode.com/file/repository.grepcode.com/java/root/jdk/openjdk/8-b132/com/sun/crypto/provider/HmacPKCS12PBESHA1.java?av=h</a></p>