Skip to content

Commit cdbdefc

Browse files
committed
JDK-8371574: Improve code coverage of PEM classes decode functionality
1 parent 812add2 commit cdbdefc

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

test/jdk/java/security/PEM/PEMDecoderTest.java

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -163,6 +163,16 @@ public static void main(String[] args) throws Exception {
163163
}
164164
System.out.println("PASS");
165165

166+
System.out.println("Check if PEM decode decodes content correctly");
167+
final String tmpContent = "1234567";
168+
final PEM tmpPem = new PEM("ONE", tmpContent);
169+
if (!Arrays.equals(
170+
Base64.getDecoder().decode(tmpContent),
171+
tmpPem.decode())) {
172+
throw new AssertionError("PEM decode error");
173+
}
174+
System.out.println("PASS");
175+
166176
System.out.println("Decode to EncryptedPrivateKeyInfo: ");
167177
EncryptedPrivateKeyInfo ekpi =
168178
d.decode(PEMData.ed25519ep8.pem(), EncryptedPrivateKeyInfo.class);

0 commit comments

Comments
 (0)