Module jpms_dss_document
Package eu.europa.esig.dss.validation
Class SignedDocumentDiagnosticDataBuilder
java.lang.Object
eu.europa.esig.dss.validation.DiagnosticDataBuilder
eu.europa.esig.dss.validation.SignedDocumentDiagnosticDataBuilder
The common class for DiagnosticData creation from a signed/timestamped document
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected eu.europa.esig.dss.spi.x509.ListCertificateSourceThe list of all certificate sources extracted from a validating document (signature(s), timestamp(s))protected eu.europa.esig.dss.spi.x509.revocation.ListRevocationSource<eu.europa.esig.dss.model.x509.revocation.crl.CRL> The list of all CRL revocation sources extracted from a validating document (signature(s), timestamp(s))protected eu.europa.esig.dss.spi.x509.revocation.ListRevocationSource<eu.europa.esig.dss.model.x509.revocation.ocsp.OCSP> The list of all OCSP revocation sources extracted from a validating document (signature(s), timestamp(s))protected List<EvidenceRecord> The list of evidence recordsprotected SignaturePolicyProviderThe signature policy providerprotected SignaturePolicyValidatorLoaderLoads aSignaturePolicyValidatorprotected List<AdvancedSignature> The list of signaturesprotected eu.europa.esig.dss.model.DSSDocumentThe signed documentprotected Set<eu.europa.esig.dss.spi.x509.tsp.TimestampToken> The list of timestamp tokensThe cached map of evidence recordsThe cached map of signaturesThe cached map of original signed dataThe cached map of timestampsFields inherited from class eu.europa.esig.dss.validation.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(eu.europa.esig.dss.spi.x509.ListCertificateSource trustedCertSources) This method allows to setListCertificateSourcecontaining all certificate sources used in the validator (including trusted certificate sources)eu.europa.esig.dss.diagnostic.jaxb.XmlDiagnosticDatabuild()BuildsXmlDiagnosticDataeu.europa.esig.dss.diagnostic.jaxb.XmlSignaturebuildDetachedXmlSignature(AdvancedSignature signature) BuildsXmlSignatureprotected eu.europa.esig.dss.diagnostic.jaxb.XmlTimestampbuildDetachedXmlTimestamp(eu.europa.esig.dss.spi.x509.tsp.TimestampToken timestampToken) This method buildsXmlTimestampfromTimestampTokenprotected <R extends eu.europa.esig.dss.model.x509.revocation.Revocation>
eu.europa.esig.dss.diagnostic.jaxb.XmlOrphanRevocationTokencreateOrphanTokenFromRevocationIdentifier(eu.europa.esig.dss.model.identifier.EncapsulatedRevocationTokenIdentifier<R> revocationIdentifier) Creates an orphan revocation token fromEncapsulatedRevocationTokenIdentifierdefaultDigestAlgorithm(eu.europa.esig.dss.enumerations.DigestAlgorithm digestAlgorithm) This method allows to set the defaultDigestAlgorithmwhich will be used for tokens' DigestAlgoAndValue calculationdocument(eu.europa.esig.dss.model.DSSDocument signedDocument) This method allows to set the document which is analyseddocumentCertificateSource(eu.europa.esig.dss.spi.x509.ListCertificateSource documentCertificateSource) Sets a document Certificate Source containing all sources extracted from the provided signature(s)/timestamp(s)documentCRLSource(eu.europa.esig.dss.spi.x509.revocation.ListRevocationSource<eu.europa.esig.dss.model.x509.revocation.crl.CRL> documentCRLSource) Sets a document CRL Source containing all sources extracted from the provided signature(s)/timestamp(s)documentOCSPSource(eu.europa.esig.dss.spi.x509.revocation.ListRevocationSource<eu.europa.esig.dss.model.x509.revocation.ocsp.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(List<EvidenceRecord> evidenceRecords) This method allows to set the evidence recordsfoundSignatures(List<AdvancedSignature> signatures) This method allows to set the found signaturesprotected List<eu.europa.esig.dss.diagnostic.jaxb.XmlSignerInfo> getXmlSignerInformationStore(Set<eu.europa.esig.dss.spi.x509.SignerIdentifier> signerIdentifiers) Builds a list ofXmlSignerInfofromSignerIdentifiersprotected voidlinkSigningCertificateAndChains(Set<eu.europa.esig.dss.model.x509.CertificateToken> certificates) Links the certificates and their certificate chainssignaturePolicyProvider(SignaturePolicyProvider signaturePolicyProvider) This method allows to set theSignaturePolicyProvidersignaturePolicyValidatorLoader(SignaturePolicyValidatorLoader signaturePolicyValidatorLoader) This method allows to set theSignaturePolicyValidatorLoadertokenExtractionStrategy(eu.europa.esig.dss.enumerations.TokenExtractionStrategy tokenExtractionStrategy) This method allows to set theTokenExtractionStrategyto follow for the token extractionusedCertificates(Set<eu.europa.esig.dss.model.x509.CertificateToken> usedCertificates) This method allows to set the used certificatesusedRevocations(Set<eu.europa.esig.dss.spi.x509.revocation.RevocationToken> usedRevocations) This method allows to set the used revocation datausedTimestamps(Set<eu.europa.esig.dss.spi.x509.tsp.TimestampToken> usedTimestamps) This method allows to set the timestampsvalidationDate(Date validationDate) This method allows to set the validation dateMethods inherited from class eu.europa.esig.dss.validation.DiagnosticDataBuilder
buildDetachedXmlCertificate, buildDetachedXmlRevocation, buildXmlOrphanCertificateToken, buildXmlOrphanTokens, getUsedCertificatesByCertificateRef, getXmlBasicSignature, getXmlCertificateRef, getXmlCRLRevocationRef, getXmlDigestAlgoAndValue, getXmlDigestAlgoAndValue, getXmlForCertificateChain, getXmlForCertificateChain, getXmlForCertificateChain, getXmlFoundCertificates, getXmlFoundCertificates, getXmlOCSPRevocationRef, getXmlOrphanCertificate, getXmlRelatedCertificateForOrphanReferences, getXmlRevocationRefs, getXmlSignerInfo, getXmlSigningCertificate, populateCertificateOriginMap, populateOrphanCertificateOriginMap, populateXmlRelatedCertificatesList, populateXmlRelatedCertificatesList, tokenIdentifierProvider, verifyAgainstCertificateToken
-
Field Details
-
signedDocument
protected eu.europa.esig.dss.model.DSSDocument signedDocumentThe signed document -
signatures
The list of signatures -
usedTimestamps
The list of timestamp tokens -
evidenceRecords
The list of evidence records -
signaturePolicyProvider
The signature policy provider -
signaturePolicyValidatorLoader
Loads aSignaturePolicyValidator -
documentCertificateSource
protected eu.europa.esig.dss.spi.x509.ListCertificateSource documentCertificateSourceThe list of all certificate sources extracted from a validating document (signature(s), timestamp(s)) -
documentCRLSource
protected eu.europa.esig.dss.spi.x509.revocation.ListRevocationSource<eu.europa.esig.dss.model.x509.revocation.crl.CRL> documentCRLSourceThe list of all CRL revocation sources extracted from a validating document (signature(s), timestamp(s)) -
documentOCSPSource
protected eu.europa.esig.dss.spi.x509.revocation.ListRevocationSource<eu.europa.esig.dss.model.x509.revocation.ocsp.OCSP> documentOCSPSourceThe 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
public SignedDocumentDiagnosticDataBuilder usedCertificates(Set<eu.europa.esig.dss.model.x509.CertificateToken> 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
public SignedDocumentDiagnosticDataBuilder usedRevocations(Set<eu.europa.esig.dss.spi.x509.revocation.RevocationToken> 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(eu.europa.esig.dss.spi.x509.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(eu.europa.esig.dss.enumerations.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
public SignedDocumentDiagnosticDataBuilder defaultDigestAlgorithm(eu.europa.esig.dss.enumerations.DigestAlgorithm digestAlgorithm) 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
public SignedDocumentDiagnosticDataBuilder document(eu.europa.esig.dss.model.DSSDocument signedDocument) This method allows to set the document which is analysed- Parameters:
signedDocument- the document which is analysed- Returns:
- the builder
-
foundSignatures
This method allows to set the found signatures- Parameters:
signatures- the found signatures- Returns:
- the builder
-
usedTimestamps
public SignedDocumentDiagnosticDataBuilder usedTimestamps(Set<eu.europa.esig.dss.spi.x509.tsp.TimestampToken> usedTimestamps) This method allows to set the timestamps- Parameters:
usedTimestamps- a set of validatedTimestampTokens- Returns:
- the builder
-
foundEvidenceRecords
public SignedDocumentDiagnosticDataBuilder foundEvidenceRecords(List<EvidenceRecord> evidenceRecords) This method allows to set the evidence records- Parameters:
evidenceRecords- a set of foundEvidenceRecords- Returns:
- the builder
-
signaturePolicyProvider
public SignedDocumentDiagnosticDataBuilder signaturePolicyProvider(SignaturePolicyProvider signaturePolicyProvider) This method allows to set theSignaturePolicyProvider- Parameters:
signaturePolicyProvider-SignaturePolicyProvider- Returns:
- the builder
-
documentCertificateSource
public SignedDocumentDiagnosticDataBuilder documentCertificateSource(eu.europa.esig.dss.spi.x509.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
-
signaturePolicyValidatorLoader
public SignedDocumentDiagnosticDataBuilder signaturePolicyValidatorLoader(SignaturePolicyValidatorLoader signaturePolicyValidatorLoader) This method allows to set theSignaturePolicyValidatorLoader- Parameters:
signaturePolicyValidatorLoader-SignaturePolicyValidatorLoader- Returns:
- the builder
-
documentCRLSource
public SignedDocumentDiagnosticDataBuilder documentCRLSource(eu.europa.esig.dss.spi.x509.revocation.ListRevocationSource<eu.europa.esig.dss.model.x509.revocation.crl.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(eu.europa.esig.dss.spi.x509.revocation.ListRevocationSource<eu.europa.esig.dss.model.x509.revocation.ocsp.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
public eu.europa.esig.dss.diagnostic.jaxb.XmlDiagnosticData build()BuildsXmlDiagnosticData- Overrides:
buildin classDiagnosticDataBuilder- Returns:
XmlDiagnosticData
-
linkSigningCertificateAndChains
protected void linkSigningCertificateAndChains(Set<eu.europa.esig.dss.model.x509.CertificateToken> certificates) Description copied from class:DiagnosticDataBuilderLinks the certificates and their certificate chains- Overrides:
linkSigningCertificateAndChainsin classDiagnosticDataBuilder- Parameters:
certificates- a set ofCertificateTokens
-
buildDetachedXmlSignature
public eu.europa.esig.dss.diagnostic.jaxb.XmlSignature buildDetachedXmlSignature(AdvancedSignature signature) BuildsXmlSignature- Parameters:
signature-AdvancedSignature- Returns:
XmlSignature
-
emptyToNull
If text is empty returns NULL, or original text otherwise -
createOrphanTokenFromRevocationIdentifier
protected <R extends eu.europa.esig.dss.model.x509.revocation.Revocation> eu.europa.esig.dss.diagnostic.jaxb.XmlOrphanRevocationToken createOrphanTokenFromRevocationIdentifier(eu.europa.esig.dss.model.identifier.EncapsulatedRevocationTokenIdentifier<R> revocationIdentifier) Creates an orphan revocation token fromEncapsulatedRevocationTokenIdentifier- Type Parameters:
R-Revocation- Parameters:
revocationIdentifier-EncapsulatedRevocationTokenIdentifier- Returns:
XmlOrphanRevocationToken
-
buildDetachedXmlTimestamp
protected eu.europa.esig.dss.diagnostic.jaxb.XmlTimestamp buildDetachedXmlTimestamp(eu.europa.esig.dss.spi.x509.tsp.TimestampToken timestampToken) This method buildsXmlTimestampfromTimestampToken- Parameters:
timestampToken-TimestampToken- Returns:
XmlTimestamp
-
getXmlSignerInformationStore
protected List<eu.europa.esig.dss.diagnostic.jaxb.XmlSignerInfo> getXmlSignerInformationStore(Set<eu.europa.esig.dss.spi.x509.SignerIdentifier> signerIdentifiers) Builds a list ofXmlSignerInfofromSignerIdentifiers- Parameters:
signerIdentifiers- a set ofSignerIdentifier- Returns:
- a list of
XmlSignerInfos
-