Class SignedDocumentDiagnosticDataBuilder
java.lang.Object
eu.europa.esig.dss.validation.reports.diagnostic.DiagnosticDataBuilder
eu.europa.esig.dss.validation.reports.diagnostic.SignedDocumentDiagnosticDataBuilder
- Direct Known Subclasses:
ASiCContainerDiagnosticDataBuilder, CAdESDiagnosticDataBuilder, JAdESDiagnosticDataBuilder, QWACCertificateDiagnosticDataBuilder
The common class for DiagnosticData creation from a signed/timestamped document
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected ListCertificateSourceThe list of all certificate sources extracted from a validating document (signature(s), timestamp(s))protected ListRevocationSource<CRL> The list of all CRL revocation sources extracted from a validating document (signature(s), timestamp(s))protected ListRevocationSource<OCSP> The list of all OCSP revocation sources extracted from a validating document (signature(s), timestamp(s))protected Collection<EvidenceRecord> The collection of evidence recordsprotected Collection<AdvancedSignature> The collection of signaturesprotected DSSDocumentThe signed documentprotected Collection<TimestampToken> The collection of timestamp tokensprotected Map<String, XmlEvidenceRecord> The cached map of evidence recordsprotected Map<String, XmlSignature> The cached map of signaturesprotected Map<String, XmlSignerData> The cached map of original signed dataprotected Map<String, XmlTimestamp> The cached map of timestampsFields inherited from class DiagnosticDataBuilder
allCertificateSources, certificateIdsMap, defaultDigestAlgorithm, identifierProvider, referenceMap, signingCertificateMap, tlInfoMap, tokenExtractionStrategy, usedCertificates, usedRevocations, validationDate, xmlCertsMap, xmlOrphanCertificateTokensMap, xmlOrphanRevocationTokensMap, xmlRevocationsMap, xmlTrustedListsMap -
Constructor Summary
ConstructorsConstructorDescriptionDefault constructor instantiating object with null values and empty maps -
Method Summary
Modifier and TypeMethodDescriptionallCertificateSources(ListCertificateSource trustedCertSources) This method allows to setListCertificateSourcecontaining all certificate sources used in the validator (including trusted certificate sources)protected voidThis method verifies whether the configuration is valid in order to build a Diagnostic Databuild()BuildsXmlDiagnosticDatabuildDetachedXmlSignature(AdvancedSignature signature) BuildsXmlSignatureprotected XmlTimestampbuildDetachedXmlTimestamp(TimestampToken timestampToken) This method buildsXmlTimestampfromTimestampTokenprotected <R extends Revocation>
XmlOrphanRevocationTokencreateOrphanTokenFromRevocationIdentifier(EncapsulatedRevocationTokenIdentifier<R> revocationIdentifier) Creates an orphan revocation token fromEncapsulatedRevocationTokenIdentifierdefaultDigestAlgorithm(DigestAlgorithm digestAlgorithm) This method allows to set the defaultDigestAlgorithmwhich will be used for tokens' DigestAlgoAndValue calculationdocument(DSSDocument signedDocument) This method allows to set the document which is analyseddocumentCertificateSource(ListCertificateSource documentCertificateSource) Sets a document Certificate Source containing all sources extracted from the provided signature(s)/timestamp(s)documentCRLSource(ListRevocationSource<CRL> documentCRLSource) Sets a document CRL Source containing all sources extracted from the provided signature(s)/timestamp(s)documentOCSPSource(ListRevocationSource<OCSP> documentCRLSource) Sets a document OCSP Source containing all sources extracted from the provided signature(s)/timestamp(s)protected StringemptyToNull(String text) If text is empty returns NULL, or original text otherwisefoundEvidenceRecords(Collection<EvidenceRecord> evidenceRecords) This method allows to set the evidence recordsfoundSignatures(Collection<AdvancedSignature> signatures) This method allows to set the found signaturesprotected List<XmlSignerInfo> getXmlSignerInformationStore(Set<SignerIdentifier> signerIdentifiers) Builds a list ofXmlSignerInfofromSignerIdentifiersprotected voidlinkSigningCertificateAndChains(Set<CertificateToken> certificates) Links the certificates and their certificate chainstokenExtractionStrategy(TokenExtractionStrategy tokenExtractionStrategy) This method allows to set theTokenExtractionStrategyto follow for the token extractionusedCertificates(Set<CertificateToken> usedCertificates) This method allows to set the used certificatesusedRevocations(Set<RevocationToken<?>> usedRevocations) This method allows to set the used revocation datausedTimestamps(Collection<TimestampToken> usedTimestamps) This method allows to set the timestampsvalidationDate(Date validationDate) This method allows to set the validation dateMethods inherited from class DiagnosticDataBuilder
buildDetachedXmlCertificate, buildDetachedXmlRevocation, buildXmlOrphanCertificateToken, buildXmlOrphanTokens, getUsedCertificatesByCertificateRef, getXmlBasicSignature, getXmlCertificateRef, getXmlCRLRevocationRef, getXmlDigestAlgoAndValue, getXmlDigestAlgoAndValue, getXmlForCertificateChain, getXmlForCertificateChain, getXmlForCertificateChain, getXmlFoundCertificates, getXmlFoundCertificates, getXmlOCSPRevocationRef, getXmlOrphanCertificate, getXmlRelatedCertificateForOrphanReferences, getXmlRevocationRefs, getXmlSignerInfo, getXmlSigningCertificate, getXmlStructuralValidation, populateCertificateOriginMap, populateOrphanCertificateOriginMap, populateXmlRelatedCertificatesList, populateXmlRelatedCertificatesList, tokenIdentifierProvider, verifyAgainstCertificateToken
-
Field Details
-
signedDocument
The signed document -
signatures
The collection of signatures -
usedTimestamps
The collection of timestamp tokens -
evidenceRecords
The collection of evidence records -
documentCertificateSource
The list of all certificate sources extracted from a validating document (signature(s), timestamp(s)) -
documentCRLSource
The list of all CRL revocation sources extracted from a validating document (signature(s), timestamp(s)) -
documentOCSPSource
The list of all OCSP revocation sources extracted from a validating document (signature(s), timestamp(s)) -
xmlSignaturesMap
The cached map of signatures -
xmlTimestampsMap
The cached map of timestamps -
xmlEvidenceRecordMap
The cached map of evidence records -
xmlSignedDataMap
The cached map of original signed data
-
-
Constructor Details
-
SignedDocumentDiagnosticDataBuilder
public SignedDocumentDiagnosticDataBuilder()Default constructor instantiating object with null values and empty maps
-
-
Method Details
-
usedCertificates
Description copied from class:DiagnosticDataBuilderThis method allows to set the used certificates- Overrides:
usedCertificatesin classDiagnosticDataBuilder- Parameters:
usedCertificates- the used certificates- Returns:
- the builder
-
usedRevocations
Description copied from class:DiagnosticDataBuilderThis method allows to set the used revocation data- Overrides:
usedRevocationsin classDiagnosticDataBuilder- Parameters:
usedRevocations- the used revocation data- Returns:
- the builder
-
allCertificateSources
public SignedDocumentDiagnosticDataBuilder allCertificateSources(ListCertificateSource trustedCertSources) Description copied from class:DiagnosticDataBuilderThis method allows to setListCertificateSourcecontaining all certificate sources used in the validator (including trusted certificate sources)- Overrides:
allCertificateSourcesin classDiagnosticDataBuilder- Parameters:
trustedCertSources- the list of trusted lists certificate sources- Returns:
- the builder
-
validationDate
Description copied from class:DiagnosticDataBuilderThis method allows to set the validation date- Overrides:
validationDatein classDiagnosticDataBuilder- Parameters:
validationDate- the validation date- Returns:
- the builder
-
tokenExtractionStrategy
public SignedDocumentDiagnosticDataBuilder tokenExtractionStrategy(TokenExtractionStrategy tokenExtractionStrategy) Description copied from class:DiagnosticDataBuilderThis method allows to set theTokenExtractionStrategyto follow for the token extraction- Overrides:
tokenExtractionStrategyin classDiagnosticDataBuilder- Parameters:
tokenExtractionStrategy-TokenExtractionStrategyto use- Returns:
- the builder
-
defaultDigestAlgorithm
Description copied from class:DiagnosticDataBuilderThis method allows to set the defaultDigestAlgorithmwhich will be used for tokens' DigestAlgoAndValue calculation- Overrides:
defaultDigestAlgorithmin classDiagnosticDataBuilder- Parameters:
digestAlgorithm-DigestAlgorithmto set as default- Returns:
- the builder
-
document
This method allows to set the document which is analysed- Parameters:
signedDocument- the document which is analysed- Returns:
- the builder
-
foundSignatures
public SignedDocumentDiagnosticDataBuilder foundSignatures(Collection<AdvancedSignature> signatures) This method allows to set the found signatures- Parameters:
signatures- the found signatures- Returns:
- the builder
-
usedTimestamps
public SignedDocumentDiagnosticDataBuilder usedTimestamps(Collection<TimestampToken> usedTimestamps) This method allows to set the timestamps- Parameters:
usedTimestamps- a set of validatedTimestampTokens- Returns:
- the builder
-
foundEvidenceRecords
public SignedDocumentDiagnosticDataBuilder foundEvidenceRecords(Collection<EvidenceRecord> evidenceRecords) This method allows to set the evidence records- Parameters:
evidenceRecords- a set of foundEvidenceRecords- Returns:
- the builder
-
documentCertificateSource
public SignedDocumentDiagnosticDataBuilder documentCertificateSource(ListCertificateSource documentCertificateSource) Sets a document Certificate Source containing all sources extracted from the provided signature(s)/timestamp(s)- Parameters:
documentCertificateSource-ListCertificateSourcecomputed from document sources- Returns:
- the builder
-
documentCRLSource
public SignedDocumentDiagnosticDataBuilder documentCRLSource(ListRevocationSource<CRL> documentCRLSource) Sets a document CRL Source containing all sources extracted from the provided signature(s)/timestamp(s)- Parameters:
documentCRLSource-ListRevocationSourcecomputed from document sources- Returns:
- the builder
-
documentOCSPSource
public SignedDocumentDiagnosticDataBuilder documentOCSPSource(ListRevocationSource<OCSP> documentCRLSource) Sets a document OCSP Source containing all sources extracted from the provided signature(s)/timestamp(s)- Parameters:
documentCRLSource-ListRevocationSourcecomputed from document sources- Returns:
- the builder
-
build
BuildsXmlDiagnosticData- Overrides:
buildin classDiagnosticDataBuilder- Returns:
XmlDiagnosticData
-
assertConfigurationValid
protected void assertConfigurationValid()This method verifies whether the configuration is valid in order to build a Diagnostic Data -
linkSigningCertificateAndChains
Description copied from class:DiagnosticDataBuilderLinks the certificates and their certificate chains- Overrides:
linkSigningCertificateAndChainsin classDiagnosticDataBuilder- Parameters:
certificates- a set ofCertificateTokens
-
buildDetachedXmlSignature
BuildsXmlSignature- Parameters:
signature-AdvancedSignature- Returns:
XmlSignature
-
emptyToNull
-
createOrphanTokenFromRevocationIdentifier
protected <R extends Revocation> XmlOrphanRevocationToken createOrphanTokenFromRevocationIdentifier(EncapsulatedRevocationTokenIdentifier<R> revocationIdentifier) Creates an orphan revocation token fromEncapsulatedRevocationTokenIdentifier- Type Parameters:
R-Revocation- Parameters:
revocationIdentifier-EncapsulatedRevocationTokenIdentifier- Returns:
XmlOrphanRevocationToken
-
buildDetachedXmlTimestamp
This method buildsXmlTimestampfromTimestampToken- Parameters:
timestampToken-TimestampToken- Returns:
XmlTimestamp
-
getXmlSignerInformationStore
Builds a list ofXmlSignerInfofromSignerIdentifiers- Parameters:
signerIdentifiers- a set ofSignerIdentifier- Returns:
- a list of
XmlSignerInfos
-