BAEL-4266 Test default cryptography strength (#11155)

This commit is contained in:
polomos 2021-09-08 14:59:09 +02:00 committed by GitHub
parent 45a0c3d947
commit 540690b06e
1 changed files with 17 additions and 0 deletions

View File

@ -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);
}
}