Module jpms_dss_tsl_validation
Package eu.europa.esig.dss.tsl.sha2
Class DefaultTrustedListWithSha2Predicate
java.lang.Object
eu.europa.esig.dss.tsl.sha2.AbstractTrustedListWithSha2Predicate
eu.europa.esig.dss.tsl.sha2.DefaultTrustedListWithSha2Predicate
- All Implemented Interfaces:
Predicate<DocumentWithSha2>
Default implementation of ETSI TS 119 612 sha2 file processing
-
Field Summary
Fields inherited from class eu.europa.esig.dss.tsl.sha2.AbstractTrustedListWithSha2Predicate
NEXT_UPDATE_PATH, SHA2_ALGORITHM -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected DateThis method returns the current time to compare NextUpdate againstprotected booleanisCacheExpired(eu.europa.esig.dss.model.DSSDocument document) This method verifies whether the cache of thedocumenthas expired.voidsetCacheExpirationTime(long cacheExpirationTime) Sets cache expiration time after which the document shall be refreshed Default : -1 (the cache does not expire)booleantest(DocumentWithSha2 documentWithSha2) This method evaluates whether the sha2 digest match the original documentMethods inherited from class eu.europa.esig.dss.tsl.sha2.AbstractTrustedListWithSha2Predicate
getNextUpdate, getOriginalDocumentDigest, getSha2Digest
-
Constructor Details
-
DefaultTrustedListWithSha2Predicate
public DefaultTrustedListWithSha2Predicate()Default constructor
-
-
Method Details
-
setCacheExpirationTime
public void setCacheExpirationTime(long cacheExpirationTime) Sets cache expiration time after which the document shall be refreshed Default : -1 (the cache does not expire)- Parameters:
cacheExpirationTime- indicates time after which the document shall be refreshed in milliseconds
-
test
This method evaluates whether the sha2 digest match the original document- Parameters:
documentWithSha2-DocumentWithSha2containing the original document and downloaded sha2 document- Returns:
- TRUE if the sha2 corresponding to the document match the digest of the cached content and no refresh is required, FALSE otherwise (if refresh is required for any reason)
-
getCurrentTime
This method returns the current time to compare NextUpdate against- Returns:
Date
-
isCacheExpired
protected boolean isCacheExpired(eu.europa.esig.dss.model.DSSDocument document) This method verifies whether the cache of thedocumenthas expired. Note : this method supports only defaulteu.europa.esig.dss.model.FileDocumentimplementation. Override this method, should you need any processing of other implementations.- Parameters:
document-DSSDocumentto verify- Returns:
- TRUE if the cache of the document has expired, FALSE otherwise
-