BAEL-4266 Test default cryptography strength (#11155)
This commit is contained in:
parent
45a0c3d947
commit
540690b06e
|
@ -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);
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue