Class ZipContentEvidenceRecordDigestBuilder
java.lang.Object
eu.europa.esig.dss.asic.common.evidencerecord.ZipContentEvidenceRecordDigestBuilder
- Direct Known Subclasses:
ASiCEvidenceRecordDigestBuilder
Builds hashes for all documents present within a ZIP archive.
Note: for covering an ASiC container with an evidence record, please use
ASiCEvidenceRecordDigestBuilder
-
Field Summary
Modifier and TypeFieldDescriptionprotected DataObjectDigestBuilderFactory
Factory to be used to instantiate a newDataObjectDigestBuilder
for hashes computationprotected final DigestAlgorithm
The digest algorithm to be used on hash computation. -
Constructor Summary
ModifierConstructorDescriptionprotected
Empty constructorprotected
ZipContentEvidenceRecordDigestBuilder
(DigestAlgorithm digestAlgorithm) Constructor with defined digest algorithmZipContentEvidenceRecordDigestBuilder
(DSSDocument zipContainer) Creates a ZipContentEvidenceRecordDigestBuilder to build hashes from aDSSDocument
, represented by a ZIP container, using a default SHA-256 digest algorithmZipContentEvidenceRecordDigestBuilder
(DSSDocument zipContainer, DigestAlgorithm digestAlgorithm) Creates a ZipContentEvidenceRecordDigestBuilder to build hashes with the providedDigestAlgorithm
from aDSSDocument
, represented by a ZIP container -
Method Summary
Modifier and TypeMethodDescriptionprotected void
This method verifies whether the configuration of the current builder class is validBuilds a list of hashes for the content files of the provided ZIP containercomputeDigestForDocuments
(List<DSSDocument> documents) Computes a list of digests for the given list ofDSSDocument
ssetDataObjectDigestBuilderFactory
(DataObjectDigestBuilderFactory dataObjectDigestBuilderFactory) Sets a factory to instantiate a newDataObjectDigestBuilder
for hashes computation of the given evidence record type (e.g.
-
Field Details
-
digestAlgorithm
The digest algorithm to be used on hash computation. Default : DigestAlgorithm.SHA256 -
dataObjectDigestBuilderFactory
Factory to be used to instantiate a newDataObjectDigestBuilder
for hashes computation
-
-
Constructor Details
-
ZipContentEvidenceRecordDigestBuilder
protected ZipContentEvidenceRecordDigestBuilder()Empty constructor -
ZipContentEvidenceRecordDigestBuilder
Constructor with defined digest algorithm- Parameters:
digestAlgorithm
-DigestAlgorithm
-
ZipContentEvidenceRecordDigestBuilder
Creates a ZipContentEvidenceRecordDigestBuilder to build hashes from aDSSDocument
, represented by a ZIP container, using a default SHA-256 digest algorithm- Parameters:
zipContainer
-DSSDocument
representing a ZIP container, which content will be covered by an Evidence Record
-
ZipContentEvidenceRecordDigestBuilder
public ZipContentEvidenceRecordDigestBuilder(DSSDocument zipContainer, DigestAlgorithm digestAlgorithm) Creates a ZipContentEvidenceRecordDigestBuilder to build hashes with the providedDigestAlgorithm
from aDSSDocument
, represented by a ZIP container- Parameters:
zipContainer
-DSSDocument
representing a ZIP container, which content will be covered by an Evidence RecorddigestAlgorithm
-DigestAlgorithm
to be used on digest computation
-
-
Method Details
-
setDataObjectDigestBuilderFactory
public ZipContentEvidenceRecordDigestBuilder setDataObjectDigestBuilderFactory(DataObjectDigestBuilderFactory dataObjectDigestBuilderFactory) Sets a factory to instantiate a newDataObjectDigestBuilder
for hashes computation of the given evidence record type (e.g. XMLERS or ASN.1 ERS)- Parameters:
dataObjectDigestBuilderFactory
-DataObjectDigestBuilderFactory
- Returns:
- this
ZipContentEvidenceRecordDigestBuilder
-
buildDigestGroup
-
assertConfigurationValid
protected void assertConfigurationValid()This method verifies whether the configuration of the current builder class is valid -
computeDigestForDocuments
Computes a list of digests for the given list ofDSSDocument
s- Parameters:
documents
- a list ofDSSDocument
s to compute digests for- Returns:
- a list of
Digest
s
-