From 82f402c211d61ca94fa207a33c99065b570c0679 Mon Sep 17 00:00:00 2001 From: Anders Rundgren Date: Mon, 8 Apr 2019 17:52:31 +0200 Subject: [PATCH] kg2 API changed again... --- .../saturn/keyprovider/KeyProviderInitServlet.java | 2 +- .../webpki/saturn/keyprovider/KeyProviderService.java | 9 +++------ 2 files changed, 4 insertions(+), 7 deletions(-) diff --git a/keyprovider/src/org/webpki/saturn/keyprovider/KeyProviderInitServlet.java b/keyprovider/src/org/webpki/saturn/keyprovider/KeyProviderInitServlet.java index b3dcdeb6..63a50108 100644 --- a/keyprovider/src/org/webpki/saturn/keyprovider/KeyProviderInitServlet.java +++ b/keyprovider/src/org/webpki/saturn/keyprovider/KeyProviderInitServlet.java @@ -136,7 +136,7 @@ public void doGet(HttpServletRequest request, HttpServletResponse response) thro session.setAttribute(KEYGEN2_SESSION_ATTR, new ServerState(new KeyGen2SoftHSM(KeyProviderService.keyManagementKey), keygen2EnrollmentUrl, - KeyProviderService.serverCertificateFingerprint, + KeyProviderService.serverCertificate, null)); //////////////////////////////////////////////////////////////////////////////////////////// diff --git a/keyprovider/src/org/webpki/saturn/keyprovider/KeyProviderService.java b/keyprovider/src/org/webpki/saturn/keyprovider/KeyProviderService.java index 0e657bbb..983a4156 100644 --- a/keyprovider/src/org/webpki/saturn/keyprovider/KeyProviderService.java +++ b/keyprovider/src/org/webpki/saturn/keyprovider/KeyProviderService.java @@ -35,7 +35,6 @@ import org.webpki.crypto.CertificateUtil; import org.webpki.crypto.CustomCryptoProvider; -import org.webpki.crypto.HashAlgorithms; import org.webpki.json.JSONDecoderCache; import org.webpki.json.DataEncryptionAlgorithms; @@ -83,7 +82,7 @@ public class KeyProviderService extends InitPropertyReader implements ServletCon static JSONDecoderCache keygen2JSONCache; - static byte[] serverCertificateFingerprint; + static X509Certificate serverCertificate; static String grantedVersions; @@ -202,10 +201,8 @@ public String getMimeType() throws IOException { //////////////////////////////////////////////////////////////////////////////////////////// // Get TLS server certificate //////////////////////////////////////////////////////////////////////////////////////////// - X509Certificate serverCertificate = - CertificateUtil.getCertificateFromBlob( - ArrayUtil.readFile(getPropertyString(TLS_CERTIFICATE))); - serverCertificateFingerprint = HashAlgorithms.SHA256.digest(serverCertificate.getEncoded()); + serverCertificate = CertificateUtil.getCertificateFromBlob( + ArrayUtil.readFile(getPropertyString(TLS_CERTIFICATE))); //////////////////////////////////////////////////////////////////////////////////////////// // Are we logging?