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:
- Serialized Form
-
Constructor Summary
Constructors Constructor Description OnlineOCSPSource()
Create an OCSP source The default constructor for OnlineOCSPSource.OnlineOCSPSource(DataLoader dataLoader)
Creates an Online OCSP Source with the providedDataLoader
instance. -
Method Summary
Modifier and Type Method Description OCSPToken
getRevocationToken(CertificateToken certificateToken, CertificateToken issuerCertificateToken)
This method retrieves aRevocationToken
for the certificateTokenOCSPToken
getRevocationToken(CertificateToken certificateToken, CertificateToken issuerCertificateToken, List<String> alternativeUrls)
Gets anRevocationToken
for the given certificate / issuer's certificate couple.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
-