Skip to content

Commit

Permalink
Merge pull request #804 from /issues/803-replaceAll
Browse files Browse the repository at this point in the history
Fix #803: String#replace should be preferred to String#replaceAll
  • Loading branch information
banterCZ authored Mar 4, 2024
2 parents 417426e + 0c1a0eb commit fd93156
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -115,8 +115,8 @@ public X509Certificate[] allCerts() {

private X509Certificate certificateFromPem(String pem) throws CertificateException {
final byte[] decoded = Base64.getDecoder().decode(pem
.replaceAll(BEGIN_CERT, "")
.replaceAll(END_CERT, "")
.replace(BEGIN_CERT, "")
.replace(END_CERT, "")
.replaceAll("\\s", "")
);
return (X509Certificate) CertificateFactory.getInstance("X.509").generateCertificate(new ByteArrayInputStream(decoded));
Expand Down

0 comments on commit fd93156

Please sign in to comment.