CertificateInformationExtractor { public byte[] getIssuerKeyHash() throws IOException, NoSuchAlgorithmException { byte[] publicKey = certificate.getSubjectPublicKeyInfo().getPublicKeyData().getBytes(); MessageDigest md = MessageDigest.getInstance("SHA-1"); return md.digest(publicKey); } CertificateInformationExtractor(Certificate certificate); Certificate getCertificate(); BigInteger getSerialNumber(); byte[] getIssuerNameHash(); byte[] getIssuerKeyHash(); Boolean getMustStaple(); Boolean getMustStaplev2(); String getOcspServerUrl(); String getCertificateIssuerUrl(); Certificate retrieveIssuerCertificate();  }
@Test public void testGetIssuerKeyHash() throws IOException, NoSuchAlgorithmException { byte[] expectedKeyHash = { -88, 74, 106, 99, 4, 125, -35, -70, -26, -47, 57, -73, -90, 69, 101, -17, -13, -88, -20, -95 }; Assert.assertArrayEquals(expectedKeyHash, issuerCertificateInformationExtractor.getIssuerKeyHash()); }