Class RevocationDataVerifier
java.lang.Object
eu.europa.esig.dss.spi.validation.RevocationDataVerifier
This class is used to verify acceptance of a revocation data for the following validation process,
whether the revocation data has been extracted from a document or obtained from an online source.
The class verifies the consistency of the given revocation information and
applicability of the used cryptographic constraints used to create this token.
NOTE: It is not recommended to use a single instance of
RevocationDataVerifier
within different CertificateVerifiers, as it may lead to concurrency issues during the execution
in multi-threaded environments.
Please use a new RevocationDataVerifier per each CertificateVerifier.-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleancheckCertificateNotRevoked(RevocationToken<?> revocationToken, Date controlTime) This method verifies whether a certificate was not revoked atcontrolTimestatic RevocationDataVerifierThis method is used to instantiate a newRevocationDataVerifier, using the default validation constraints (synchronized with default validation policy).static RevocationDataVerifierCreates an empty instance of RevocationDataVerifier.protected Collection<RevocationToken<?>> Deprecated.since DSS 6.3.Gets a trust anchor verifier.booleanisAcceptable(RevocationToken<?> revocationToken) This method verifies the validity of the givenRevocationTokenusing the embedded issuer certificate token at the current timebooleanisAcceptable(RevocationToken<?> revocationToken, CertificateToken issuerCertificateToken) This method verifies the validity of the givenRevocationTokenat the current timebooleanisAcceptable(RevocationToken<?> revocationToken, CertificateToken issuerCertificateToken, Date controlTime) This method verifies the validity of the givenRevocationTokenatcontrolTimebooleanisAcceptable(RevocationToken<?> revocationToken, CertificateToken issuerCertificateToken, List<CertificateToken> certificateChain, Date controlTime) This method verifies the validity of the givenRevocationTokenatcontrolTimebooleanisAcceptable(RevocationToken<?> revocationToken, Date controlTime) This method verifies the validity of the givenRevocationTokenat the givencontrolTimeusing the embedded issuer certificate tokenprotected booleanisAcceptableSignatureAlgorithm(RevocationToken<?> revocationToken, CertificateToken issuerCertificateToken) Verifies validity of the used signature algorithm on revocation data creation is still valid according to the specified cryptographic constraints.booleanisAfterThisUpdateAndBeforeNextUpdate(RevocationToken<?> revocationToken, Date date) Verifies whether thecontrolTimeis within revocation data's thisUpdate and nextUpdate timesbooleanisCertificateChainValid(List<CertificateToken> certificateTokenChain, Date controlTime, Context context) This method verifies whether the certificate chain is valid at control timeprotected booleanisCertificateNotRevoked(CertificateToken certificateToken, Collection<CertificateToken> certificateChain, Date controlTime) This method verifies whether a certificate token is not revoked at control timeprotected booleanisCertificateNotRevoked(CertificateToken certificateToken, Date controlTime) Deprecated.since DSS 6.3.protected booleanisCertificateValid(CertificateToken certificateToken, Collection<CertificateToken> certificateChain, Date controlTime) Verifies if the certificate is validprotected booleanisCertificateValid(CertificateToken certificateToken, Date controlTime) Deprecated.since DSS 6.3.protected booleanisConsistent(RevocationToken<?> revocation) Verifies whether the revocation token is consistentprotected booleanisGoodIssuer(RevocationToken<?> revocationToken, CertificateToken issuerCertificateToken, Date controlTime) Verifies validity if theissuerCertificateTokenofrevocationTokenprotected booleanisRevocationDataComplete(RevocationToken<?> revocationToken) Verifies whether the revocation token contains all required databooleanisRevocationDataFresh(RevocationToken<?> revocationToken, Date validationTime, Context context) This method verifies if therevocationTokenconsidered withincontextis fresh enough relatively to the givenvalidationTimebooleanisRevocationDataSkip(CertificateToken certificateToken) Checks and returns whether the revocation check shall be skipped for the given certificate at the current timebooleanisRevocationDataSkip(CertificateToken certificateToken, Date controlTime) Checks and returns whether the revocation check shall be skipped for the given certificate at thecontrolTimeprotected booleanisRevocationThisUpdateAfterValidationTime(RevocationToken<?> revocationToken, Date validationTime, long maximumRevocationFreshness) This method verifies whether the revocation's thisUpdate time is after thevalidationTimeminus the acceptablemaximumRevocationFreshnessprotected booleanisRevocationThisUpdateAfterValidationTimeNullConstraint(RevocationToken<?> revocationToken, Date validationTime) This method verifies whether the revocation's thisUpdate time is after thevalidationTimeminus the difference between nextUpdate and thisUpdate field valuesprotected booleanisRevocationTokenValid(RevocationToken<?> revocationToken) Verifies whether the revocation token is cryptographically validprotected booleanisSelfIssuedRevocation(CertificateToken certificateToken, RevocationToken<?> revocationData) Verifies whether the verified certificate does not occur in the revocation's issuer certificate chainprotected booleanisTrustedAtTime(CertificateToken certificateToken, Date controlTime) This method verifies whether thecertificateTokenis trusted atcontrolTimevoidsetAcceptableDigestAlgorithms(Collection<DigestAlgorithm> acceptableDigestAlgorithms) Sets a collection of Digest Algorithms for acceptance.voidsetAcceptableEncryptionAlgorithmKeyLength(Map<EncryptionAlgorithm, Integer> acceptableEncryptionAlgorithmKeyLength) Sets a map of acceptable Encryption Algorithms and their corresponding minimal key length values.voidsetAcceptRevocationCertificatesWithoutRevocation(boolean acceptRevocationCertificatesWithoutRevocation) This method sets whether a revocation certificate without a valid revocation data should be accepted by the verifiervoidsetAcceptTimestampCertificatesWithoutRevocation(boolean acceptTimestampCertificatesWithoutRevocation) This method sets whether a timestamp certificate without a valid revocation data should be accepted by the verifiervoidsetCheckRevocationFreshnessNextUpdate(boolean checkRevocationFreshnessNextUpdate) Sets whether the difference between revocation's nextUpdate and thisUpdate fields shall be taken as a maximum acceptable revocation freshness in case no maximum revocation freshness constraint is defined for the given context Default : FALSE (no revocation freshness check is performed when maximum revocation freshness is not defined)protected voidsetProcessedRevocations(Collection<RevocationToken<?>> processedRevocations) Deprecated.since DSS 6.3.voidsetRevocationMaximumRevocationFreshness(Long revocationMaximumRevocationFreshness) Sets maximum accepted freshness for revocation data issued for revocation data's certificate chain certificates (CRL or OCSP).voidsetRevocationSkipCertificateExtensions(Collection<String> revocationSkipCertificateExtensions) Sets a collection of certificate extension OIDs indicating the revocation check shall be skipped for the given certificate Default : valassured-ST-certs (OID: "0.4.0.194121.2.1") and ocsp_noCheck (OID: "1.3.6.1.5.5.7.48.1.5") (extracted from validation policy)voidsetRevocationSkipCertificatePolicies(Collection<String> revocationSkipCertificatePolicies) Sets a collection of certificate policy OIDs indicating the revocation check shall be skipped for the given certificate Default : empty list (extracted from validation policy)voidsetSignatureMaximumRevocationFreshness(Long signatureMaximumRevocationFreshness) Sets maximum accepted freshness for revocation data issued for signature's certificate chain certificates.voidsetTimestampMaximumRevocationFreshness(Long timestampMaximumRevocationFreshness) Sets maximum accepted freshness for revocation data issued for time-stamp's certificate chain certificates.voidsetTrustAnchorVerifier(TrustAnchorVerifier trustAnchorVerifier) Sets whether a certificate token can be considered as a trust anchor at the given control time Note : This method is used internally during aeu.europa.esig.dss.validation.SignatureValidationContextinitialization, when not defined explicitly, in order to provide the same configuration as the one used within aeu.europa.esig.dss.validation.CertificateVerifier.protected voidsetValidationContext(ValidationContext validationContext) Sets validation context for certificates validation
-
Constructor Details
-
RevocationDataVerifier
protected RevocationDataVerifier()Default constructor
-
-
Method Details
-
createEmptyRevocationDataVerifier
Creates an empty instance of RevocationDataVerifier. All constraints should be configured manually.- Returns:
RevocationDataVerifier
-
createDefaultRevocationDataVerifier
This method is used to instantiate a newRevocationDataVerifier, using the default validation constraints (synchronized with default validation policy).- Returns:
RevocationDataVerifier
-
getProcessedRevocations
Deprecated.since DSS 6.3. Please usevalidationContextinstead.Gets a collection of processed revocations, when present. This method is used internally during aeu.europa.esig.dss.validation.SignatureValidationContextexecution, to verify presence of the collection of processed revocation data- Returns:
- a collection of
RevocationTokens
-
setProcessedRevocations
@Deprecated protected void setProcessedRevocations(Collection<RevocationToken<?>> processedRevocations) Deprecated.since DSS 6.3. Please provide revocation data withinvalidationContextinstead.This method sets a collection of processed revocation tokens, for validation of timestamp's certificate chain. Note : This method is used internally during aeu.europa.esig.dss.validation.SignatureValidationContextinitialization, in order to provide the same revocation data as the one used within the certificate validation process.- Parameters:
processedRevocations- a collection ofRevocationTokens
-
setAcceptableDigestAlgorithms
Sets a collection of Digest Algorithms for acceptance. If a revocation token is signed with an algorithm other than listed in the collection, the token will be skipped. Default : collection of algorithms is synchronized with ETSI 119 312 V1.4.2- Parameters:
acceptableDigestAlgorithms- a collection ifDigestAlgorithms
-
setAcceptableEncryptionAlgorithmKeyLength
public void setAcceptableEncryptionAlgorithmKeyLength(Map<EncryptionAlgorithm, Integer> acceptableEncryptionAlgorithmKeyLength) Sets a map of acceptable Encryption Algorithms and their corresponding minimal key length values. If a revocation token is signed with an algorithm other than listed in the collection or with a smaller key size, than the token will be skipped. Default : collection of algorithms is synchronized with ETSI 119 312 V1.4.2- Parameters:
acceptableEncryptionAlgorithmKeyLength- a map ofEncryptionAlgorithms and their corresponding minimal supported key lengths
-
setRevocationSkipCertificateExtensions
public void setRevocationSkipCertificateExtensions(Collection<String> revocationSkipCertificateExtensions) Sets a collection of certificate extension OIDs indicating the revocation check shall be skipped for the given certificate Default : valassured-ST-certs (OID: "0.4.0.194121.2.1") and ocsp_noCheck (OID: "1.3.6.1.5.5.7.48.1.5") (extracted from validation policy)- Parameters:
revocationSkipCertificateExtensions- a collection ofStrings certificate extension OIDs
-
setRevocationSkipCertificatePolicies
public void setRevocationSkipCertificatePolicies(Collection<String> revocationSkipCertificatePolicies) Sets a collection of certificate policy OIDs indicating the revocation check shall be skipped for the given certificate Default : empty list (extracted from validation policy)- Parameters:
revocationSkipCertificatePolicies- a collection ofStrings certificate policy OIDs
-
setSignatureMaximumRevocationFreshness
Sets maximum accepted freshness for revocation data issued for signature's certificate chain certificates. NULL value is used to disable the check. Default : 0 (revocation data shall be issued after the best-signature-time)- Parameters:
signatureMaximumRevocationFreshness-Longin milliseconds to evaluate revocation freshness,
-
setTimestampMaximumRevocationFreshness
Sets maximum accepted freshness for revocation data issued for time-stamp's certificate chain certificates. NULL value is used to disable the check. Default : 0 (revocation data shall be issued after the time-stamp's lowest POE) Note : algorithm always ensures that there is a revocation data issued after the usage time of the time-stamp's certificate- Parameters:
timestampMaximumRevocationFreshness-Longin milliseconds
-
setRevocationMaximumRevocationFreshness
Sets maximum accepted freshness for revocation data issued for revocation data's certificate chain certificates (CRL or OCSP). NULL value is used to disable the check. Default : 0 (revocation data shall be issued after the best-signature-time) Note : the signature or timestamp constraint takes precedence in case of conflict- Parameters:
revocationMaximumRevocationFreshness-Longin milliseconds
-
setCheckRevocationFreshnessNextUpdate
public void setCheckRevocationFreshnessNextUpdate(boolean checkRevocationFreshnessNextUpdate) Sets whether the difference between revocation's nextUpdate and thisUpdate fields shall be taken as a maximum acceptable revocation freshness in case no maximum revocation freshness constraint is defined for the given context Default : FALSE (no revocation freshness check is performed when maximum revocation freshness is not defined)- Parameters:
checkRevocationFreshnessNextUpdate- whether revocation freshness should be checked against nextUpdate field
-
setAcceptTimestampCertificatesWithoutRevocation
public void setAcceptTimestampCertificatesWithoutRevocation(boolean acceptTimestampCertificatesWithoutRevocation) This method sets whether a timestamp certificate without a valid revocation data should be accepted by the verifier- Parameters:
acceptTimestampCertificatesWithoutRevocation- whether a timestamp certificate without revocation data should be accepted
-
setAcceptRevocationCertificatesWithoutRevocation
public void setAcceptRevocationCertificatesWithoutRevocation(boolean acceptRevocationCertificatesWithoutRevocation) This method sets whether a revocation certificate without a valid revocation data should be accepted by the verifier- Parameters:
acceptRevocationCertificatesWithoutRevocation- whether a revocation certificate without revocation data should be accepted
-
getTrustAnchorVerifier
Gets a trust anchor verifier. This method is used internally withineu.europa.esig.dss.validation.SignatureValidationContextto identify whether the configuration is already present and atrustAnchorVerifiershould be set.- Returns:
TrustAnchorVerifier
-
setTrustAnchorVerifier
Sets whether a certificate token can be considered as a trust anchor at the given control time Note : This method is used internally during aeu.europa.esig.dss.validation.SignatureValidationContextinitialization, when not defined explicitly, in order to provide the same configuration as the one used within aeu.europa.esig.dss.validation.CertificateVerifier.- Parameters:
trustAnchorVerifier-TrustAnchorVerifier
-
setValidationContext
Sets validation context for certificates validation- Parameters:
validationContext-ValidationContext
-
isAcceptable
This method verifies the validity of the givenRevocationTokenusing the embedded issuer certificate token at the current time- Parameters:
revocationToken-RevocationToken- Returns:
- TRUE if the revocation data is acceptable to continue the validation process, FALSE otherwise
-
isAcceptable
This method verifies the validity of the givenRevocationTokenat the givencontrolTimeusing the embedded issuer certificate token- Parameters:
revocationToken-RevocationTokencontrolTime-Date- Returns:
- TRUE if the revocation data is acceptable to continue the validation process, FALSE otherwise
-
isAcceptable
public boolean isAcceptable(RevocationToken<?> revocationToken, CertificateToken issuerCertificateToken) This method verifies the validity of the givenRevocationTokenat the current time- Parameters:
revocationToken-RevocationTokenissuerCertificateToken-CertificateTokenissued the current revocation- Returns:
- TRUE if the revocation data is acceptable to continue the validation process, FALSE otherwise
-
isAcceptable
public boolean isAcceptable(RevocationToken<?> revocationToken, CertificateToken issuerCertificateToken, Date controlTime) This method verifies the validity of the givenRevocationTokenatcontrolTime- Parameters:
revocationToken-RevocationTokenissuerCertificateToken-CertificateTokenissued the current revocationcontrolTime-Date- Returns:
- TRUE if the revocation data is acceptable to continue the validation process, FALSE otherwise
-
isAcceptable
public boolean isAcceptable(RevocationToken<?> revocationToken, CertificateToken issuerCertificateToken, List<CertificateToken> certificateChain, Date controlTime) This method verifies the validity of the givenRevocationTokenatcontrolTime- Parameters:
revocationToken-RevocationTokenissuerCertificateToken-CertificateTokenissued the current revocationcertificateChain- a list ofCertificateTokens, representing a certificate chain of the issuercontrolTime-Date- Returns:
- TRUE if the revocation data is acceptable to continue the validation process, FALSE otherwise
-
isRevocationTokenValid
Verifies whether the revocation token is cryptographically valid- Parameters:
revocationToken-RevocationTokento be verified- Returns:
- TRUE if the revocation token is valid, FALSE otherwise
-
isRevocationDataComplete
Verifies whether the revocation token contains all required data- Parameters:
revocationToken-RevocationTokento be verifies- Returns:
- TRUE if the revocation token is complete, FALSE otherwise
-
isGoodIssuer
protected boolean isGoodIssuer(RevocationToken<?> revocationToken, CertificateToken issuerCertificateToken, Date controlTime) Verifies validity if theissuerCertificateTokenofrevocationToken- Parameters:
revocationToken-RevocationTokenconcerned revocation tokenissuerCertificateToken-CertificateTokenissued the revocation tokencontrolTime-Datevalidation time- Returns:
- TRUE if the issuer certificate token is valid at the control time, FALSE otherwise
-
isConsistent
Verifies whether the revocation token is consistent- Parameters:
revocation-RevocationTokento be verified- Returns:
- TRUE if the revocation token is consistent, FALSE otherwise
-
isAcceptableSignatureAlgorithm
protected boolean isAcceptableSignatureAlgorithm(RevocationToken<?> revocationToken, CertificateToken issuerCertificateToken) Verifies validity of the used signature algorithm on revocation data creation is still valid according to the specified cryptographic constraints.- Parameters:
revocationToken-RevocationTokento be verifiedissuerCertificateToken-CertificateTokenissued the revocation token- Returns:
- TRUE if the signature algorithm used on revocation token creation, FALSE otherwise
-
isRevocationDataSkip
Checks and returns whether the revocation check shall be skipped for the given certificate at the current time- Parameters:
certificateToken-CertificateTokento check- Returns:
- TRUE if the revocation check shall be skipped, FALSE otherwise
-
isRevocationDataSkip
Checks and returns whether the revocation check shall be skipped for the given certificate at thecontrolTime- Parameters:
certificateToken-CertificateTokento checkcontrolTime-Datethe validation time- Returns:
- TRUE if the revocation check shall be skipped, FALSE otherwise
-
isTrustedAtTime
This method verifies whether thecertificateTokenis trusted atcontrolTime- Parameters:
certificateToken-CertificateTokento checkcontrolTime-Datethe validation time- Returns:
- TRUE if the certificate is trusted at the given time, FALSE otherwise
-
isRevocationDataFresh
public boolean isRevocationDataFresh(RevocationToken<?> revocationToken, Date validationTime, Context context) This method verifies if therevocationTokenconsidered withincontextis fresh enough relatively to the givenvalidationTime- Parameters:
revocationToken-RevocationTokento be validatedvalidationTime-Datethe target time after which revocation token is expected to be refreshedcontext-Contextof the current revocation token's validation process- Returns:
- TRUE if the revocation token is considered fresh enough, FALSE otherwise
-
isRevocationThisUpdateAfterValidationTime
protected boolean isRevocationThisUpdateAfterValidationTime(RevocationToken<?> revocationToken, Date validationTime, long maximumRevocationFreshness) This method verifies whether the revocation's thisUpdate time is after thevalidationTimeminus the acceptablemaximumRevocationFreshness- Parameters:
revocationToken-RevocationTokento be validatedvalidationTime-DatemaximumRevocationFreshness- long- Returns:
- TRUE if the revocation's thisUpdate is after the validation time minus the maximum acceptable revocation freshness, FALSE otherwise
-
isRevocationThisUpdateAfterValidationTimeNullConstraint
protected boolean isRevocationThisUpdateAfterValidationTimeNullConstraint(RevocationToken<?> revocationToken, Date validationTime) This method verifies whether the revocation's thisUpdate time is after thevalidationTimeminus the difference between nextUpdate and thisUpdate field values- Parameters:
revocationToken-RevocationTokento be validatedvalidationTime-Date- Returns:
- TRUE if the revocation freshness check succeeds against revocation's nextUpdate, FALSE otherwise
-
checkCertificateNotRevoked
This method verifies whether a certificate was not revoked atcontrolTime- Parameters:
revocationToken-RevocationTokento checkcontrolTime-Datetime to check at- Returns:
- TRUE if the certificate was not revoked at control time, FALSE otherwise
-
isAfterThisUpdateAndBeforeNextUpdate
Verifies whether thecontrolTimeis within revocation data's thisUpdate and nextUpdate times- Parameters:
revocationToken-RevocationTokento validatedate-Datevalidation time- Returns:
- TRUE if the control time is within thisUpdate and nextUpdate times, FALSE otherwise
-
isCertificateChainValid
public boolean isCertificateChainValid(List<CertificateToken> certificateTokenChain, Date controlTime, Context context) This method verifies whether the certificate chain is valid at control time- Parameters:
certificateTokenChain- a list ofCertificateTokenscontrolTime-Datevalidation timecontext-Contextvalidation context- Returns:
- TRUE if the certificate chain is valid at control time, FALSE otherwise
-
isCertificateValid
@Deprecated protected boolean isCertificateValid(CertificateToken certificateToken, Date controlTime) Deprecated.since DSS 6.3. Please use#isCertificateValid(certificateToken, certificateChain, controlTime)instead.Verifies if the certificate is valid- Parameters:
certificateToken-CertificateTokencontrolTime-Date- Returns:
- TRUE if the certificate token is valid, FALSE otherwise
-
isCertificateValid
protected boolean isCertificateValid(CertificateToken certificateToken, Collection<CertificateToken> certificateChain, Date controlTime) Verifies if the certificate is valid- Parameters:
certificateToken-CertificateTokencertificateChain- collection ofCertificateTokenscontrolTime-Date- Returns:
- TRUE if the certificate token is valid, FALSE otherwise
-
isCertificateNotRevoked
@Deprecated protected boolean isCertificateNotRevoked(CertificateToken certificateToken, Date controlTime) Deprecated.since DSS 6.3. Please use#isCertificateNotRevoked(certificateToken, certificateChain, controlTime)instead.This method verifies whether a certificate token is not revoked at control time- Parameters:
certificateToken-CertificateTokento validatedcontrolTime-Datevalidation time- Returns:
- TRUE if the certificate token is valid at control time, FALSE otherwise
-
isCertificateNotRevoked
protected boolean isCertificateNotRevoked(CertificateToken certificateToken, Collection<CertificateToken> certificateChain, Date controlTime) This method verifies whether a certificate token is not revoked at control time- Parameters:
certificateToken-CertificateTokento validatedcertificateChain- collection ofCertificateTokenscontrolTime-Datevalidation time- Returns:
- TRUE if the certificate token is valid at control time, FALSE otherwise
-
isSelfIssuedRevocation
protected boolean isSelfIssuedRevocation(CertificateToken certificateToken, RevocationToken<?> revocationData) Verifies whether the verified certificate does not occur in the revocation's issuer certificate chain- Parameters:
certificateToken-CertificateTokento be verifiedrevocationData-RevocationToken- Returns:
- TRUE if the certificate occurs in the revocation's certificate chain, FALSE otherwise
-