DSSRevocationUtils { public static List<String> getOcspRevocationTokenKeys(final CertificateToken certificateToken) { final List<String> ocspUrls = DSSASN1Utils.getOCSPAccessLocations(certificateToken); List<String> revocationKeys = new ArrayList<>(); for (String ocspUrl : ocspUrls) { revocationKeys.add(getOcspRevocationKey(certificateToken, ocspUrl)); } return revocationKeys; } 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 getOcspRevocationTokenKeys() { CertificateToken certificate = DSSUtils.loadCertificate(new File("src/test/resources/ec.europa.eu.crt")); List<String> revocationKeys = DSSRevocationUtils.getOcspRevocationTokenKeys(certificate); assertNotNull(revocationKeys); assertFalse(CollectionUtils.isEmpty(revocationKeys)); assertEquals(1, Utils.collectionSize(revocationKeys)); }
@Test public void getEmptyOcspRevocationTokenKeys() { CertificateToken certificate = DSSUtils.loadCertificate(new File("src/test/resources/sk_ca.cer")); List<String> revocationKeys = DSSRevocationUtils.getOcspRevocationTokenKeys(certificate); assertNotNull(revocationKeys); assertTrue(CollectionUtils.isEmpty(revocationKeys)); }