Package eu.europa.esig.dss.service.ocsp
Class OnlineOCSPSource
java.lang.Object
eu.europa.esig.dss.service.ocsp.OnlineOCSPSource
- All Implemented Interfaces:
OCSPSource
,OnlineRevocationSource<OCSP>
,RevocationSource<OCSP>
,RevocationSourceAlternateUrlsSupport<OCSP>
,Serializable
public class OnlineOCSPSource
extends Object
implements OCSPSource, RevocationSourceAlternateUrlsSupport<OCSP>, OnlineRevocationSource<OCSP>
Online OCSP repository. This implementation will contact the OCSP Responder
to retrieve the OCSP response.
- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from interface eu.europa.esig.dss.spi.x509.revocation.OnlineRevocationSource
OnlineRevocationSource.RevocationTokenAndUrl<R extends Revocation>
-
Constructor Summary
ConstructorDescriptionCreate an OCSP source The default constructor for OnlineOCSPSource.OnlineOCSPSource
(DataLoader dataLoader) Creates an Online OCSP Source with the providedDataLoader
instance. -
Method Summary
Modifier and TypeMethodDescriptiongetRevocationToken
(CertificateToken certificateToken, CertificateToken issuerCertificateToken) This method retrieves aRevocationToken
for the certificateTokengetRevocationToken
(CertificateToken certificateToken, CertificateToken issuerCertificateToken, List<String> alternativeUrls) Gets anRevocationToken
for the given certificate / issuer's certificate couple.getRevocationTokenAndUrl
(CertificateToken certificateToken, CertificateToken issuerToken) This method retrieves aRevocationTokenAndUrl
for the certificateTokenprotected OnlineRevocationSource.RevocationTokenAndUrl<OCSP>
getRevocationTokenAndUrl
(CertificateToken certificateToken, CertificateToken issuerToken, List<String> ocspUrls) Extracts an OCSP token for acertificateToken
from the given list ofocspUrls
void
setCertIDDigestAlgorithm
(DigestAlgorithm certIDDigestAlgorithm) This method allows setting of DigestAlgorithm to be used in hash calculation for CertID element in an OCSP request buildingvoid
setDataLoader
(DataLoader dataLoader) Set the DataLoader to use for querying a revocation server.void
setNonceSource
(NonceSource nonceSource) Set the NonceSource to use for querying the OCSP server.
-
Constructor Details
-
OnlineOCSPSource
public OnlineOCSPSource()Create an OCSP source The default constructor for OnlineOCSPSource. The defaultOCSPDataLoader
is set. It is possible to change it with#setDataLoader(dataLoader)
. -
OnlineOCSPSource
Creates an Online OCSP Source with the providedDataLoader
instance. It is still possible to change the defined instance with#setDataLoader(dataLoader)
.- Parameters:
dataLoader
-DataLoader
to use
-
-
Method Details
-
setDataLoader
Description copied from interface:OnlineRevocationSource
Set the DataLoader to use for querying a revocation server.- Specified by:
setDataLoader
in interfaceOnlineRevocationSource<OCSP>
- Parameters:
dataLoader
- the component that allows to retrieve a revocation response using HTTP.
-
setNonceSource
Set the NonceSource to use for querying the OCSP server.- Parameters:
nonceSource
- the component that prevents the replay attack.
-
setCertIDDigestAlgorithm
This method allows setting of DigestAlgorithm to be used in hash calculation for CertID element in an OCSP request building- Parameters:
certIDDigestAlgorithm
-DigestAlgorithm
-
getRevocationToken
public OCSPToken getRevocationToken(CertificateToken certificateToken, CertificateToken issuerCertificateToken) Description copied from interface:RevocationSource
This method retrieves aRevocationToken
for the certificateToken- Specified by:
getRevocationToken
in interfaceOCSPSource
- Specified by:
getRevocationToken
in interfaceRevocationSource<OCSP>
- Parameters:
certificateToken
- TheCertificateToken
for which the request is madeissuerCertificateToken
- TheCertificateToken
which is the issuer of the certificateToken- Returns:
- an instance of
RevocationToken
-
getRevocationToken
public OCSPToken getRevocationToken(CertificateToken certificateToken, CertificateToken issuerCertificateToken, List<String> alternativeUrls) Description copied from interface:RevocationSourceAlternateUrlsSupport
Gets anRevocationToken
for the given certificate / issuer's certificate couple. The coherence between the response and the request is checked.- Specified by:
getRevocationToken
in interfaceRevocationSourceAlternateUrlsSupport<OCSP>
- Parameters:
certificateToken
- TheCertificateToken
for which the request is madeissuerCertificateToken
- TheCertificateToken
which is the issuer of the certificateTokenalternativeUrls
- The list of alternative urls to call- Returns:
RevocationToken
containing information about the validity of the cert
-
getRevocationTokenAndUrl
public OnlineRevocationSource.RevocationTokenAndUrl<OCSP> getRevocationTokenAndUrl(CertificateToken certificateToken, CertificateToken issuerToken) Description copied from interface:OnlineRevocationSource
This method retrieves aRevocationTokenAndUrl
for the certificateToken- Specified by:
getRevocationTokenAndUrl
in interfaceOnlineRevocationSource<OCSP>
- Parameters:
certificateToken
- TheCertificateToken
for which the request is madeissuerToken
- TheCertificateToken
which is the issuer of the certificateToken- Returns:
- an instance of
RevocationTokenAndUrl
-
getRevocationTokenAndUrl
protected OnlineRevocationSource.RevocationTokenAndUrl<OCSP> getRevocationTokenAndUrl(CertificateToken certificateToken, CertificateToken issuerToken, List<String> ocspUrls) Extracts an OCSP token for acertificateToken
from the given list ofocspUrls
- Parameters:
certificateToken
-CertificateToken
to get an OCSP token forissuerToken
-CertificateToken
issued thecertificateToken
ocspUrls
- a list ofString
URLs to use to access an OCSP token- Returns:
OnlineRevocationSource.RevocationTokenAndUrl
-