diff --git a/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/ssl/pem/PemPrivateKeyParserTests.java b/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/ssl/pem/PemPrivateKeyParserTests.java
index fc88c37189e..ef197945f7a 100644
--- a/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/ssl/pem/PemPrivateKeyParserTests.java
+++ b/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/ssl/pem/PemPrivateKeyParserTests.java
@@ -207,44 +207,69 @@ class PemPrivateKeyParserTests {
assertThatIllegalStateException().isThrownBy(() -> PemPrivateKeyParser.parse(read("test-banner.txt")));
}
- @Test
- void parsePkcs8EncryptedRsaKeyFile() throws Exception {
- // created with:
- // openssl genpkey -aes-256-cbc -algorithm RSA \
- // -pkeyopt rsa_keygen_bits:4096 -out key-rsa-encrypted.key
- PrivateKey privateKey = PemPrivateKeyParser.parse(read("ssl/pkcs8/key-rsa-encrypted.pem"), "test");
+ @ParameterizedTest
+ // @formatter:off
+ @CsvSource({
+ "dsa-aes-128-cbc.key, DSA",
+ "rsa-aes-256-cbc.key, RSA",
+ "prime256v1-aes-256-cbc.key, EC",
+ "ed25519-aes-256-cbc.key, EdDSA",
+ "x448-aes-256-cbc.key, XDH"
+ })
+ // @formatter:on
+ void shouldParseEncryptedPkcs8(String file, String algorithm) throws IOException {
+ // Created with:
+ // openssl pkcs8 -topk8 -in -out