Class TimestampTokenVerifier
java.lang.Object
eu.europa.esig.dss.spi.validation.TimestampTokenVerifier
This class is used to verify applicability of a timestamp token within the signature validation process
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected booleancontainsTrustAnchor(List<CertificateToken> certChain, Date controlTime) This method verifies whether the certificate chain is trusted at the given timestatic TimestampTokenVerifierCreates a default instance of TimestampTokenVerifier, with pre-configured constraints.static TimestampTokenVerifierCreates an empty instance of TimestampTokenVerifier.Gets a revocation data verifier.Gets a trust anchor verifier.booleanisAcceptable(TimestampToken timestampToken) This method verifies whether the giventimestampTokenis valid and acceptable at the current time, and its POE can be extracted to the validation process.booleanisAcceptable(TimestampToken timestampToken, Date controlTime) This method verifies whether the giventimestampTokenis valid and acceptable at the given control time, and its POE can be extracted to the validation process.booleanisAcceptable(TimestampToken timestampToken, List<CertificateToken> certificateChain) This method verifies whether the giventimestampTokenis valid and acceptable at the current time, and its POE can be extracted to the validation processbooleanisAcceptable(TimestampToken timestampToken, List<CertificateToken> certificateChain, Date controlTime) This method verifies whether the giventimestampTokenis valid and acceptable at the given control time, and its POE can be extracted to the validation processprotected booleanisCertificateChainValid(List<CertificateToken> certificateChain, Date controlTime) This method verifies certificate chain and presence of a valid revocation data for certificatesprotected booleanisCryptographicallyValid(TimestampToken timestampToken) This method verifies whether thetimestampTokenis cryptographically valid (signature and message imprint match)protected booleanisTrustedTimestampToken(TimestampToken timestampToken, List<CertificateToken> certificateChain, Date controlTime) This method verifies whether thetimestampTokenis trusted to continue the process at the control time.voidsetRevocationDataVerifier(RevocationDataVerifier revocationDataVerifier) Sets a revocation data verifier for validation of timestamp's certificate chain revocation data validity 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.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.
-
Constructor Details
-
TimestampTokenVerifier
protected TimestampTokenVerifier()Default constructor
-
-
Method Details
-
createEmptyTimestampTokenVerifier
Creates an empty instance of TimestampTokenVerifier. All constraints should be configured manually.- Returns:
TimestampTokenVerifier
-
createDefaultTimestampTokenVerifier
Creates a default instance of TimestampTokenVerifier, with pre-configured constraints.- Returns:
TimestampTokenVerifier
-
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
-
getRevocationDataVerifier
Gets a revocation data 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
-
setRevocationDataVerifier
Sets a revocation data verifier for validation of timestamp's certificate chain revocation data validity 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:
revocationDataVerifier-RevocationDataVerifier
-
isAcceptable
This method verifies whether the giventimestampTokenis valid and acceptable at the current time, and its POE can be extracted to the validation process. NOTE: The method does not accept certificate chain, thus validity of the timestamp's certificate chain is not verified. To successfully, execute this method, the parameteracceptOnlyTrustedCertificateChainsshall be set to FALSE. For validation with a certificate chain, please use#isAcceptable(timestampToken, certificateChain)method.- Parameters:
timestampToken-TimestampTokento be validated- Returns:
- TRUE if the timestampToken is valid and acceptable, FALSE otherwise
-
isAcceptable
This method verifies whether the giventimestampTokenis valid and acceptable at the given control time, and its POE can be extracted to the validation process. NOTE: The method does not accept certificate chain, thus validity of the timestamp's certificate chain is not verified. To successfully, execute this method, the parameteracceptOnlyTrustedCertificateChainsshall be set to FALSE. For validation with a certificate chain, please use#isAcceptable(timestampToken, certificateChain)method.- Parameters:
timestampToken-TimestampTokento be validatedcontrolTime-Datethe validation time- Returns:
- TRUE if the timestampToken is valid and acceptable, FALSE otherwise
-
isAcceptable
This method verifies whether the giventimestampTokenis valid and acceptable at the current time, and its POE can be extracted to the validation process- Parameters:
timestampToken-TimestampTokento be validatedcertificateChain- a list ofCertificateTokens representing the certificate chain of the timestamp- Returns:
- TRUE if the timestampToken is valid and acceptable, FALSE otherwise
-
isAcceptable
public boolean isAcceptable(TimestampToken timestampToken, List<CertificateToken> certificateChain, Date controlTime) This method verifies whether the giventimestampTokenis valid and acceptable at the given control time, and its POE can be extracted to the validation process- Parameters:
timestampToken-TimestampTokento be validatedcertificateChain- a list ofCertificateTokens representing the certificate chain of the timestampcontrolTime-Datethe validation time- Returns:
- TRUE if the timestampToken is valid and acceptable, FALSE otherwise
-
isTrustedTimestampToken
protected boolean isTrustedTimestampToken(TimestampToken timestampToken, List<CertificateToken> certificateChain, Date controlTime) This method verifies whether thetimestampTokenis trusted to continue the process at the control time. The method expects the certificate chain of the timestamp to reach atrustedCertificateSourceor to haveacceptOnlyTrustedCertificateChainsconstraint to accept untrusted certificate chains as well.- Parameters:
timestampToken-TimestampTokento be validatedcertificateChain- a list ofCertificateTokens representing the certificate chain of the timestampcontrolTime-Dateto verify the trust anchor's validity period- Returns:
- TRUE of the timestamp token is trusted, FALSE otherwise
-
containsTrustAnchor
This method verifies whether the certificate chain is trusted at the given time- Parameters:
certChain- a list ofCertificateTokens representing a certificate chain to validatecontrolTime-Datevalidation time- Returns:
- TRUE if the certificate chain is trusted, FALSE otherwise
-
isCryptographicallyValid
This method verifies whether thetimestampTokenis cryptographically valid (signature and message imprint match)- Parameters:
timestampToken-TimestampTokento be validated- Returns:
- TRUE if the timestamp token is cryptographically valid, FALSE otherwise
-
isCertificateChainValid
protected boolean isCertificateChainValid(List<CertificateToken> certificateChain, Date controlTime) This method verifies certificate chain and presence of a valid revocation data for certificates- Parameters:
certificateChain- a list ofCertificateTokenscontrolTime-Datevalidation time- Returns:
- TRUE if the certificate chain is valid, FALSE otherwise
-