Class CAdESEvidenceRecordDigestBuilder
java.lang.Object
eu.europa.esig.dss.spi.validation.evidencerecord.AbstractSignatureEvidenceRecordDigestBuilder
eu.europa.esig.dss.cades.validation.evidencerecord.CAdESEvidenceRecordDigestBuilder
- All Implemented Interfaces:
SignatureEvidenceRecordDigestBuilder
Computes message-imprint of a CMS signature to be protected by an evidence-record
-
Field Summary
Modifier and TypeFieldDescriptionprotected DSSDocument
Original document in case of a detached signatureFields inherited from class eu.europa.esig.dss.spi.validation.evidencerecord.AbstractSignatureEvidenceRecordDigestBuilder
digestAlgorithm, parallelEvidenceRecord, signatureDocument
-
Constructor Summary
ConstructorDescriptionCAdESEvidenceRecordDigestBuilder
(DSSDocument signatureDocument) Default constructor to instantiate CAdESEvidenceRecordDigestBuilder with a SHA-256 digest algorithmCAdESEvidenceRecordDigestBuilder
(DSSDocument signatureDocument, DigestAlgorithm digestAlgorithm) Constructor to instantiate CAdESEvidenceRecordDigestBuilder with a custom digest algorithm -
Method Summary
Modifier and TypeMethodDescriptionbuild()
Generates hash value for the signature enveloping the evidence-record.This method build a group of digests to be covered in case of an external-evidence-record incorporation.protected org.bouncycastle.cms.CMSSignedData
getCMSSignedDataBeforeLastEvidenceRecord
(org.bouncycastle.cms.CMSSignedData cmsSignedData) Creates a CMSSignedData that have been protected by the latest evidence-recordprotected byte[]
getCMSSignedDataMessageImprint
(org.bouncycastle.cms.CMSSignedData cmsSignedData) Returns a CMSSignedData's message-imprint to be protected by an evidence recordprotected Digest
getDigest
(org.bouncycastle.cms.CMSSignedData cmsSignedData) Gets digest ofcmsSignedData
to be protected by an evidence recordsetDetachedContent
(DSSDocument detachedDocument) Sets an original document in case of a detached signature.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).Methods inherited from class eu.europa.esig.dss.spi.validation.evidencerecord.AbstractSignatureEvidenceRecordDigestBuilder
getDigest
-
Field Details
-
detachedDocument
Original document in case of a detached signature
-
-
Constructor Details
-
CAdESEvidenceRecordDigestBuilder
Default constructor to instantiate CAdESEvidenceRecordDigestBuilder with a SHA-256 digest algorithm- Parameters:
signatureDocument
-DSSDocument
to compute message-imprint for
-
CAdESEvidenceRecordDigestBuilder
public CAdESEvidenceRecordDigestBuilder(DSSDocument signatureDocument, DigestAlgorithm digestAlgorithm) Constructor to instantiate CAdESEvidenceRecordDigestBuilder with a custom digest algorithm- Parameters:
signatureDocument
-DSSDocument
to compute message-imprint fordigestAlgorithm
-DigestAlgorithm
to be used
-
-
Method Details
-
setDetachedContent
Sets an original document in case of a detached signature. When set, please use#buildExternalEvidenceRecordDigest
to compute hash for both the signature and the original document- Parameters:
detachedDocument
-DSSDocument
original document covered by the signature- Returns:
- this builder
-
setParallelEvidenceRecord
Description copied from class:AbstractSignatureEvidenceRecordDigestBuilder
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)- Overrides:
setParallelEvidenceRecord
in classAbstractSignatureEvidenceRecordDigestBuilder
- Parameters:
parallelEvidenceRecord
- whether the message-imprint for an evidence record shall be computed as for a parallel evidence-record- Returns:
- this builder
-
build
Description copied from interface:SignatureEvidenceRecordDigestBuilder
Generates hash value for the signature enveloping the evidence-record. Note: the method is not supported for ASiC containers- Returns:
Digest
containing the hash value of the binaries and the used digest algorithm
-
buildExternalEvidenceRecordDigest
This method build a group of digests to be covered in case of an external-evidence-record incorporation. Note: the original detached document shall be provided within#setDetachedContent
method.- Returns:
- a list of
Digest
, containing the signature digest on the first position, and digest of a detached document on the second position
-
getDigest
-
getCMSSignedDataMessageImprint
protected byte[] getCMSSignedDataMessageImprint(org.bouncycastle.cms.CMSSignedData cmsSignedData) Returns a CMSSignedData's message-imprint to be protected by an evidence record- Parameters:
cmsSignedData
-CMSSignedData
- Returns:
- encoded message-imprint binaries
-
getCMSSignedDataBeforeLastEvidenceRecord
protected org.bouncycastle.cms.CMSSignedData getCMSSignedDataBeforeLastEvidenceRecord(org.bouncycastle.cms.CMSSignedData cmsSignedData) Creates a CMSSignedData that have been protected by the latest evidence-record- Parameters:
cmsSignedData
-CMSSignedData
protected by evidence-record(s)- Returns:
- original
CMSSignedData
-