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 Summary
Modifier and Type Method Description void
addCertificateTokenForVerification(CertificateToken certificateToken)
Adds a new certificate token to the list of tokens to verify.void
addRevocationTokenForVerification(RevocationToken<Revocation> revocationToken)
Adds a new revocation token to the list of tokens to verify.void
addTimestampTokenForVerification(TimestampToken timestampToken)
Adds a new timestamp token to the list of tokens to verify.boolean
checkAllCertificatesValid()
This method allows to verify if all processed certificates are not revoked Additionally, an alert can be handledCertificateVerifier.setAlertOnRevokedCertificate(eu.europa.esig.dss.alert.StatusAlert)
boolean
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)
boolean
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)
boolean
checkAllTimestampsValid()
This method allows to verify if all processed timestamps are valid and intact.boolean
checkAtLeastOneRevocationDataPresentAfterBestSignatureTime(CertificateToken signingCertificate)
This 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)
Map<CertificateToken,Set<CertificateSourceType>>
getCertificateSourceTypes()
Returns a map ofCertificateSourceType
byCertificateToken
which contains the sources where the certificate was found.Date
getCurrentTime()
Set<CertificateToken>
getProcessedCertificates()
Returns a read only list of all certificates used in the process of the validation of all signatures from the given document.Set<RevocationToken<Revocation>>
getProcessedRevocations()
Returns a read only list of all revocations used in the process of the validation of all signatures from the given document.Set<TimestampToken>
getProcessedTimestamps()
Returns a read only list of all timestamps processed during the validation of all signatures from the given document.void
initialize(CertificateVerifier certificateVerifier)
void
setCurrentTime(Date currentTime)
This function sets the validation time.void
validate()
Carries out the validation process in recursive manner for not yet checked tokens.
-
Method Details
-
setCurrentTime
This function sets the validation time.- Parameters:
currentTime
- the currentDate
-
initialize
-
getCurrentTime
Date getCurrentTime() -
addRevocationTokenForVerification
Adds 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 ofRevocationToken
revocation tokens to verify
-
addCertificateTokenForVerification
Adds 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
-CertificateToken
certificate token to verify
-
addTimestampTokenForVerification
Adds 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
-TimestampToken
timestamp token to verify
-
validate
void validate()Carries out the validation process in recursive manner for not yet checked tokens. -
checkAllRequiredRevocationDataPresent
boolean 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
-
checkAllPOECoveredByRevocationData
boolean 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
-
checkAllTimestampsValid
boolean 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
-
checkAllCertificatesValid
boolean checkAllCertificatesValid()This 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
-
checkAtLeastOneRevocationDataPresentAfterBestSignatureTime
boolean checkAtLeastOneRevocationDataPresentAfterBestSignatureTime(CertificateToken signingCertificate)This 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:
signingCertificate
-CertificateToken
signing certificate of the signature to be checked- Returns:
- true if the signing certificate is covered with a updated revocation data (after signature-timestamp production time)
-
getProcessedCertificates
Set<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)
-
getCertificateSourceTypes
Map<CertificateToken,Set<CertificateSourceType>> getCertificateSourceTypes()Returns a map ofCertificateSourceType
byCertificateToken
which contains the sources where the certificate was found.- Returns:
- a map of CertificateSourceType by CertificateToken
-
getProcessedRevocations
Set<RevocationToken<Revocation>> 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 CertificateToken(s)
-
getProcessedTimestamps
Set<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 CertificateToken(s)
-