CertificateInformationExtractor { public byte[] getIssuerNameHash() throws IOException, NoSuchAlgorithmException { byte[] encodedDistinguishedName = certificate.getIssuer().getEncoded(); MessageDigest md = MessageDigest.getInstance("SHA-1"); return md.digest(encodedDistinguishedName); } CertificateInformationExtractor(Certificate certificate); Certificate getCertificate(); BigInteger getSerialNumber(); byte[] getIssuerNameHash(); byte[] getIssuerKeyHash(); Boolean getMustStaple(); Boolean getMustStaplev2(); String getOcspServerUrl(); String getCertificateIssuerUrl(); Certificate retrieveIssuerCertificate();  }
@Test public void testGetIssuerNameHash() throws IOException, NoSuchAlgorithmException { byte[] expectedNameHash = { 126, -26, 106, -25, 114, -102, -77, -4, -8, -94, 32, 100, 108, 22, -95, 45, 96, 113, 8, 93 }; Assert.assertArrayEquals(expectedNameHash, certificateInformationExtractor.getIssuerNameHash()); }