Class DefaultEvidenceRecord
java.lang.Object
eu.europa.esig.dss.evidencerecord.common.validation.DefaultEvidenceRecord
- All Implemented Interfaces:
IdentifierBasedObject,EvidenceRecord
- Direct Known Subclasses:
ASN1EvidenceRecord,XmlEvidenceRecord
Default representation of an Evidence Record
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected List<ReferenceValidation> Cached result of archive data objects validationA list of error messages occurred during a structure validation -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidaddExternalEvidenceRecord(EvidenceRecord evidenceRecord) This method allows to add an external evidence record covering the current evidence record.protected List<? extends ArchiveTimeStampChainObject> Build an archive time-stamp sequenceprotected abstract EvidenceRecordTimeStampSequenceVerifierBuilds an instance ofEvidenceRecordTimeStampSequenceVerifierto perform a cryptographic validation of an evidence recordprotected abstract EvidenceRecordParserBuilds anEvidenceRecordParserparsing the Evidence Record to a list of DSS DTOsprotected abstract EvidenceRecordTimestampSource<?> Builds a new instance of anEvidenceRecordTimestampSourceList<? extends ArchiveTimeStampChainObject> Gets an archive time-stamp sequenceGets a certificate source which contains ALL certificates embedded in the evidence record.Gets a CRL source which contains ALL CRLs embedded in the evidence record.Returns detached contentsReturns a list of detached evidence records covering the current evidence record.getDSSId()Returns theIdentifierof the objectReturns anEmbeddedEvidenceRecordHelperin case of an embedded evidence recordReturns a list of covered archival data objectsReturns a name of the evidence record document, when presentgetId()This method returns the DSS unique signature id.Gets the type of the unsigned attribute used for incorporation of an evidence record within a signature NOTE: applicable only for embedded evidence records within CAdESReturns a manifest file associated with the evidence record (used in ASiC)Gets a master signature, enveloping the current evidence recordGets an OCSP source which contains ALL OCSP responses embedded in the evidence record.Returns origin of the evidence recordGets a DigestAlgorithm used on the first data object group's digest computationReturns a list of archive data object validationsReturns a message if the structure validation failsReturns a list of references covered by the evidence recordReturns a list of incorporated timestamp tokensGets a Timestamp source which contains ALL timestamps embedded in the evidence record.booleanReturns whether the evidence record is embedded in a signaturevoidsetDetachedContents(List<DSSDocument> detachedContents) Sets a list of detached documents covered by the reduced HashTree of the Evidence RecordvoidsetEmbeddedEvidenceRecordHelper(EmbeddedEvidenceRecordHelper embeddedEvidenceRecordHelper) Sets a helper for processing and validation of the embedded evidence record typevoidsetEvidenceRecordScopes(List<SignatureScope> evidenceRecordScopes) Sets a list of covered archival data objectsvoidsetFilename(String filename) Sets the evidence record filenamevoidsetIncorporationType(EvidenceRecordIncorporationType incorporationType) Sets the incorporation type for embedded evidence recordsvoidsetManifestFile(ManifestFile manifestFile) Sets a manifest file associated with the evidence recordvoidsetOrigin(EvidenceRecordOrigin origin) Sets the origin of the evidence recordvoidsetTimestampedReferences(List<TimestampedReference> timestampedReferences) Sets references to objects covered by the evidence recordprotected List<ReferenceValidation> validate()Performs validation of the evidence recordThis method is used to verify the structure of the evidence record documentMethods 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.x509.evidencerecord.EvidenceRecord
getEncoded, getEvidenceRecordType
-
Field Details
-
referenceValidations
Cached result of archive data objects validation -
structureValidationMessages
A list of error messages occurred during a structure validation
-
-
Constructor Details
-
DefaultEvidenceRecord
protected DefaultEvidenceRecord()Default constructor
-
-
Method Details
-
getFilename
Description copied from interface:EvidenceRecordReturns a name of the evidence record document, when present- Specified by:
getFilenamein interfaceEvidenceRecord- Returns:
String
-
setFilename
Sets the evidence record filename- Parameters:
filename-String
-
getOrigin
Description copied from interface:EvidenceRecordReturns origin of the evidence record- Specified by:
getOriginin interfaceEvidenceRecord- Returns:
EvidenceRecordOrigin
-
setOrigin
Sets the origin of the evidence record- Parameters:
origin-EvidenceRecordOrigin
-
getIncorporationType
Description copied from interface:EvidenceRecordGets the type of the unsigned attribute used for incorporation of an evidence record within a signature NOTE: applicable only for embedded evidence records within CAdES- Specified by:
getIncorporationTypein interfaceEvidenceRecord- Returns:
EvidenceRecordIncorporationType
-
setIncorporationType
Sets the incorporation type for embedded evidence records- Parameters:
incorporationType-EvidenceRecordIncorporationType
-
getDetachedContents
Description copied from interface:EvidenceRecordReturns detached contents- Specified by:
getDetachedContentsin interfaceEvidenceRecord- Returns:
- in the case of the detached signature this is the
Listof signed contents.
-
setDetachedContents
Sets a list of detached documents covered by the reduced HashTree of the Evidence Record- Parameters:
detachedContents- a list ofDSSDocuments
-
getManifestFile
Description copied from interface:EvidenceRecordReturns a manifest file associated with the evidence record (used in ASiC)- Specified by:
getManifestFilein interfaceEvidenceRecord- Returns:
ManifestFile
-
setManifestFile
Sets a manifest file associated with the evidence record- Parameters:
manifestFile-ManifestFile
-
getTimestampedReferences
Description copied from interface:EvidenceRecordReturns a list of references covered by the evidence record- Specified by:
getTimestampedReferencesin interfaceEvidenceRecord- Returns:
- a list of
TimestampedReferences
-
setTimestampedReferences
Description copied from interface:EvidenceRecordSets references to objects covered by the evidence record- Specified by:
setTimestampedReferencesin interfaceEvidenceRecord- Parameters:
timestampedReferences- a list ofTimestampedReferences
-
getArchiveTimeStampSequence
Gets an archive time-stamp sequence- Returns:
- a list of
ArchiveTimeStampChainObjects
-
buildArchiveTimeStampSequence
Build an archive time-stamp sequence- Returns:
- a list of ordered
ArchiveTimeStampChainObjects
-
buildEvidenceRecordParser
Builds anEvidenceRecordParserparsing the Evidence Record to a list of DSS DTOs- Returns:
EvidenceRecordParser
-
getCertificateSource
Description copied from interface:EvidenceRecordGets a certificate source which contains ALL certificates embedded in the evidence record.- Specified by:
getCertificateSourcein interfaceEvidenceRecord- Returns:
CertificateSource
-
getCRLSource
Description copied from interface:EvidenceRecordGets a CRL source which contains ALL CRLs embedded in the evidence record.- Specified by:
getCRLSourcein interfaceEvidenceRecord- Returns:
OfflineRevocationSource
-
getOCSPSource
Description copied from interface:EvidenceRecordGets an OCSP source which contains ALL OCSP responses embedded in the evidence record.- Specified by:
getOCSPSourcein interfaceEvidenceRecord- Returns:
OfflineRevocationSource
-
getReferenceValidation
Description copied from interface:EvidenceRecordReturns a list of archive data object validations- Specified by:
getReferenceValidationin interfaceEvidenceRecord- Returns:
- a list of
ReferenceValidationobjects corresponding to each archive data object validation
-
validate
Performs validation of the evidence record- Returns:
- a list of
ReferenceValidations
-
buildCryptographicEvidenceRecordVerifier
protected abstract EvidenceRecordTimeStampSequenceVerifier buildCryptographicEvidenceRecordVerifier()Builds an instance ofEvidenceRecordTimeStampSequenceVerifierto perform a cryptographic validation of an evidence record -
getTimestamps
Description copied from interface:EvidenceRecordReturns a list of incorporated timestamp tokens- Specified by:
getTimestampsin interfaceEvidenceRecord- Returns:
- a list of
TimestampTokens
-
getTimestampSource
Gets a Timestamp source which contains ALL timestamps embedded in the evidence record.- Returns:
EvidenceRecordTimestampSource
-
buildTimestampSource
Builds a new instance of anEvidenceRecordTimestampSource- Returns:
EvidenceRecordTimestampSource
-
getDetachedEvidenceRecords
Description copied from interface:EvidenceRecordReturns a list of detached evidence records covering the current evidence record.- Specified by:
getDetachedEvidenceRecordsin interfaceEvidenceRecord- Returns:
- a list of
EvidenceRecords
-
addExternalEvidenceRecord
Description copied from interface:EvidenceRecordThis method allows to add an external evidence record covering the current evidence record.- Specified by:
addExternalEvidenceRecordin interfaceEvidenceRecord- Parameters:
evidenceRecord-EvidenceRecord
-
getEvidenceRecordScopes
Description copied from interface:EvidenceRecordReturns a list of covered archival data objects- Specified by:
getEvidenceRecordScopesin interfaceEvidenceRecord- Returns:
- a list of
SignatureScopes
-
setEvidenceRecordScopes
Description copied from interface:EvidenceRecordSets a list of covered archival data objects- Specified by:
setEvidenceRecordScopesin interfaceEvidenceRecord- Parameters:
evidenceRecordScopes- a list ofSignatureScopes
-
getOriginalDigestAlgorithm
Description copied from interface:EvidenceRecordGets a DigestAlgorithm used on the first data object group's digest computation- Specified by:
getOriginalDigestAlgorithmin interfaceEvidenceRecord- Returns:
DigestAlgorithm
-
setEmbeddedEvidenceRecordHelper
public void setEmbeddedEvidenceRecordHelper(EmbeddedEvidenceRecordHelper embeddedEvidenceRecordHelper) Description copied from interface:EvidenceRecordSets a helper for processing and validation of the embedded evidence record type- Specified by:
setEmbeddedEvidenceRecordHelperin interfaceEvidenceRecord- Parameters:
embeddedEvidenceRecordHelper-EmbeddedEvidenceRecordHelper
-
isEmbedded
public boolean isEmbedded()Description copied from interface:EvidenceRecordReturns whether the evidence record is embedded in a signature- Specified by:
isEmbeddedin interfaceEvidenceRecord- Returns:
- TRUE if the evidence record is embedded, FALSE otherwise
-
getMasterSignature
Description copied from interface:EvidenceRecordGets a master signature, enveloping the current evidence record- Specified by:
getMasterSignaturein interfaceEvidenceRecord- Returns:
AdvancedSignature
-
getEmbeddedEvidenceRecordHelper
Description copied from interface:EvidenceRecordReturns anEmbeddedEvidenceRecordHelperin case of an embedded evidence record- Specified by:
getEmbeddedEvidenceRecordHelperin interfaceEvidenceRecord- Returns:
EmbeddedEvidenceRecordHelper
-
getStructureValidationResult
Description copied from interface:EvidenceRecordReturns a message if the structure validation fails- Specified by:
getStructureValidationResultin interfaceEvidenceRecord- Returns:
- a list of
Stringerror messages if validation fails, an empty list if structural validation succeeds
-
validateStructure
This method is used to verify the structure of the evidence record document- Returns:
- a list of
Stringerrors when applicable
-
getDSSId
Description copied from interface:IdentifierBasedObjectReturns theIdentifierof the object- Specified by:
getDSSIdin interfaceIdentifierBasedObject- Returns:
Identifier
-
getId
Description copied from interface:EvidenceRecordThis method returns the DSS unique signature id. It allows to unambiguously identify each signature.- Specified by:
getIdin interfaceEvidenceRecord- Returns:
- The signature unique Id
-