Class AbstractEvidenceRecordRenewalDigestBuilder
java.lang.Object
eu.europa.esig.dss.evidencerecord.common.digest.AbstractEvidenceRecordRenewalDigestBuilder
- All Implemented Interfaces:
EvidenceRecordRenewalDigestBuilder
- Direct Known Subclasses:
ASN1EvidenceRecordRenewalDigestBuilder
,XMLEvidenceRecordRenewalDigestBuilder
public abstract class AbstractEvidenceRecordRenewalDigestBuilder
extends Object
implements EvidenceRecordRenewalDigestBuilder
Abstract implementation of
EvidenceRecordRenewalDigestBuilder
.
Contains common methods for digest computation for evidence record's renewal.-
Field Summary
Modifier and TypeFieldDescriptionprotected List
<DSSDocument> List of documents to compute hashes forprotected final DigestAlgorithm
The digest algorithm to be used on hash computation for time-stamp chain renewal.protected final DefaultEvidenceRecord
Evidence record to compute digest for -
Constructor Summary
ModifierConstructorDescriptionprotected
AbstractEvidenceRecordRenewalDigestBuilder
(DefaultEvidenceRecord evidenceRecord) Creates an instance ofEvidenceRecordRenewalDigestBuilder
allowing to build hash for an evidence record's renewal, with a default SHA256 digest algorithm to be used on hash-tree renewal computation (see note).protected
AbstractEvidenceRecordRenewalDigestBuilder
(DefaultEvidenceRecord evidenceRecord, DigestAlgorithm digestAlgorithm) Creates an instance ofEvidenceRecordRenewalDigestBuilder
allowing to build hash for an evidence record's renewal, with the provideddigestAlgorithm
(see note below). -
Method Summary
Modifier and TypeMethodDescriptionabstract DSSMessageDigest
This method builds digest for a time-stamp renewalprotected DigestAlgorithm
getDigestAlgorithm
(ArchiveTimeStampChainObject archiveTimeStampChain) Extracts a digest algorithm defined within XMLArchiveTimeStampChainObject
protected ArchiveTimeStampChainObject
Gets anArchiveTimeStampChainObject
to build hash for.protected ArchiveTimeStampObject
Gets anArchiveTimeStampObject
to build hash for.setDetachedContent
(List<DSSDocument> detachedContent) Sets detached content to be used for a digest group hash computation on hash-tree renewal NOTE : at least one of the documents from the original data group should be provided for a correct hash-tree renewalMethods 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.evidencerecord.common.digest.EvidenceRecordRenewalDigestBuilder
buildHashTreeRenewalDigestGroup
-
Field Details
-
evidenceRecord
Evidence record to compute digest for -
digestAlgorithm
The digest algorithm to be used on hash computation for time-stamp chain renewal. Default : DigestAlgorithm.SHA256 -
detachedContent
List of documents to compute hashes for
-
-
Constructor Details
-
AbstractEvidenceRecordRenewalDigestBuilder
Creates an instance ofEvidenceRecordRenewalDigestBuilder
allowing to build hash for an evidence record's renewal, with a default SHA256 digest algorithm to be used on hash-tree renewal computation (see note). Builds digest for the last available ArchiveTimeStamp or ArchiveTimeStampChain, based on the called method. NOTE: time-stamp renewal uses digest algorithm extracted from the last ArchiveTimeStampChain.- Parameters:
evidenceRecord
-DefaultEvidenceRecord
-
AbstractEvidenceRecordRenewalDigestBuilder
protected AbstractEvidenceRecordRenewalDigestBuilder(DefaultEvidenceRecord evidenceRecord, DigestAlgorithm digestAlgorithm) Creates an instance ofEvidenceRecordRenewalDigestBuilder
allowing to build hash for an evidence record's renewal, with the provideddigestAlgorithm
(see note below). Builds digest for the last available ArchiveTimeStamp or ArchiveTimeStampChain, based on the called method. NOTE: time-stamp renewal uses digest algorithm extracted from the last ArchiveTimeStampChain.- Parameters:
evidenceRecord
-DefaultEvidenceRecord
digestAlgorithm
-DigestAlgorithm
to be used on hash-tree renewal hash computation
-
-
Method Details
-
setDetachedContent
public AbstractEvidenceRecordRenewalDigestBuilder setDetachedContent(List<DSSDocument> detachedContent) Sets detached content to be used for a digest group hash computation on hash-tree renewal NOTE : at least one of the documents from the original data group should be provided for a correct hash-tree renewal- Parameters:
detachedContent
- a list ofDSSDocument
detached documents- Returns:
- this builder
-
getLastArchiveTimeStampObject
Gets anArchiveTimeStampObject
to build hash for. Returns the setarchiveTimeStampObject
when valid, otherwise returns the lastArchiveTimeStampObject
- Returns:
ArchiveTimeStampObject
-
getLastArchiveTimeStampChainObject
Gets anArchiveTimeStampChainObject
to build hash for. Returns the setarchiveTimeStampChainObject
when valid, otherwise returns the lastArchiveTimeStampChainObject
- Returns:
ArchiveTimeStampChainObject
-
getDigestAlgorithm
Extracts a digest algorithm defined within XMLArchiveTimeStampChainObject
- Parameters:
archiveTimeStampChain
-ArchiveTimeStampChainObject
to get digest algorithm from- Returns:
DigestAlgorithm
-
buildTimeStampRenewalDigest
Description copied from interface:EvidenceRecordRenewalDigestBuilder
This method builds digest for a time-stamp renewal- Specified by:
buildTimeStampRenewalDigest
in interfaceEvidenceRecordRenewalDigestBuilder
- Returns:
Digest
-