Skip to content

Commit

Permalink
GH-1446: Fix bad supported algorithm exception message in SecurityUtil
Browse files Browse the repository at this point in the history
  • Loading branch information
sbernard31 committed May 12, 2023
1 parent d47e000 commit 14b6f5c
Showing 1 changed file with 4 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -60,8 +60,9 @@ public X509Certificate decode(InputStream inputStream) throws CertificateExcepti

// we support only EC algorithm
if (!"EC".equals(certificate.getPublicKey().getAlgorithm())) {
throw new CertificateException(String.format(
"%s algorithm is not supported, Only EC algorithm is supported", certificate.getType()));
throw new CertificateException(
String.format("%s algorithm is not supported, Only EC algorithm is supported",
certificate.getPublicKey().getAlgorithm()));
}

// we support only X509 certificate
Expand Down Expand Up @@ -95,7 +96,7 @@ public X509Certificate[] decode(InputStream inputStream) throws CertificateExcep
if (!"EC".equals(x509Certificates.get(0).getPublicKey().getAlgorithm())) {
throw new CertificateException(
String.format("%s algorithm is not supported, Only EC algorithm is supported",
x509Certificates.get(0).getType()));
x509Certificates.get(0).getPublicKey().getAlgorithm()));
}

return x509Certificates.toArray(new X509Certificate[0]);
Expand Down

0 comments on commit 14b6f5c

Please sign in to comment.