diff --git a/core-java-modules/core-java-security-3/src/test/java/com/baeldung/cryptography/CryptographyStrengthUnitTest.java b/core-java-modules/core-java-security-3/src/test/java/com/baeldung/cryptography/CryptographyStrengthUnitTest.java new file mode 100644 index 0000000000..5d5c30dc34 --- /dev/null +++ b/core-java-modules/core-java-security-3/src/test/java/com/baeldung/cryptography/CryptographyStrengthUnitTest.java @@ -0,0 +1,17 @@ +package com.baeldung.cryptography; + +import org.junit.Test; + +import java.security.NoSuchAlgorithmException; + +import static org.assertj.core.api.Assertions.assertThat; + +public class CryptographyStrengthUnitTest { + private static final int UNLIMITED_KEY_SIZE = 2147483647; + + @Test + public void whenDefaultCheck_thenUnlimitedReturned() throws NoSuchAlgorithmException { + int maxKeySize = javax.crypto.Cipher.getMaxAllowedKeyLength("AES"); + assertThat(maxKeySize).isEqualTo(UNLIMITED_KEY_SIZE); + } +}