Package eu.europa.esig.dss.validation
Interface ValidationContext
- All Known Implementing Classes:
- SignatureValidationContext
public interface ValidationContext
This interface allows the implementation of the validators for: certificates, timestamps and revocation data.
- 
Method SummaryModifier and TypeMethodDescriptionvoidaddCertificateTokenForVerification(CertificateToken certificateToken) Adds a new certificate token to the list of tokens to verify.voidaddDocumentCertificateSource(CertificateSource certificateSource) Adds an extracted certificate source to the used list of sourcesvoidaddDocumentCertificateSource(ListCertificateSource listCertificateSource) Adds a list certificate source to the used list of sourcesvoidaddDocumentCRLSource(OfflineRevocationSource<CRL> crlSource) Adds an extracted CRL source to the used list of sourcesvoidaddDocumentCRLSource(ListRevocationSource<CRL> crlSource) Adds a list CRL source to the used list of sourcesvoidaddDocumentOCSPSource(OfflineRevocationSource<OCSP> ocspSource) Adds an extracted OCSP source to the used list of sourcesvoidaddDocumentOCSPSource(ListRevocationSource<OCSP> ocspSource) Adds a listd OCSP source to the used list of sourcesvoidaddRevocationTokenForVerification(RevocationToken<?> revocationToken) Adds a new revocation token to the list of tokens to verify.voidaddSignatureForVerification(AdvancedSignature signature) Adds a new signature to collect the information to verify.voidaddTimestampTokenForVerification(TimestampToken timestampToken) Adds a new timestamp token to the list of tokens to verify.booleanDeprecated.since DSS 5.12.booleanThis method allows to verify if all POE (timestamp tokens) are covered by a revocation data Additionally, an alert can be handledCertificateVerifier.setAlertOnUncoveredPOE(eu.europa.esig.dss.alert.StatusAlert)booleanThis method allows to verify if all processed certificates have a revocation data Additionally, an alert can be handledCertificateVerifier.setAlertOnMissingRevocationData(eu.europa.esig.dss.alert.StatusAlert)booleanThis method allows to verify if all processed timestamps are valid and intact.booleanThis method allows to verify if there is at least one revocation data present after the earliest available timestamp token producing time Additionally, an alert can be handledCertificateVerifier.setAlertOnNoRevocationAfterBestSignatureTime(eu.europa.esig.dss.alert.StatusAlert)booleancheckCertificateNotRevoked(CertificateToken certificateToken) This method allows to verify if the certificate is not revoked Additionally, an alert can be handledCertificateVerifier.setAlertOnRevokedCertificate(eu.europa.esig.dss.alert.StatusAlert)booleancheckCertificatesNotRevoked(AdvancedSignature signature) This method allows to verify if signature certificates are not revoked Additionally, an alert can be handledCertificateVerifier.setAlertOnRevokedCertificate(eu.europa.esig.dss.alert.StatusAlert)booleancheckSignatureNotExpired(AdvancedSignature signature) This method verifies if the signing certificate has not been expired yet or has a still valid timestamp Additionally, an alert can be handledCertificateVerifier.setAlertOnExpiredSignature(eu.europa.esig.dss.alert.StatusAlert)Returns a list of allCertificateSources used during the validation process.Gets the current validation time.Returns a list of allCertificateSources extracted from a validating document (signature(s), timestamp(s))Returns a list of all CRLOfflineRevocationSources extracted from a validating documentReturns a list of all OCSPOfflineRevocationSources extracted from a validating documentReturns a read only list of all certificates used in the process of the validation of all signatures from the given document.Returns a read only list of all revocations used in the process of the validation of all signatures from the given document.Returns a read only list of all timestamps processed during the validation of all signatures from the given document.getValidationData(AdvancedSignature signature) Returns a validation data for the given signature's certificate chaingetValidationData(TimestampToken timestampToken) Returns a validation data for the given timestampToken's certificate chainvoidinitialize(CertificateVerifier certificateVerifier) This method initializes theValidationContextby retrieving the relevant data fromcertificateVerifiervoidsetCurrentTime(Date currentTime) This function sets the validation time.voidvalidate()Carries out the validation process in recursive manner for not yet checked tokens.
- 
Method Details- 
initializeThis method initializes theValidationContextby retrieving the relevant data fromcertificateVerifier- Parameters:
- certificateVerifier-- CertificateVerifier
 
- 
setCurrentTimeThis function sets the validation time.- Parameters:
- currentTime- the current- Date
 
- 
getCurrentTimeDate getCurrentTime()Gets the current validation time.- Returns:
- Date
 
- 
addSignatureForVerificationAdds a new signature to collect the information to verify.- Parameters:
- signature-- AdvancedSignatureto extract data to be verified
 
- 
addRevocationTokenForVerificationAdds a new revocation token to the list of tokens to verify. If the revocation token has already been added then it is ignored.- Parameters:
- revocationToken- an instance of- RevocationTokenrevocation tokens to verify
 
- 
addCertificateTokenForVerificationAdds a new certificate token to the list of tokens to verify. If the certificate token has already been added then it is ignored.- Parameters:
- certificateToken-- CertificateTokencertificate token to verify
 
- 
addTimestampTokenForVerificationAdds a new timestamp token to the list of tokens to verify. If the timestamp token has already been added then it is ignored.- Parameters:
- timestampToken-- TimestampTokentimestamp token to verify
 
- 
addDocumentCertificateSourceAdds an extracted certificate source to the used list of sources- Parameters:
- certificateSource-- CertificateSource
 
- 
addDocumentCertificateSourceAdds a list certificate source to the used list of sources- Parameters:
- listCertificateSource-- ListCertificateSource
 
- 
addDocumentCRLSourceAdds an extracted CRL source to the used list of sources- Parameters:
- crlSource-- OfflineRevocationSourcefor CRL
 
- 
addDocumentCRLSourceAdds a list CRL source to the used list of sources- Parameters:
- crlSource-- ListRevocationSourcefor CRL
 
- 
addDocumentOCSPSourceAdds an extracted OCSP source to the used list of sources- Parameters:
- ocspSource-- OfflineRevocationSourcefor OCSP
 
- 
addDocumentOCSPSourceAdds a listd OCSP source to the used list of sources- Parameters:
- ocspSource-- ListRevocationSourcefor OCSP
 
- 
validatevoid validate()Carries out the validation process in recursive manner for not yet checked tokens.
- 
checkAllRequiredRevocationDataPresentboolean checkAllRequiredRevocationDataPresent()This method allows to verify if all processed certificates have a revocation data Additionally, an alert can be handledCertificateVerifier.setAlertOnMissingRevocationData(eu.europa.esig.dss.alert.StatusAlert)- Returns:
- true if all needed revocation data are present
 
- 
checkAllPOECoveredByRevocationDataboolean checkAllPOECoveredByRevocationData()This method allows to verify if all POE (timestamp tokens) are covered by a revocation data Additionally, an alert can be handledCertificateVerifier.setAlertOnUncoveredPOE(eu.europa.esig.dss.alert.StatusAlert)- Returns:
- true if all timestamps are covered by a usable revocation data
 
- 
checkAllTimestampsValidboolean checkAllTimestampsValid()This method allows to verify if all processed timestamps are valid and intact. Additionally, an alert can be handledCertificateVerifier.setAlertOnInvalidTimestamp(eu.europa.esig.dss.alert.StatusAlert)- Returns:
- true if all timestamps are valid
 
- 
checkAllCertificatesValidDeprecated.since DSS 5.12. Use#checkCertificateNotRevoked(CertificateToken certificateToken)or#checkCertificatesNotRevoked(AdvancedSignature signature)depending on validation contextThis method allows to verify if all processed certificates are not revoked Additionally, an alert can be handledCertificateVerifier.setAlertOnRevokedCertificate(eu.europa.esig.dss.alert.StatusAlert)- Returns:
- true if all certificates are valid
 
- 
checkCertificateNotRevokedThis method allows to verify if the certificate is not revoked Additionally, an alert can be handledCertificateVerifier.setAlertOnRevokedCertificate(eu.europa.esig.dss.alert.StatusAlert)- Parameters:
- certificateToken-- CertificateTokencertificate to be checked
- Returns:
- true if all certificates are valid
 
- 
checkCertificatesNotRevokedThis method allows to verify if signature certificates are not revoked Additionally, an alert can be handledCertificateVerifier.setAlertOnRevokedCertificate(eu.europa.esig.dss.alert.StatusAlert)- Parameters:
- signature-- AdvancedSignaturesignature to be checked
- Returns:
- true if all certificates are valid
 
- 
checkAtLeastOneRevocationDataPresentAfterBestSignatureTimeThis method allows to verify if there is at least one revocation data present after the earliest available timestamp token producing time Additionally, an alert can be handledCertificateVerifier.setAlertOnNoRevocationAfterBestSignatureTime(eu.europa.esig.dss.alert.StatusAlert)- Parameters:
- signature-- AdvancedSignaturesignature to be checked
- Returns:
- true if the signing certificate is covered with a updated revocation data (after signature-timestamp production time)
 
- 
checkSignatureNotExpiredThis method verifies if the signing certificate has not been expired yet or has a still valid timestamp Additionally, an alert can be handledCertificateVerifier.setAlertOnExpiredSignature(eu.europa.esig.dss.alert.StatusAlert)- Parameters:
- signature-- AdvancedSignaturesignature to be verified
- Returns:
- true if the signing certificate or its POE(s) not yet expired, false otherwise
 
- 
getProcessedCertificatesSet<CertificateToken> getProcessedCertificates()Returns a read only list of all certificates used in the process of the validation of all signatures from the given document. This list includes the certificate to check, certification chain certificates, OCSP response certificate...- Returns:
- The list of CertificateToken(s)
 
- 
getProcessedRevocationsSet<RevocationToken> getProcessedRevocations()Returns a read only list of all revocations used in the process of the validation of all signatures from the given document.- Returns:
- The list of RevocationToken(s)
 
- 
getProcessedTimestampsSet<TimestampToken> getProcessedTimestamps()Returns a read only list of all timestamps processed during the validation of all signatures from the given document.- Returns:
- The list of TimestampTokens(s)
 
- 
getAllCertificateSourcesListCertificateSource getAllCertificateSources()Returns a list of allCertificateSources used during the validation process. It is represented by sources extracted from the provided document (e.g. signatures, timestamps) as well as the sources obtained during the validation process (e.g. AIA, OCSP).- Returns:
- ListCertificateSource
 
- 
getDocumentCertificateSourceListCertificateSource getDocumentCertificateSource()Returns a list of allCertificateSources extracted from a validating document (signature(s), timestamp(s))- Returns:
- ListCertificateSource
 
- 
getDocumentCRLSourceListRevocationSource<CRL> getDocumentCRLSource()Returns a list of all CRLOfflineRevocationSources extracted from a validating document- Returns:
- ListRevocationSource
 
- 
getDocumentOCSPSourceListRevocationSource<OCSP> getDocumentOCSPSource()Returns a list of all OCSPOfflineRevocationSources extracted from a validating document- Returns:
- ListRevocationSource
 
- 
getValidationDataReturns a validation data for the given signature's certificate chain- Parameters:
- signature-- AdvancedSignatureto extract validation data for
- Returns:
- ValidationData
 
- 
getValidationDataReturns a validation data for the given timestampToken's certificate chain- Parameters:
- timestampToken-- TimestampTokento extract validation data for
- Returns:
- ValidationData
 
 
-