Package eu.europa.esig.dss.tsl.sha2
Class AbstractTrustedListWithSha2Predicate
java.lang.Object
eu.europa.esig.dss.tsl.sha2.AbstractTrustedListWithSha2Predicate
- All Implemented Interfaces:
Predicate<DocumentWithSha2>
- Direct Known Subclasses:
DefaultTrustedListWithSha2Predicate
public abstract class AbstractTrustedListWithSha2Predicate
extends Object
implements Predicate<DocumentWithSha2>
This is an abstract implementation of a Predicate for a Trusted List document with sha2 processing,
containing common utility methods for a Trusted List validation
-
Field Summary
Modifier and TypeFieldDescriptionprotected static final String
The path to reach a tl:NextUpdate elementprotected static final DigestAlgorithm
The default sha2 digest algorithm defined in ETSI TS 119 612 -
Constructor Summary
ModifierConstructorDescriptionprotected
Default constructor -
Method Summary
Modifier and TypeMethodDescriptionprotected Date
getNextUpdate
(DSSDocument tlDocument) This method retrieves a NextUpdate date value from the provided Trusted List documentprotected Digest
getOriginalDocumentDigest
(DSSDocument document) This method computesDigest
on the givenDSSDocument
's contentprotected Digest
getSha2Digest
(DSSDocument sha2Document) This method parses thesha2Document
and returns theDigest
abstract boolean
test
(DocumentWithSha2 documentWithSha2) This method evaluates whether the sha2 digest match the original document
-
Field Details
-
SHA2_ALGORITHM
The default sha2 digest algorithm defined in ETSI TS 119 612 -
NEXT_UPDATE_PATH
-
-
Constructor Details
-
AbstractTrustedListWithSha2Predicate
protected AbstractTrustedListWithSha2Predicate()Default constructor
-
-
Method Details
-
test
This method evaluates whether the sha2 digest match the original document- Specified by:
test
in interfacePredicate<DocumentWithSha2>
- 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)
-
getOriginalDocumentDigest
This method computesDigest
on the givenDSSDocument
's content- Parameters:
document
-DSSDocument
to compute digest on- Returns:
Digest
-
getSha2Digest
This method parses thesha2Document
and returns theDigest
- Parameters:
sha2Document
-DSSDocument
representing a sha2 document- Returns:
Digest
-
getNextUpdate
This method retrieves a NextUpdate date value from the provided Trusted List document- Parameters:
tlDocument
-DSSDocument
representing a cached Trusted List- Returns:
Date
NextUpdate (when defined)
-