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
-
Method Summary
Modifier and TypeMethodDescriptionstatic TimestampTokenVerifier
Creates a default instance of TimestampTokenVerifier, with pre-configured constraints.static TimestampTokenVerifier
Creates an empty instance of TimestampTokenVerifier.Gets trusted certificate source, when presentboolean
isAcceptable
(TimestampToken timestampToken) This method verifies whether the giventimestampToken
is valid and acceptable, and its POE can be extracted to the validation process.boolean
isAcceptable
(TimestampToken timestampToken, List<CertificateToken> certificateChain) This method verifies whether the giventimestampToken
is valid and acceptable, and its POE can be extracted to the validation processprotected boolean
isCryptographicallyValid
(TimestampToken timestampToken) This method verifies whether thetimestampToken
is cryptographically valid (signature and message imprint match)protected boolean
isTrustedTimestampToken
(TimestampToken timestampToken, List<CertificateToken> certificateChain) This method verifies whether thetimestampToken
is trusted to continue the process.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)protected void
setTrustedCertificateSource
(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.SignatureValidationContext
initialization, 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 giventimestampToken
is 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 parameteracceptOnlyTrustedCertificateChains
shall be set to FALSE. For validation with a certificate chain, please use#isAcceptable(timestampToken, certificateChain)
method.- Parameters:
timestampToken
-TimestampToken
to be validated- Returns:
- TRUE if the timestampToken is valid and acceptable, FALSE otherwise
-
isAcceptable
This method verifies whether the giventimestampToken
is valid and acceptable, and its POE can be extracted to the validation process- Parameters:
timestampToken
-TimestampToken
to be validatedcertificateChain
- a list ofCertificateToken
s 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 thetimestampToken
is trusted to continue the process. The method expects the certificate chain of the timestamp to reach atrustedCertificateSource
or to haveacceptOnlyTrustedCertificateChains
constraint to accept untrusted certificate chains as well.- Parameters:
timestampToken
-TimestampToken
to be validatedcertificateChain
- a list ofCertificateToken
s representing the certificate chain of the timestamp- Returns:
- TRUE of the timestamp token is trusted, FALSE otherwise
-
isCryptographicallyValid
This method verifies whether thetimestampToken
is cryptographically valid (signature and message imprint match)- Parameters:
timestampToken
-TimestampToken
to be validated- Returns:
- TRUE if the timestamp token is cryptographically valid, FALSE otherwise
-