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 TypeMethodDescriptionstatic TimestampTokenVerifierCreates a default instance of TimestampTokenVerifier, with pre-configured constraints.static TimestampTokenVerifierCreates an empty instance of TimestampTokenVerifier.Gets trusted certificate source, when presentbooleanisAcceptable(TimestampToken timestampToken) This method verifies whether the giventimestampTokenis valid and acceptable, 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, and its POE can be extracted to the validation processprotected booleanisCryptographicallyValid(TimestampToken timestampToken) This method verifies whether thetimestampTokenis cryptographically valid (signature and message imprint match)protected booleanisTrustedTimestampToken(TimestampToken timestampToken, List<CertificateToken> certificateChain) This method verifies whether thetimestampTokenis trusted to continue the process.voidsetAcceptUntrustedCertificateChains(boolean acceptUntrustedCertificateChains) Sets whether only timestamp created with trusted certificate chains shall be considered as valid Default: TRUE (only timestamps created with trusted CAs are considered as valid, untrusted timestamps are ignored)protected voidsetTrustedCertificateSource(CertificateSource trustedCertificateSource) Sets a trusted certificate source in order to accept trusted timestamp certificate chains.
-
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
-
getTrustedCertificateSource
Gets trusted certificate source, when present- Returns:
CertificateSource
-
setTrustedCertificateSource
Sets a trusted certificate source in order to accept trusted timestamp certificate chains. Note : This method is used internally during aeu.europa.esig.dss.validation.SignatureValidationContextinitialization, in order to provide the same trusted source as the one used within aeu.europa.esig.dss.validation.CertificateVerifier.- Parameters:
trustedCertificateSource-CertificateSource
-
setAcceptUntrustedCertificateChains
public void setAcceptUntrustedCertificateChains(boolean acceptUntrustedCertificateChains) Sets whether only timestamp created with trusted certificate chains shall be considered as valid Default: TRUE (only timestamps created with trusted CAs are considered as valid, untrusted timestamps are ignored)- Parameters:
acceptUntrustedCertificateChains- whether only trusted timestamps are considered as valid
-
isAcceptable
This method verifies whether the giventimestampTokenis valid and acceptable, 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, 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
-
isTrustedTimestampToken
protected boolean isTrustedTimestampToken(TimestampToken timestampToken, List<CertificateToken> certificateChain) This method verifies whether thetimestampTokenis trusted to continue the process. 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 timestamp- Returns:
- TRUE of the timestamp token 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
-