Package eu.europa.esig.dss.validation
Class SignedDocumentDiagnosticDataBuilder
java.lang.Object
eu.europa.esig.dss.validation.DiagnosticDataBuilder
eu.europa.esig.dss.validation.SignedDocumentDiagnosticDataBuilder
- Direct Known Subclasses:
ASiCContainerDiagnosticDataBuilder
,CAdESDiagnosticDataBuilder
The common class for DiagnosticData creation from a signed/timestamped document
-
Field Summary
Modifier and TypeFieldDescriptionprotected ListCertificateSource
The 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 SignaturePolicyProvider
The signature policy providerprotected SignaturePolicyValidatorLoader
Loads aSignaturePolicyValidator
protected List<AdvancedSignature>
The list of signaturesprotected DSSDocument
The signed documentprotected Set<TimestampToken>
The list of timestamp tokensprotected 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 eu.europa.esig.dss.validation.DiagnosticDataBuilder
allCertificateSources, certificateIdsMap, defaultDigestAlgorithm, identifierProvider, referenceMap, signingCertificateMap, tlInfoMap, tokenExtractionStrategy, usedCertificates, usedRevocations, validationDate, xmlCertsMap, xmlOrphanCertificateTokensMap, xmlOrphanRevocationTokensMap, xmlRevocationsMap, xmlTrustedListsMap
-
Constructor Summary
ConstructorDescriptionDefault constructor instantiating object with null values and empty maps -
Method Summary
Modifier and TypeMethodDescriptionallCertificateSources
(ListCertificateSource trustedCertSources) This method allows to setListCertificateSource
containing all certificate sources used in the validator (including trusted certificate sources)build()
BuildsXmlDiagnosticData
buildDetachedXmlSignature
(AdvancedSignature signature) BuildsXmlSignature
protected XmlTimestamp
buildDetachedXmlTimestamp
(TimestampToken timestampToken) This method buildsXmlTimestamp
fromTimestampToken
protected <R extends Revocation>
XmlOrphanRevocationTokencreateOrphanTokenFromRevocationIdentifier
(EncapsulatedRevocationTokenIdentifier<R> revocationIdentifier) Creates an orphan revocation token fromEncapsulatedRevocationTokenIdentifier
defaultDigestAlgorithm
(DigestAlgorithm digestAlgorithm) This method allows to set the defaultDigestAlgorithm
which 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 String
emptyToNull
(String text) If text is empty returns NULL, or original text otherwisefoundSignatures
(List<AdvancedSignature> signatures) This method allows to set the found signaturesprotected List<XmlSignerInfo>
getXmlSignerInformationStore
(Set<SignerIdentifier> signerIdentifiers) Builds a list ofXmlSignerInfo
fromSignerIdentifier
sprotected void
linkSigningCertificateAndChains
(Set<CertificateToken> certificates) Links the certificates and their certificate chainssignaturePolicyProvider
(SignaturePolicyProvider signaturePolicyProvider) This method allows to set theSignaturePolicyProvider
signaturePolicyValidatorLoader
(SignaturePolicyValidatorLoader signaturePolicyValidatorLoader) This method allows to set theSignaturePolicyValidatorLoader
tokenExtractionStrategy
(TokenExtractionStrategy tokenExtractionStrategy) This method allows to set theTokenExtractionStrategy
to 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
(Set<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, getUsedCertificateByCertificateRef, getXmlBasicSignature, getXmlCertificateRef, getXmlCRLRevocationRef, getXmlDigestAlgoAndValue, getXmlDigestAlgoAndValue, getXmlForCertificateChain, getXmlForCertificateChain, getXmlForCertificateChain, getXmlFoundCertificates, getXmlOCSPRevocationRef, getXmlOrphanCertificate, getXmlRelatedCertificateForOrphanReferences, getXmlRevocationRefs, getXmlSignerInfo, getXmlSigningCertificate, populateCertificateOriginMap, populateOrphanCertificateOriginMap, populateXmlRelatedCertificatesList, populateXmlRelatedCertificatesList, tokenIdentifierProvider, verifyAgainstCertificateToken
-
Field Details
-
signedDocument
The signed document -
signatures
The list of signatures -
usedTimestamps
The list of timestamp tokens -
signaturePolicyProvider
The signature policy provider -
signaturePolicyValidatorLoader
Loads aSignaturePolicyValidator
-
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 -
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:DiagnosticDataBuilder
This method allows to set the used certificates- Overrides:
usedCertificates
in classDiagnosticDataBuilder
- Parameters:
usedCertificates
- the used certificates- Returns:
- the builder
-
usedRevocations
Description copied from class:DiagnosticDataBuilder
This method allows to set the used revocation data- Overrides:
usedRevocations
in classDiagnosticDataBuilder
- Parameters:
usedRevocations
- the used revocation data- Returns:
- the builder
-
allCertificateSources
public SignedDocumentDiagnosticDataBuilder allCertificateSources(ListCertificateSource trustedCertSources) Description copied from class:DiagnosticDataBuilder
This method allows to setListCertificateSource
containing all certificate sources used in the validator (including trusted certificate sources)- Overrides:
allCertificateSources
in classDiagnosticDataBuilder
- Parameters:
trustedCertSources
- the list of trusted lists certificate sources- Returns:
- the builder
-
validationDate
Description copied from class:DiagnosticDataBuilder
This method allows to set the validation date- Overrides:
validationDate
in classDiagnosticDataBuilder
- Parameters:
validationDate
- the validation date- Returns:
- the builder
-
tokenExtractionStrategy
public SignedDocumentDiagnosticDataBuilder tokenExtractionStrategy(TokenExtractionStrategy tokenExtractionStrategy) Description copied from class:DiagnosticDataBuilder
This method allows to set theTokenExtractionStrategy
to follow for the token extraction- Overrides:
tokenExtractionStrategy
in classDiagnosticDataBuilder
- Parameters:
tokenExtractionStrategy
-TokenExtractionStrategy
to use- Returns:
- the builder
-
defaultDigestAlgorithm
Description copied from class:DiagnosticDataBuilder
This method allows to set the defaultDigestAlgorithm
which will be used for tokens' DigestAlgoAndValue calculation- Overrides:
defaultDigestAlgorithm
in classDiagnosticDataBuilder
- Parameters:
digestAlgorithm
-DigestAlgorithm
to 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
This method allows to set the found signatures- Parameters:
signatures
- the found signatures- Returns:
- the builder
-
usedTimestamps
This method allows to set the timestamps- Parameters:
usedTimestamps
- a set of validatedTimestampToken
s- 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(ListCertificateSource documentCertificateSource) Sets a document Certificate Source containing all sources extracted from the provided signature(s)/timestamp(s)- Parameters:
documentCertificateSource
-ListCertificateSource
computed 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(ListRevocationSource<CRL> documentCRLSource) Sets a document CRL Source containing all sources extracted from the provided signature(s)/timestamp(s)- Parameters:
documentCRLSource
-ListRevocationSource
computed 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
-ListRevocationSource
computed from document sources- Returns:
- the builder
-
build
BuildsXmlDiagnosticData
- Overrides:
build
in classDiagnosticDataBuilder
- Returns:
XmlDiagnosticData
-
linkSigningCertificateAndChains
Description copied from class:DiagnosticDataBuilder
Links the certificates and their certificate chains- Overrides:
linkSigningCertificateAndChains
in classDiagnosticDataBuilder
- Parameters:
certificates
- a set ofCertificateToken
s
-
buildDetachedXmlSignature
BuildsXmlSignature
- Parameters:
signature
-AdvancedSignature
- Returns:
XmlSignature
-
emptyToNull
If text is empty returns NULL, or original text otherwise -
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 buildsXmlTimestamp
fromTimestampToken
- Parameters:
timestampToken
-TimestampToken
- Returns:
XmlTimestamp
-
getXmlSignerInformationStore
Builds a list ofXmlSignerInfo
fromSignerIdentifier
s- Parameters:
signerIdentifiers
- a set ofSignerIdentifier
- Returns:
- a list of
XmlSignerInfo
s
-