public class ValidatorChainBuilder extends Object
| Constructor and Description |
|---|
ValidatorChainBuilder()
Creates a ValidatorChainBuilder using default implementations
|
| Modifier and Type | Method and Description |
|---|---|
CertificateChainValidator |
buildCertificateChainValidator()
Create a new
CertificateChainValidator instance. |
CRLValidator |
buildCRLValidator()
Create a new
CRLValidator instance. |
DocumentRevisionsValidator |
buildDocumentRevisionsValidator()
Create a bew
DocumentRevisionsValidator instance with the current configuration. |
OCSPValidator |
buildOCSPValidator()
Create a new
OCSPValidator instance. |
RevocationDataValidator |
buildRevocationDataValidator()
Create a new
RevocationDataValidator instance
This method can be used to create multiple validators. |
SignatureValidator |
buildSignatureValidator(PdfDocument document)
Create a new
SignatureValidator instance with the current configuration. |
AdESReportAggregator |
getAdESReportAggregator()
Retrieves the explicitly added or automatically created
AdESReportAggregator instance. |
IssuingCertificateRetriever |
getCertificateRetriever()
Retrieves the explicitly added or automatically created
IssuingCertificateRetriever instance. |
LotlService |
getLotlService()
Retrieves explicitly added or automatically created
LotlService instance. |
LotlTrustedStore |
getLotlTrustedStore()
Retrieves explicitly added or automatically created
LotlTrustedStore instance. |
SignatureValidationProperties |
getProperties()
Retrieves the explicitly added or automatically created
SignatureValidationProperties instance. |
IResourceRetriever |
getResourceRetriever()
Retrieves the explicitly added or automatically created
IResourceRetriever instance. |
boolean |
isEuropeanLotlTrusted()
Checks if European Union List of Trusted Lists is supposed to be trusted.
|
ValidatorChainBuilder |
trustEuropeanLotl(boolean trustEuropeanLotl)
Establishes trust in European Union List of Trusted Lists.
|
ValidatorChainBuilder |
withAdESReportAggregator(AdESReportAggregator adESReportAggregator)
Use this AdES report aggregator to enable AdES compliant report generation.
|
ValidatorChainBuilder |
withCertificateChainValidatorFactory(Supplier<CertificateChainValidator> certificateChainValidatorFactory)
Use this factory method to create instances of
CertificateChainValidator for use in the validation chain. |
ValidatorChainBuilder |
withCrlClient(Supplier<ICrlClient> crlClientFactory)
Use this factory to create instances of
ICrlClient for use in the validation chain. |
ValidatorChainBuilder |
withCRLValidatorFactory(Supplier<CRLValidator> crlValidatorFactory)
Use this factory method to create instances of
CRLValidator for use in the validation chain. |
ValidatorChainBuilder |
withDocumentRevisionsValidatorFactory(Supplier<DocumentRevisionsValidator> documentRevisionsValidatorFactory)
Use this factory method to create instances of
DocumentRevisionsValidator
for use in the validation chain. |
ValidatorChainBuilder |
withIssuingCertificateRetrieverFactory(Supplier<IssuingCertificateRetriever> certificateRetrieverFactory)
Use this factory method to create instances of
IssuingCertificateRetriever
for use in the validation chain. |
ValidatorChainBuilder |
withKnownCertificates(Collection<Certificate> knownCertificates)
Adds known certificates to the
IssuingCertificateRetriever. |
ValidatorChainBuilder |
withLotlService(Supplier<LotlService> lotlServiceFactory)
Sets up factory which is responsible for
LotlService creation. |
ValidatorChainBuilder |
withLotlTrustedStoreFactory(Supplier<LotlTrustedStore> lotlTrustedStoreFactory)
Sets up factory which is responsible for
LotlTrustedStore creation. |
ValidatorChainBuilder |
withOcspClient(Supplier<IOcspClientBouncyCastle> ocspClientFactory)
Use this factory to create instances of
IOcspClientBouncyCastle for use in the validation chain. |
ValidatorChainBuilder |
withOCSPValidatorFactory(Supplier<OCSPValidator> ocspValidatorFactory)
Use this factory method to create instances of
OCSPValidator for use in the validation chain. |
ValidatorChainBuilder |
withResourceRetriever(Supplier<IResourceRetriever> resourceRetrieverFactory)
Use this factory method to create instances of
IResourceRetriever for use in the validation chain. |
ValidatorChainBuilder |
withRevocationDataValidatorFactory(Supplier<RevocationDataValidator> revocationDataValidatorFactory)
Use this factory method to create instances of
RevocationDataValidator for use in the validation chain. |
ValidatorChainBuilder |
withSignatureValidationProperties(SignatureValidationProperties properties)
Use this instance of a
SignatureValidationProperties in the validation chain. |
ValidatorChainBuilder |
withTrustedCertificates(Collection<Certificate> trustedCertificates)
Sets the trusted certificates to the
IssuingCertificateRetriever. |
public ValidatorChainBuilder()
public ValidatorChainBuilder trustEuropeanLotl(boolean trustEuropeanLotl)
This feature by default relies on remote resource fetching and third-party EU trusted lists posted online. iText has no influence over these resources maintained by third-party authorities.
If this feature is enabled, LotlService is created and used to retrieve,
validate and establish trust in EU List of Trusted Lists.
In order to properly work, apart from enabling it, user needs to call
LotlService.initializeGlobalCache(LotlFetchingProperties) method, which performs initial initialization.
Additionally, in order to successfully use this feature, a user needs to provide a source for trusted certificates which will be used for LOTL files validation. One can either add an explicit dependency to "eu-trusted-lists-resources" iText module or configure own source of trusted certificates. When iText dependency is used it is required to make sure that the newest version of the dependency is selected, otherwise LOTL validation will fail.
The required certificates for LOTL files validations are published in the Official Journal of the European Union.
Your own source of trusted certificates can be configured by using
EuropeanTrustedListConfigurationFactory.setFactory(Supplier).
trustEuropeanLotl - true if European Union LOTLs are expected to be trusted, false otherwisepublic boolean isEuropeanLotlTrusted()
true if European Union LOTLs are expected to be trusted, false otherwisepublic SignatureValidator buildSignatureValidator(PdfDocument document)
SignatureValidator instance with the current configuration.
This method can be used to create multiple validators.document - PdfDocument instance which will be validatedpublic DocumentRevisionsValidator buildDocumentRevisionsValidator()
DocumentRevisionsValidator instance with the current configuration.
This method can be used to create multiple validators.public CertificateChainValidator buildCertificateChainValidator()
CertificateChainValidator instance.
This method can be used to create multiple validators.public RevocationDataValidator buildRevocationDataValidator()
RevocationDataValidator instance
This method can be used to create multiple validators.public OCSPValidator buildOCSPValidator()
OCSPValidator instance.
This method can be used to create multiple validators.public CRLValidator buildCRLValidator()
CRLValidator instance.
This method can be used to create multiple validators.public ValidatorChainBuilder withDocumentRevisionsValidatorFactory(Supplier<DocumentRevisionsValidator> documentRevisionsValidatorFactory)
DocumentRevisionsValidator
for use in the validation chain.documentRevisionsValidatorFactory - the document revisions validator factory method to usepublic ValidatorChainBuilder withCRLValidatorFactory(Supplier<CRLValidator> crlValidatorFactory)
CRLValidator for use in the validation chain.crlValidatorFactory - the CRLValidatorFactory method to usepublic ValidatorChainBuilder withResourceRetriever(Supplier<IResourceRetriever> resourceRetrieverFactory)
IResourceRetriever for use in the validation chain.resourceRetrieverFactory - the ResourceRetrieverFactory method to use.public ValidatorChainBuilder withOCSPValidatorFactory(Supplier<OCSPValidator> ocspValidatorFactory)
OCSPValidator for use in the validation chain.ocspValidatorFactory - the OCSPValidatorFactory method to usepublic ValidatorChainBuilder withRevocationDataValidatorFactory(Supplier<RevocationDataValidator> revocationDataValidatorFactory)
RevocationDataValidator for use in the validation chain.revocationDataValidatorFactory - the RevocationDataValidator factory method to usepublic ValidatorChainBuilder withCertificateChainValidatorFactory(Supplier<CertificateChainValidator> certificateChainValidatorFactory)
CertificateChainValidator for use in the validation chain.certificateChainValidatorFactory - the CertificateChainValidator factory method to usepublic ValidatorChainBuilder withSignatureValidationProperties(SignatureValidationProperties properties)
SignatureValidationProperties in the validation chain.properties - the SignatureValidationProperties instance to usepublic ValidatorChainBuilder withIssuingCertificateRetrieverFactory(Supplier<IssuingCertificateRetriever> certificateRetrieverFactory)
IssuingCertificateRetriever
for use in the validation chain.certificateRetrieverFactory - the IssuingCertificateRetriever factory method to usepublic ValidatorChainBuilder withOcspClient(Supplier<IOcspClientBouncyCastle> ocspClientFactory)
IOcspClientBouncyCastle for use in the validation chain.ocspClientFactory - the IOcspClient factory method to usepublic ValidatorChainBuilder withCrlClient(Supplier<ICrlClient> crlClientFactory)
ICrlClient for use in the validation chain.crlClientFactory - the ICrlClient factory method to usepublic ValidatorChainBuilder withKnownCertificates(Collection<Certificate> knownCertificates)
IssuingCertificateRetriever.knownCertificates - the list of known certificates to addpublic ValidatorChainBuilder withTrustedCertificates(Collection<Certificate> trustedCertificates)
IssuingCertificateRetriever.trustedCertificates - the list of trusted certificates to setpublic ValidatorChainBuilder withAdESReportAggregator(AdESReportAggregator adESReportAggregator)
Generated PadesValidationReport report could be provided to
XmlReportGenerator.generate(PadesValidationReport, Writer).
adESReportAggregator - the report aggregator to usepublic IssuingCertificateRetriever getCertificateRetriever()
IssuingCertificateRetriever instance.IssuingCertificateRetriever instance.public SignatureValidationProperties getProperties()
SignatureValidationProperties instance.SignatureValidationProperties instance.public AdESReportAggregator getAdESReportAggregator()
AdESReportAggregator instance.
Default is the NullAdESReportAggregator.AdESReportAggregator instance.public IResourceRetriever getResourceRetriever()
IResourceRetriever instance.IResourceRetriever instance.public ValidatorChainBuilder withLotlTrustedStoreFactory(Supplier<LotlTrustedStore> lotlTrustedStoreFactory)
LotlTrustedStore creation.lotlTrustedStoreFactory - factory responsible for LotlTrustedStore creationValidatorChainBuilderpublic LotlTrustedStore getLotlTrustedStore()
LotlTrustedStore instance.LotlTrustedStore instancepublic ValidatorChainBuilder withLotlService(Supplier<LotlService> lotlServiceFactory)
LotlService creation.lotlServiceFactory - factory responsible for LotlService creationValidatorChainBuilderpublic LotlService getLotlService()
LotlService instance.LotlService instanceCopyright © 1998–2025 Apryse Group NV. All rights reserved.