Class AbstractSignatureEvidenceRecordDigestBuilder
java.lang.Object
eu.europa.esig.dss.spi.validation.evidencerecord.AbstractSignatureEvidenceRecordDigestBuilder
- All Implemented Interfaces:
SignatureEvidenceRecordDigestBuilder
- Direct Known Subclasses:
CAdESEvidenceRecordDigestBuilder
,XAdESEvidenceRecordDigestBuilder
public abstract class AbstractSignatureEvidenceRecordDigestBuilder
extends Object
implements SignatureEvidenceRecordDigestBuilder
Abstract implementation of the
SignatureEvidenceRecordDigestGenerator
-
Field Summary
Modifier and TypeFieldDescriptionprotected final DigestAlgorithm
The digest algorithm to be used on hash computation.protected boolean
Defines whether the new evidence-record shall be added to the last available evidence-record attribute, when present.protected final DSSDocument
Signature document to compute hash value for -
Constructor Summary
ModifierConstructorDescriptionprotected
AbstractSignatureEvidenceRecordDigestBuilder
(DSSDocument signatureDocument) Default constructor to instantiate builder with a SHA-256 digest algorithmprotected
AbstractSignatureEvidenceRecordDigestBuilder
(DSSDocument signatureDocument, DigestAlgorithm digestAlgorithm) Constructor to instantiate builder with a custom digest algorithm -
Method Summary
Modifier and TypeMethodDescriptionprotected Digest
getDigest
(DSSDocument document) Returns digest of the given documentsetParallelEvidenceRecord
(boolean parallelEvidenceRecord) Sets whether the message-imprint for an evidence record shall be computed as for a parallel evidence-record (i.e. to be incorporated within the latest evidence-record attribute, when available).Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface eu.europa.esig.dss.spi.validation.evidencerecord.SignatureEvidenceRecordDigestBuilder
build
-
Field Details
-
signatureDocument
Signature document to compute hash value for -
digestAlgorithm
The digest algorithm to be used on hash computation. Default : DigestAlgorithm.SHA256 -
parallelEvidenceRecord
protected boolean parallelEvidenceRecordDefines whether the new evidence-record shall be added to the last available evidence-record attribute, when present. Otherwise, the hash will be computed based on the whole document content (default behavior).
-
-
Constructor Details
-
AbstractSignatureEvidenceRecordDigestBuilder
Default constructor to instantiate builder with a SHA-256 digest algorithm- Parameters:
signatureDocument
-DSSDocument
to compute message-imprint for
-
AbstractSignatureEvidenceRecordDigestBuilder
protected AbstractSignatureEvidenceRecordDigestBuilder(DSSDocument signatureDocument, DigestAlgorithm digestAlgorithm) Constructor to instantiate builder with a custom digest algorithm- Parameters:
signatureDocument
-DSSDocument
to compute message-imprint fordigestAlgorithm
-DigestAlgorithm
to be used
-
-
Method Details
-
setParallelEvidenceRecord
public AbstractSignatureEvidenceRecordDigestBuilder setParallelEvidenceRecord(boolean parallelEvidenceRecord) Sets whether the message-imprint for an evidence record shall be computed as for a parallel evidence-record (i.e. to be incorporated within the latest evidence-record attribute, when available). Otherwise, will compute message-imprint based on the whole signature's content, including coverage of other existing evidence-record. Default : FALSE (computes digest based on the whole signature's content)- Parameters:
parallelEvidenceRecord
- whether the message-imprint for an evidence record shall be computed as for a parallel evidence-record- Returns:
- this builder
-
getDigest
Returns digest of the given document- Parameters:
document
-DSSDocument
to compute digest for- Returns:
Digest
-