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
-
Method Summary
Modifier and TypeMethodDescriptionprotected Date
This method returns the current time to compare NextUpdate againstprotected boolean
isCacheExpired
(DSSDocument document) This method verifies whether the cache of thedocument
has expired.void
setCacheExpirationTime
(long cacheExpirationTime) Sets cache expiration time after which the document shall be refreshed Default : -1 (the cache does not expire)boolean
test
(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
Description copied from class:AbstractTrustedListWithSha2Predicate
This method evaluates whether the sha2 digest match the original document- Specified by:
test
in interfacePredicate<DocumentWithSha2>
- Specified by:
test
in classAbstractTrustedListWithSha2Predicate
- Parameters:
documentWithSha2
-DocumentWithSha2
containing 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
-
isCacheExpired
This method verifies whether the cache of thedocument
has expired. Note : this method supports only defaulteu.europa.esig.dss.model.FileDocument
implementation. Override this method, should you need any processing of other implementations.- Parameters:
document
-DSSDocument
to verify- Returns:
- TRUE if the cache of the document has expired, FALSE otherwise
-