Class LotlTrustedStore
java.lang.Object
com.itextpdf.signatures.validation.lotl.LotlTrustedStore
Trusted certificates storage class for country specific Lotl trusted certificates.
-
Constructor Summary
ConstructorsConstructorDescriptionLotlTrustedStore
(ValidatorChainBuilder builder) Creates new instance ofLotlTrustedStore
. -
Method Summary
Modifier and TypeMethodDescriptionboolean
checkIfCertIsTrusted
(ValidationReport result, ValidationContext context, X509Certificate certificate, Date validationDate) Checks if given certificate is trusted according to context and time in which it is used.Gets all the certificates stored in this trusted store.protected Set<CertificateSource>
getCertificateSourceBasedOnServiceType
(String serviceType) Gets set ofCertificateSource
items based on service type identifier of a given certificate in LOTL file.protected boolean
isScopeCorrectlySpecified
(List<ReportItem> reportItems, X509Certificate certificate, List<AdditionalServiceInformationExtension> extensions) Checks if scope specified by extensions contains valid types.
-
Constructor Details
-
LotlTrustedStore
Creates new instance ofLotlTrustedStore
. This constructor shall not be used directly. Instead, in order to create such instanceValidatorChainBuilder.getLotlTrustedStore()
shall be used.- Parameters:
-
builder
-ValidatorChainBuilder
which was responsible for creation
-
-
Method Details
-
getCertificates
Gets all the certificates stored in this trusted store.- Returns:
-
Certificate
stored
-
checkIfCertIsTrusted
public boolean checkIfCertIsTrusted(ValidationReport result, ValidationContext context, X509Certificate certificate, Date validationDate) Checks if given certificate is trusted according to context and time in which it is used.- Parameters:
-
result
-ValidationReport
which stores check results -
context
-ValidationContext
in which certificate is used -
certificate
-X509Certificate
certificate to be checked -
validationDate
-Date
date time in which certificate is validated - Returns:
-
true
if certificate is trusted,false
otherwise
-
getCertificateSourceBasedOnServiceType
Gets set ofCertificateSource
items based on service type identifier of a given certificate in LOTL file.Certificate source defines in which context this certificate is supposed to be trusted.
- Parameters:
-
serviceType
-String
representing service type identifier field in LOTL file. - Returns:
-
set of
CertificateSource
representing contexts, in which certificate is supposed to be trusted.
-
isScopeCorrectlySpecified
protected boolean isScopeCorrectlySpecified(List<ReportItem> reportItems, X509Certificate certificate, List<AdditionalServiceInformationExtension> extensions) Checks if scope specified by extensions contains valid types.- Parameters:
-
reportItems
-ValidationReport
which is populated with detailed validation results -
certificate
-X509Certificate
to be validated -
extensions
-AdditionalServiceInformationExtension
that specify scope - Returns:
- false if extensions specify scope only with invalid types.
-