Class XAdESEvidenceRecordDigestBuilder
java.lang.Object
eu.europa.esig.dss.spi.validation.evidencerecord.AbstractSignatureEvidenceRecordDigestBuilder
eu.europa.esig.dss.xades.evidencerecord.XAdESEvidenceRecordDigestBuilder
- All Implemented Interfaces:
SignatureEvidenceRecordDigestBuilder
Computes message-imprint of an XML signature to be protected by an evidence-record
-
Field Summary
Fields inherited from class eu.europa.esig.dss.spi.validation.evidencerecord.AbstractSignatureEvidenceRecordDigestBuilder
digestAlgorithm, parallelEvidenceRecord, signatureDocument
-
Constructor Summary
ConstructorDescriptionXAdESEvidenceRecordDigestBuilder
(DSSDocument signatureDocument) Default constructor to instantiate XAdESEvidenceRecordDigestBuilder with a SHA-256 digest algorithmXAdESEvidenceRecordDigestBuilder
(DSSDocument signatureDocument, DigestAlgorithm digestAlgorithm) Constructor to instantiate XAdESEvidenceRecordDigestBuilder with a custom digest algorithm -
Method Summary
Modifier and TypeMethodDescriptionbuild()
Generates hash value for the signature enveloping the evidence-record.protected String
getCanonicalizationAlgorithm
(XAdESSignature signature) Returns corresponding ds:CanonicalizationMethod used within the signatureprotected DSSMessageDigest
getXmlSignatureMessageImprint
(XAdESSignature signature) Generates message-imprint for the givenXAdESSignature
setDetachedContent
(List<DSSDocument> detachedContent) Sets a list of detached documents covered by the signaturesetParallelEvidenceRecord
(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).setSignatureId
(String signatureId) Sets identifier of the signature to be covered by an evidence-record.Methods inherited from class eu.europa.esig.dss.spi.validation.evidencerecord.AbstractSignatureEvidenceRecordDigestBuilder
getDigest
-
Constructor Details
-
XAdESEvidenceRecordDigestBuilder
Default constructor to instantiate XAdESEvidenceRecordDigestBuilder with a SHA-256 digest algorithm- Parameters:
signatureDocument
-DSSDocument
to compute message-imprint for
-
XAdESEvidenceRecordDigestBuilder
public XAdESEvidenceRecordDigestBuilder(DSSDocument signatureDocument, DigestAlgorithm digestAlgorithm) Constructor to instantiate XAdESEvidenceRecordDigestBuilder with a custom digest algorithm- Parameters:
signatureDocument
-DSSDocument
to compute message-imprint fordigestAlgorithm
-DigestAlgorithm
to be used
-
-
Method Details
-
setDetachedContent
Sets a list of detached documents covered by the signature- Parameters:
detachedContent
- a list of detachedDSSDocument
s- Returns:
- this builder
-
setSignatureId
Sets identifier of the signature to be covered by an evidence-record. Accepts a DSS identifier, or an internal signature element's identifier Note: required for documents containing multiple signatures- Parameters:
signatureId
-String
- 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
-
getXmlSignatureMessageImprint
Generates message-imprint for the givenXAdESSignature
- Parameters:
signature
-XAdESSignature
to be covered by an evidence-record- Returns:
Digest
of the signature
-
getCanonicalizationAlgorithm
Returns corresponding ds:CanonicalizationMethod used within the signature- Parameters:
signature
-XAdESSignature
- Returns:
String
canonicalization method identifier
-