Package eu.europa.esig.dss.service.crl
Class OnlineCRLSource
java.lang.Object
eu.europa.esig.dss.service.crl.OnlineCRLSource
- All Implemented Interfaces:
CRLSource
,OnlineRevocationSource<CRL>
,RevocationSource<CRL>
,RevocationSourceAlternateUrlsSupport<CRL>
,Serializable
public class OnlineCRLSource
extends Object
implements CRLSource, RevocationSourceAlternateUrlsSupport<CRL>, OnlineRevocationSource<CRL>
Online CRL repository. This CRL repository implementation will download the
CRLs from the given CRL URIs. Note that for the HTTP kind of URLs you can
provide dedicated data loader. If the data loader is not provided the
standard load from URI is provided. For FTP the standard load from URI is
provided. For LDAP kind of URLs an internal implementation using
apache-ldap-api is provided.
- 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
ConstructorDescriptionThe default constructor.OnlineCRLSource
(DataLoader dataLoader) This constructor allows to set a specificDataLoader
. -
Method Summary
Modifier and TypeMethodDescriptiongetRevocationToken
(CertificateToken certificateToken, CertificateToken issuerCertificateToken) This method retrieves aRevocationToken
for the certificateTokengetRevocationToken
(CertificateToken certificateToken, CertificateToken issuerToken, 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<CRL>
getRevocationTokenAndUrl
(CertificateToken certificateToken, CertificateToken issuerToken, List<String> crlUrls) Extracts a CRL token for acertificateToken
from the given list ofcrlUrls
void
setDataLoader
(DataLoader dataLoader) Set the DataLoader to use for querying a revocation server.void
setPreferredProtocol
(Protocol preferredProtocol) This method allows to set the preferred protocol.
-
Constructor Details
-
OnlineCRLSource
public OnlineCRLSource()The default constructor. ACommonsDataLoader is created
. -
OnlineCRLSource
This constructor allows to set a specificDataLoader
.- Parameters:
dataLoader
- the component that allows to retrieve the data using any protocol: HTTP, HTTPS, FTP, LDAP.
-
-
Method Details
-
setPreferredProtocol
This method allows to set the preferred protocol. This parameter is used used when retrieving the CRL to choose the canal.
Possible values are: http, ldap, ftp- Parameters:
preferredProtocol
-Protocol
that is used first to retrieve the revocation data
-
setDataLoader
Description copied from interface:OnlineRevocationSource
Set the DataLoader to use for querying a revocation server.- Specified by:
setDataLoader
in interfaceOnlineRevocationSource<CRL>
- Parameters:
dataLoader
- the component that allows to retrieve a revocation response using HTTP.
-
getRevocationToken
public CRLToken getRevocationToken(CertificateToken certificateToken, CertificateToken issuerCertificateToken) Description copied from interface:RevocationSource
This method retrieves aRevocationToken
for the certificateToken- Specified by:
getRevocationToken
in interfaceCRLSource
- Specified by:
getRevocationToken
in interfaceRevocationSource<CRL>
- Parameters:
certificateToken
- TheCertificateToken
for which the request is madeissuerCertificateToken
- TheCertificateToken
which is the issuer of the certificateToken- Returns:
- an instance of
RevocationToken
-
getRevocationToken
public CRLToken getRevocationToken(CertificateToken certificateToken, CertificateToken issuerToken, 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<CRL>
- Parameters:
certificateToken
- TheCertificateToken
for which the request is madeissuerToken
- 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<CRL> getRevocationTokenAndUrl(CertificateToken certificateToken, CertificateToken issuerToken) Description copied from interface:OnlineRevocationSource
This method retrieves aRevocationTokenAndUrl
for the certificateToken- Specified by:
getRevocationTokenAndUrl
in interfaceOnlineRevocationSource<CRL>
- 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<CRL> getRevocationTokenAndUrl(CertificateToken certificateToken, CertificateToken issuerToken, List<String> crlUrls) Extracts a CRL token for acertificateToken
from the given list ofcrlUrls
- Parameters:
certificateToken
-CertificateToken
to get a CRL token forissuerToken
-CertificateToken
issued thecertificateToken
crlUrls
- a list ofString
URLs to use to access a CRL token- Returns:
OnlineRevocationSource.RevocationTokenAndUrl
-