From b7dc3afd099978aaa100eef37325736493caa84c Mon Sep 17 00:00:00 2001 From: Mikhail Yankelevich Date: Fri, 21 Nov 2025 09:53:10 +0000 Subject: [PATCH] 8371574: Improve code coverage of PEM classes decode functionality Reviewed-by: rhalade --- test/jdk/java/security/PEM/PEMDecoderTest.java | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/test/jdk/java/security/PEM/PEMDecoderTest.java b/test/jdk/java/security/PEM/PEMDecoderTest.java index 3ae088329b4..b6db58b0ed3 100644 --- a/test/jdk/java/security/PEM/PEMDecoderTest.java +++ b/test/jdk/java/security/PEM/PEMDecoderTest.java @@ -163,6 +163,16 @@ public class PEMDecoderTest { } System.out.println("PASS"); + System.out.println("Check if PEM decode decodes content correctly"); + final String tmpContent = "1234567"; + final PEM tmpPem = new PEM("ONE", tmpContent); + if (!Arrays.equals( + Base64.getDecoder().decode(tmpContent), + tmpPem.decode())) { + throw new AssertionError("PEM decode error"); + } + System.out.println("PASS"); + System.out.println("Decode to EncryptedPrivateKeyInfo: "); EncryptedPrivateKeyInfo ekpi = d.decode(PEMData.ed25519ep8.pem(), EncryptedPrivateKeyInfo.class);