· 8 years ago · Jan 17, 2018, 04:18 PM
1String encodedKey = Base64.getEncoder().encodeToString(secKey.getEncoded());
2
3byte[] decodedKey = Base64.getDecoder().decode(line);
4SecretKey secKey = new SecretKeySpec(decodedKey, "AES");`
5
6Exception in thread "main" java.security.InvalidKeyException: unsupported type
7 at de.flexiprovider.api.BlockCipher.engineInit(BlockCipher.java:165)
8 at de.flexiprovider.api.Cipher.engineInit(Cipher.java:68)
9 at javax.crypto.Cipher.init(Cipher.java:1246)
10 at javax.crypto.Cipher.init(Cipher.java:1186)
11 at server.main(server.java:93)