I have this code:
class Crypt
{
Key KEY;
String TD;
Cipher aes = Cipher.getInstance("AES/CBC/PKCS5Padding");
KeyGenerator keyGen = KeyGenerator.getInstance("AES");
public Crypt()
{
int keyLength = 192;
keyGen.init(keyLength);
KEY = keyGen.generateKey();
Which when compiles gives this error:
Exception in thread "main" java.lang.Error: Unresolved compilation problems:
Unhandled exception type NoSuchAlgorithmException
Unhandled exception type NoSuchPaddingException
Unhandled exception type NoSuchAlgorithmException
When researching the error I found this. But after downloading, installing and verifying that Unlimited Strength Jurisdiction Policy Files are up to date I am still getting the error.
Your error is very clear and doesn’t have anything to do with the unlimited jurisdiction encryption files. It’s telling you there are unhandled checked exceptions.
Add
throws Exceptionto your constructor so it looks like this: