Class SingleFileLotlService
- All Implemented Interfaces:
-
AutoCloseable
You should use this service if you have only a country specific LOTL file with certificates you trust. First, you create an instance of CountrySpecificLotl and then pass it to the constructor of SingleFileLotlService together with fetching properties and the certificates to validate LOTL file. Then this instance can be passed to ValidatorChainBuilder.withLotlService(java.util.function.Supplier so that the certificates from the LOTL file are used for signature validation.
-
Field Summary
Fields inherited from class com.itextpdf.signatures.validation.lotl.LotlService
lotlFetchingProperties -
Constructor Summary
ConstructorsConstructorDescriptionSingleFileLotlService(LotlFetchingProperties lotlFetchingProperties, CountrySpecificLotl countrySpecificLotl, List<String> certificates) Creates a new instance ofSingleFileLotlService. -
Method Summary
Modifier and TypeMethodDescriptionRetrieves national trusted certificates.Get the validation results for the List of Trusted Lists (LOTL).voidLoads the cache from the provided input stream.protected voidLoads the cache from the network by fetching the latest LOTL data and related resources.voidserializeCache(OutputStream outputStream) Serializes the current state of the cache to the provided output stream.Methods inherited from class com.itextpdf.signatures.validation.lotl.LotlService
cancelTimer, close, getGlobalService, initializeCache, initializeCache, initializeGlobalCache, setupTimer, tryAndRefreshCache, withCountrySpecificLotlFetcher, withCustomResourceRetriever, withEuropeanLotlFetcher, withEuropeanResourceFetcher, withLotlServiceCache, withLotlValidator, withPivotFetcher, withXmlSignatureValidator
-
Constructor Details
-
SingleFileLotlService
public SingleFileLotlService(LotlFetchingProperties lotlFetchingProperties, CountrySpecificLotl countrySpecificLotl, List<String> certificates) Creates a new instance ofSingleFileLotlService.- Parameters:
-
lotlFetchingProperties-LotlFetchingPropertiesto configure the way in which LOTL will be fetched -
countrySpecificLotl-CountrySpecificLotlfor a LOTL file to serve -
certificates- a list of certificates to validate LOTL file
-
-
Method Details
-
loadFromCache
Loads the cache from the provided input stream.The input stream should contain serialized cache data, which can be created using the
LotlService.serializeCache(OutputStream)method.- Overrides:
-
loadFromCachein classLotlService - Parameters:
-
in- the input stream to read the cached data from
-
serializeCache
Serializes the current state of the cache to the provided output stream.- Overrides:
-
serializeCachein classLotlService - Parameters:
-
outputStream- the output stream to which the cache will be serialized - Throws:
-
IOException- if an I/O error occurs during serialization
-
getValidationResult
Get the validation results for the List of Trusted Lists (LOTL).- Overrides:
-
getValidationResultin classLotlService - Returns:
-
a
ValidationReportcontaining the results of the LOTL validation
-
getNationalTrustedCertificates
Retrieves national trusted certificates.- Overrides:
-
getNationalTrustedCertificatesin classLotlService - Returns:
- the list of the national trusted certificates
-
loadFromNetwork
protected void loadFromNetwork()Loads the cache from the network by fetching the latest LOTL data and related resources.This method fetches the main LOTL file, EU journal certificates, pivot files, and country-specific LOTLs, validates them, and stores them in the cache.
Note: This method is called during cache initialization and should not be called directly in normal operation.
- Overrides:
-
loadFromNetworkin classLotlService
-