I want to make a Java application that makes signatures but have run into the problem with the unlimited strength policy files, discussed in many posts, e.g. How to avoid installing "Unlimited Strength" JCE policy files when deploying an application?
Everything works fine of course when I switch the policy files but I would rather avoid this and since I don't plan to use symmetric encryption my guess was that it would be possible. My problem is that that I get the Illegal key size exception already in the load method of KeyStore.
My questions:
1) Can I do anything about the internal encryption in the keystore so the key size limitation doesn't require users to change policy files?
2) I have understood that the BouncyCastle Lightweight API could be an option. If so, how do I load a keystore with that API?
Security.addProvider(new BouncyCastleProvider());
//Get private key
KeyStore keyStore = KeyStore.getInstance("PKCS12","BC");
String pwd = "password";
FileInputStream finJKS = new FileInputStream("C:\\TEMP\\host.p12");
keyStore.load(finJKS,pwd.toCharArray());
run: java.io.IOException: exception decrypting data - java.security.InvalidKeyException: Illegal key size
Running jre in JDK 7u51 on Netbeans 7.4 on Windows.
Best regards