DSSRevocationUtils { public static DigestCalculator getDigestCalculator(DigestAlgorithm digestAlgorithm) { try { final DigestCalculatorProvider digestCalculatorProvider = jcaDigestCalculatorProviderBuilder.build(); return digestCalculatorProvider.get(new AlgorithmIdentifier(new ASN1ObjectIdentifier(digestAlgorithm.getOid()), DERNull.INSTANCE)); } catch (OperatorCreationException e) { throw new DSSException( String.format("Unable to create a DigestCalculator instance. DigestAlgorithm %s is not supported", digestAlgorithm.name()), e); } } private  DSSRevocationUtils(); static BasicOCSPResp getBasicOcspResp(final ASN1Sequence asn1Sequence); static OCSPResp getOcspResp(final ASN1Sequence asn1Sequence); static BasicOCSPResp fromRespToBasic(final OCSPResp ocspResp); static OCSPResp fromBasicToResp(final BasicOCSPResp basicOCSPResp); static byte[] getEncodedFromBasicResp(final BasicOCSPResp basicOCSPResp); static OCSPResp fromBasicToResp(final byte[] basicOCSPRespBinary); static DigestAlgorithm getUsedDigestAlgorithm(final SingleResp singleResp); static boolean matches(final CertificateID certId, final SingleResp singleResp); static CertificateID getOCSPCertificateID(final CertificateToken cert, final CertificateToken issuerCert, 
			final DigestAlgorithm digestAlgorithm); static DigestCalculator getDigestCalculator(DigestAlgorithm digestAlgorithm); static BasicOCSPResp loadOCSPBase64Encoded(final String base64Encoded); static BasicOCSPResp loadOCSPFromBinaries(final byte[] binaries); static byte[] getEncoded(OCSPResp ocspResp); static ResponderId getDSSResponderId(RespID respID); static ResponderId getDSSResponderId(ResponderID responderID); static List<String> getCRLRevocationTokenKeys(final CertificateToken certificateToken); static String getCRLRevocationTokenKey(final String crlUrl); static List<String> getOcspRevocationTokenKeys(final CertificateToken certificateToken); static String getOcspRevocationKey(final CertificateToken certificateToken, final String ocspUrl); static SingleResp getLatestSingleResponse(BasicOCSPResp basicResponse, CertificateToken certificate, CertificateToken issuer); static List<SingleResp> getSingleResponses(BasicOCSPResp basicResponse, CertificateToken certificate, CertificateToken issuer); static Digest getDigest(OtherHash otherHash);  }
@Test public void getSHA1DigestCalculator() { DigestCalculator digestCalculator = DSSRevocationUtils.getDigestCalculator(DigestAlgorithm.SHA1); assertNotNull(digestCalculator); }