Last active
December 10, 2015 17:58
-
-
Save emboss/4470795 to your computer and use it in GitHub Desktop.
Test program to detect the need for "Unlimited Strength Policy Files"
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import javax.crypto.Cipher; | |
import javax.crypto.KeyGenerator; | |
import javax.crypto.SecretKey; | |
public class TestPolicyFiles { | |
public static void main(String[] args) { | |
try { | |
KeyGenerator keygen = KeyGenerator.getInstance("AES"); | |
keygen.init(256); | |
SecretKey key = keygen.generateKey(); | |
Cipher aes = Cipher.getInstance("AES/CBC/PKCS5PAdding"); | |
aes.init(Cipher.ENCRYPT_MODE, key); | |
} catch (Exception ex) { | |
throw new RuntimeException(ex); | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
@emboss ❤️