Package eu.europa.esig.dss.validation
Class DiagnosticDataBuilder
java.lang.Object
eu.europa.esig.dss.validation.DiagnosticDataBuilder
- Direct Known Subclasses:
CertificateDiagnosticDataBuilder
,SignedDocumentDiagnosticDataBuilder
public abstract class DiagnosticDataBuilder extends Object
Contains a common code for DiagnosticData building
-
Field Summary
Fields Modifier and Type Field Description protected Map<String,CertificateToken>
certificateIdsMap
A map between certificate id Strings and the related CertificateTokensprotected Map<CertificateToken,Set<CertificateSourceType>>
certificateSourceTypes
A map between certificate tokens and source types where they been obtained fromprotected DigestAlgorithm
defaultDigestAlgorithm
The digest algorithm to use for digest computationprotected Map<String,String>
referenceMap
A map between references ids and their related token ids (used to map references for timestamped refs)protected Map<String,CertificateToken>
signingCertificateMap
A map between certificate id Strings and the related CertificateTokens for signing certificatesprotected TokenExtractionStrategy
tokenExtractionStrategy
The token extraction strategyprotected ListCertificateSource
trustedCertSources
The list of trusted certificate sourcesprotected Set<CertificateToken>
usedCertificates
The certificates used during the validation processprotected Set<RevocationToken<Revocation>>
usedRevocations
The revocation used during the validation processprotected Date
validationDate
The validation timeprotected Map<String,XmlCertificate>
xmlCertsMap
The cached map of certificatesprotected Map<String,XmlOrphanCertificateToken>
xmlOrphanCertificateTokensMap
The cached map of orphan certificatesprotected Map<String,XmlOrphanRevocationToken>
xmlOrphanRevocationTokensMap
The cached map of orphan revocation dataprotected Map<String,XmlRevocation>
xmlRevocationsMap
The cached map of revocation dataprotected Map<String,XmlTrustedList>
xmlTrustedListsMap
The cached map of trusted lists -
Constructor Summary
Constructors Constructor Description DiagnosticDataBuilder()
-
Method Summary
-
Field Details
-
usedCertificates
The certificates used during the validation process -
usedRevocations
The revocation used during the validation process -
trustedCertSources
The list of trusted certificate sources -
validationDate
The validation time -
certificateSourceTypes
A map between certificate tokens and source types where they been obtained from -
tokenExtractionStrategy
The token extraction strategy -
defaultDigestAlgorithm
The digest algorithm to use for digest computation -
xmlCertsMap
The cached map of certificates -
xmlRevocationsMap
The cached map of revocation data -
xmlTrustedListsMap
The cached map of trusted lists -
xmlOrphanCertificateTokensMap
The cached map of orphan certificates -
xmlOrphanRevocationTokensMap
The cached map of orphan revocation data -
referenceMap
A map between references ids and their related token ids (used to map references for timestamped refs) -
certificateIdsMap
A map between certificate id Strings and the related CertificateTokens -
signingCertificateMap
A map between certificate id Strings and the related CertificateTokens for signing certificates
-
-
Constructor Details
-
DiagnosticDataBuilder
public DiagnosticDataBuilder()
-
-
Method Details
-
usedCertificates
This method allows to set the used certificates- Parameters:
usedCertificates
- the used certificates- Returns:
- the builder
-
certificateSourceTypes
public DiagnosticDataBuilder certificateSourceTypes(Map<CertificateToken,Set<CertificateSourceType>> certificateSourceTypes)This method allows to set the certificate source types- Parameters:
certificateSourceTypes
- the certificate source types- Returns:
- the builder
-
usedRevocations
This method allows to set the used revocation data- Parameters:
usedRevocations
- the used revocation data- Returns:
- the builder
-
trustedCertificateSources
This method allows to set the TrustedListsCertificateSources- Parameters:
trustedCertSources
- the list of trusted lists certificate sources- Returns:
- the builder
-
validationDate
This method allows to set the validation date- Parameters:
validationDate
- the validation date- Returns:
- the builder
-
tokenExtractionStrategy
public DiagnosticDataBuilder tokenExtractionStrategy(TokenExtractionStrategy tokenExtractionStrategy)This method allows to set theTokenExtractionStrategy
to follow for the token extraction- Parameters:
tokenExtractionStrategy
-TokenExtractionStrategy
to use- Returns:
- the builder
-
defaultDigestAlgorithm
This method allows to set the defaultDigestAlgorithm
which will be used for tokens' DigestAlgoAndValue calculation- Parameters:
digestAlgorithm
-DigestAlgorithm
to set as default- Returns:
- the builder
-
build
BuildsXmlDiagnosticData
- Returns:
XmlDiagnosticData
-
getXmlSignerInfo
-
buildDetachedXmlRevocation
-
getXmlRevocationRefs
protected <R extends Revocation> List<XmlRevocationRef> getXmlRevocationRefs(String tokenId, Map<RevocationRef<R>,Set<RevocationRefOrigin>> refsAndOrigins) -
getXmlCRLRevocationRef
-
getXmlOCSPRevocationRef
protected XmlRevocationRef getXmlOCSPRevocationRef(OCSPRef ocspRef, Set<RevocationRefOrigin> origins) -
getXmlForCertificateChain
-
getXmlForCertificateChain
-
getXmlSigningCertificate
protected XmlSigningCertificate getXmlSigningCertificate(Identifier tokenIdentifier, CertificateValidity certificateValidity) -
getXmlFoundCertificates
protected XmlFoundCertificates getXmlFoundCertificates(Identifier tokenIdentifier, TokenCertificateSource certificateSource) -
populateCertificateOriginMap
protected void populateCertificateOriginMap(Map<String,XmlRelatedCertificate> relatedCertificatesMap, CertificateOrigin origin, List<CertificateToken> certificateTokens, TokenCertificateSource certificateSource) -
getXmlRelatedCertificate
protected XmlRelatedCertificate getXmlRelatedCertificate(CertificateOrigin origin, CertificateToken cert, TokenCertificateSource certificateSource) -
getXmlRelatedCertificate
protected XmlRelatedCertificate getXmlRelatedCertificate(TokenCertificateSource certificateSource, CertificateToken cert, CertificateRef certificateRef) -
getXmlCertificateRef
-
getXmlRelatedCertificateForOrphanReferences
protected List<XmlRelatedCertificate> getXmlRelatedCertificateForOrphanReferences(TokenCertificateSource certificateSource) -
getUsedCertificateByCertificateRef
-
verifyAgainstCertificateToken
protected void verifyAgainstCertificateToken(XmlCertificateRef xmlCertificateRef, CertificateRef ref, CertificateToken signingCertificate) -
getXmlBasicSignature
-
buildDetachedXmlCertificate
-
getXmlDigestAlgoAndValue
-
getXmlDigestAlgoAndValue
protected XmlDigestAlgoAndValue getXmlDigestAlgoAndValue(DigestAlgorithm digestAlgo, byte[] digestValue)
-