Class AbstractEmbeddedEvidenceRecordHelper
java.lang.Object
eu.europa.esig.dss.spi.validation.evidencerecord.AbstractEmbeddedEvidenceRecordHelper
- All Implemented Interfaces:
EmbeddedEvidenceRecordHelper
- Direct Known Subclasses:
CAdESEmbeddedEvidenceRecordHelper,XAdESEmbeddedEvidenceRecordHelper
public abstract class AbstractEmbeddedEvidenceRecordHelper
extends Object
implements EmbeddedEvidenceRecordHelper
Abstract implementation of
InternalEvidenceRecordHelper containing common implementation methods-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected final SignatureAttributeUnsigned signature attribute embedding the evidence recordprotected final AdvancedSignatureMaster signature -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedConstructor for an evidence record applied for the whole signature content (not yet embedded)protectedAbstractEmbeddedEvidenceRecordHelper(AdvancedSignature signature, SignatureAttribute evidenceRecordAttribute) Default constructor -
Method Summary
Modifier and TypeMethodDescriptionGets a list of detached documentsprotected abstract SignatureEvidenceRecordDigestBuildergetDigestBuilder(AdvancedSignature signature, SignatureAttribute evidenceRecordAttribute, DigestAlgorithm digestAlgorithm) Gets implementation of the signature digest builder for the given evidence recordGets the unsigned attribute property embedding the evidence record.Gets a master signature, enveloping the current evidence recordgetMasterSignatureDigest(DigestAlgorithm digestAlgorithm) Builds digest for the embedded evidence record for the givenDigestAlgorithm.getMasterSignatureDigest(DigestAlgorithm digestAlgorithm, boolean derEncoded) Builds digest for the embedded evidence record for the givenDigestAlgorithmusing a specified encoding.Gets position of the evidence record carrying attribute within the signature NOTE: can be null in case of a not yet embedded evidence record.Gets position of the evidence record within its carrying attribute NOTE: can be null in case of a not yet embedded evidence record.protected abstract voidsetDEREncoding(SignatureEvidenceRecordDigestBuilder digestBuilder, boolean derEncoded) Sets theencodingto be used on the hash computation to theSignatureEvidenceRecordDigestBuilderwhether applicablevoidsetDetachedContents(List<DSSDocument> detachedContents) Sets a list of documents used for validation of a detached signaturevoidsetOrderOfAttribute(Integer orderOfAttribute) Sets position of the evidence record carrying attribute within the signaturevoidsetOrderWithinAttribute(Integer orderWithinAttribute) Sets position of the evidence record within its carrying attributeMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface eu.europa.esig.dss.spi.validation.evidencerecord.EmbeddedEvidenceRecordHelper
isAbsentHashtreeSupported, isEncodingSelectionSupported
-
Field Details
-
signature
Master signature -
evidenceRecordAttribute
Unsigned signature attribute embedding the evidence record
-
-
Constructor Details
-
AbstractEmbeddedEvidenceRecordHelper
Constructor for an evidence record applied for the whole signature content (not yet embedded)- Parameters:
signature-AdvancedSignature
-
AbstractEmbeddedEvidenceRecordHelper
protected AbstractEmbeddedEvidenceRecordHelper(AdvancedSignature signature, SignatureAttribute evidenceRecordAttribute) Default constructor- Parameters:
signature-AdvancedSignatureevidenceRecordAttribute-SignatureAttribute
-
-
Method Details
-
getMasterSignature
Description copied from interface:EmbeddedEvidenceRecordHelperGets a master signature, enveloping the current evidence record- Specified by:
getMasterSignaturein interfaceEmbeddedEvidenceRecordHelper- Returns:
AdvancedSignature
-
getEvidenceRecordAttribute
Description copied from interface:EmbeddedEvidenceRecordHelperGets the unsigned attribute property embedding the evidence record. NOTE: can be null in case of a not yet embedded evidence record.- Specified by:
getEvidenceRecordAttributein interfaceEmbeddedEvidenceRecordHelper- Returns:
SignatureAttribute
-
getOrderOfAttribute
Description copied from interface:EmbeddedEvidenceRecordHelperGets position of the evidence record carrying attribute within the signature NOTE: can be null in case of a not yet embedded evidence record.- Specified by:
getOrderOfAttributein interfaceEmbeddedEvidenceRecordHelper- Returns:
Integer
-
setOrderOfAttribute
Sets position of the evidence record carrying attribute within the signature- Parameters:
orderOfAttribute- position of the attribute
-
getOrderWithinAttribute
Description copied from interface:EmbeddedEvidenceRecordHelperGets position of the evidence record within its carrying attribute NOTE: can be null in case of a not yet embedded evidence record.- Specified by:
getOrderWithinAttributein interfaceEmbeddedEvidenceRecordHelper- Returns:
Integer
-
setOrderWithinAttribute
Sets position of the evidence record within its carrying attribute- Parameters:
orderWithinAttribute- position of the evidence record within the attribute
-
getDetachedContents
Description copied from interface:EmbeddedEvidenceRecordHelperGets a list of detached documents- Specified by:
getDetachedContentsin interfaceEmbeddedEvidenceRecordHelper- Returns:
- a list of
DSSDocuments
-
setDetachedContents
Sets a list of documents used for validation of a detached signature- Parameters:
detachedContents- list ofDSSDocuments
-
getMasterSignatureDigest
Description copied from interface:EmbeddedEvidenceRecordHelperBuilds digest for the embedded evidence record for the givenDigestAlgorithm. This method uses an existing coding of a signature for hash generation.- Specified by:
getMasterSignatureDigestin interfaceEmbeddedEvidenceRecordHelper- Parameters:
digestAlgorithm-DigestAlgorithm- Returns:
Digest
-
getMasterSignatureDigest
Description copied from interface:EmbeddedEvidenceRecordHelperBuilds digest for the embedded evidence record for the givenDigestAlgorithmusing a specified encoding. The method can be called only for a CAdES signature implementation. NOTE: please use the method#isEncodingSelectionSupportedto check whether the encoding choice is supported by the current implementation. Use#getMasterSignatureDigest(digestAlgorithm)method otherwise.- Specified by:
getMasterSignatureDigestin interfaceEmbeddedEvidenceRecordHelper- Parameters:
digestAlgorithm-DigestAlgorithmderEncoded- whether the signature shall be DER-encoded- Returns:
Digest
-
getDigestBuilder
protected abstract SignatureEvidenceRecordDigestBuilder getDigestBuilder(AdvancedSignature signature, SignatureAttribute evidenceRecordAttribute, DigestAlgorithm digestAlgorithm) Gets implementation of the signature digest builder for the given evidence record- Parameters:
signature-AdvancedSignatureevidenceRecordAttribute-SignatureAttributedigestAlgorithm-DigestAlgorithm- Returns:
SignatureEvidenceRecordDigestBuilder
-
setDEREncoding
protected abstract void setDEREncoding(SignatureEvidenceRecordDigestBuilder digestBuilder, boolean derEncoded) Sets theencodingto be used on the hash computation to theSignatureEvidenceRecordDigestBuilderwhether applicable- Parameters:
digestBuilder-SignatureEvidenceRecordDigestBuilderderEncoded- whether signature shall be DER encoded
-