Assert Error-Messages already includes dashes

When the cert-content is not valid, the assert output message is not correct.
Because it outputs too many dashes .The const X509- and PKCS8-PEM_HEADER already includes the dashes.

I took the output message via copy and paste, but it was still not valid ;-(

Only the output is affected, the checks itself is correct.
This commit is contained in:
OllisGit 2021-06-17 08:54:27 +02:00 committed by Marcus Da Coregio
parent 3b64cdfc03
commit 658aff501c

View File

@ -83,8 +83,8 @@ public final class RsaKeyConverters {
return (source) -> {
List<String> lines = readAllLines(source);
Assert.isTrue(!lines.isEmpty() && lines.get(0).startsWith(PKCS8_PEM_HEADER),
"Key is not in PEM-encoded PKCS#8 format, please check that the header begins with -----"
+ PKCS8_PEM_HEADER + "-----");
"Key is not in PEM-encoded PKCS#8 format, please check that the header begins with "
+ PKCS8_PEM_HEADER);
StringBuilder base64Encoded = new StringBuilder();
for (String line : lines) {
if (RsaKeyConverters.isNotPkcs8Wrapper(line)) {