Class DefaultTrustedListWithSha2Predicate

java.lang.Object
eu.europa.esig.dss.tsl.sha2.AbstractTrustedListWithSha2Predicate
eu.europa.esig.dss.tsl.sha2.DefaultTrustedListWithSha2Predicate
All Implemented Interfaces:
Predicate<DocumentWithSha2>

public class DefaultTrustedListWithSha2Predicate extends AbstractTrustedListWithSha2Predicate
Default implementation of ETSI TS 119 612 sha2 file processing
  • 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

      public boolean test(DocumentWithSha2 documentWithSha2)
      This method evaluates whether the sha2 digest match the original document
      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

      protected Date getCurrentTime()
      This method returns the current time to compare NextUpdate against
      Returns:
      Date
    • isCacheExpired

      protected boolean isCacheExpired(DSSDocument document)
      This method verifies whether the cache of the document has expired. Note : this method supports only default eu.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