Class DiagnosticData

java.lang.Object
eu.europa.esig.dss.diagnostic.DiagnosticData

public class DiagnosticData extends Object
This class represents all static data extracted by the process analysing the signature. They are independent from the validation policy to be applied.
  • Constructor Details

  • Method Details

    • getDocumentName

      public String getDocumentName()
      Returns a name of the validating document
      Returns:
      String
    • getSignatureIdList

      public List<String> getSignatureIdList()
      This method returns the list of the signature id. The result is stored in the local variable.
      Returns:
      list of signature ids, is never null, can be empty
    • getFirstSignatureId

      public String getFirstSignatureId()
      This method returns the first signature id.
      Returns:
      the first signature id
    • getFirstSignatureDate

      public Date getFirstSignatureDate()
      This method returns the first signature time.
      Returns:
      the first signature time
    • getSignatureDate

      public Date getSignatureDate(String signatureId)
      This method returns the claimed signing time.
      Parameters:
      signatureId - The identifier of the signature, for which the date is sought.
      Returns:
      the signature time for the given signature
    • getFirstSignatureFormat

      public SignatureLevel getFirstSignatureFormat()
      This method returns the signature format for the first signature.
      Returns:
      The first signature format
    • getSignatureFormat

      public SignatureLevel getSignatureFormat(String signatureId)
      This method returns the signature format for the given signature.
      Parameters:
      signatureId - The identifier of the signature, for which the format is sought.
      Returns:
      The signature format
    • getSignedAssertionsInFirstSignature

      public List<XmlSignerRole> getSignedAssertionsInFirstSignature()
      This method returns the signed assertions for the first signature.
      Returns:
      list of XmlSignerRoles
    • getSignedAssertions

      public List<XmlSignerRole> getSignedAssertions(String signatureId)
      This method returns the signed assertions for the given signature.
      Parameters:
      signatureId - The identifier of the signature, for which the signed assertions are sought.
      Returns:
      list of XmlSignerRoles
    • getFirstSignatureDigestAlgorithm

      public DigestAlgorithm getFirstSignatureDigestAlgorithm()
      This method returns the DigestAlgorithm of the first signature.
      Returns:
      The DigestAlgorithm of the first signature
    • getSignatureDigestAlgorithm

      public DigestAlgorithm getSignatureDigestAlgorithm(String signatureId)
      This method returns the DigestAlgorithm for the given signature.
      Parameters:
      signatureId - The identifier of the signature, for which the algorithm is sought.
      Returns:
      The DigestAlgorithm for the given signature
    • getFirstSignatureEncryptionAlgorithm

      public EncryptionAlgorithm getFirstSignatureEncryptionAlgorithm()
      This method returns the EncryptionAlgorithm of the first signature.
      Returns:
      The EncryptionAlgorithm of the first signature
    • getSignatureEncryptionAlgorithm

      public EncryptionAlgorithm getSignatureEncryptionAlgorithm(String signatureId)
      This method returns the DigestAlgorithm for the given signature.
      Parameters:
      signatureId - The identifier of the signature, for which the algorithm is sought.
      Returns:
      The DigestAlgorithm for the given signature
    • getSignatureMaskGenerationFunction

      public MaskGenerationFunction getSignatureMaskGenerationFunction(String signatureId)
      This method returns the MaskGenerationFunction for the given signature.
      Parameters:
      signatureId - The identifier of the signature, for which the algorithm is sought.
      Returns:
      The MaskGenerationFunction for the given signature
    • getSigningCertificateId

      public String getSigningCertificateId(String signatureId)
      This method returns signing certificate dss id for the given signature.
      Parameters:
      signatureId - The identifier of the signature, for which the signing certificate is sought.
      Returns:
      signing certificate dss id for the given signature.
    • isSigningCertificateIdentified

      public boolean isSigningCertificateIdentified(String signatureId)
      This method indicates if the digest value and the issuer and serial match for the signing certificate .
      Parameters:
      signatureId - The identifier of the signature.
      Returns:
      true if the digest value and the issuer and serial match.
    • getSignatureCertificateChain

      public List<String> getSignatureCertificateChain(String signatureId)
      This method returns the list of certificates in the chain of the main signature.
      Parameters:
      signatureId - The identifier of the signature.
      Returns:
      list of certificate's dss id for the given signature.
    • getFirstPolicyId

      public String getFirstPolicyId()
      The identifier of the policy of the first signature.
      Returns:
      the policy identifier of the first signature
    • getPolicyId

      public String getPolicyId(String signatureId)
      The identifier of the policy.
      Parameters:
      signatureId - The identifier of the signature.
      Returns:
      the policy identifier
    • getPolicyDescription

      public String getPolicyDescription(String signatureId)
      The description of the policy.
      Parameters:
      signatureId - The identifier of the signature.
      Returns:
      the policy description
    • getPolicyDocumentationReferences

      public List<String> getPolicyDocumentationReferences(String signatureId)
      The documentation references of the policy
      Parameters:
      signatureId - The identifier of the signature.
      Returns:
      the policy documentation references
    • getTimestampIdList

      public List<String> getTimestampIdList()
      This method returns the list of identifier of the all timestamps found during the validation.
      Returns:
      The list of identifier of the timestamps
    • getTimestampIdList

      public List<String> getTimestampIdList(String signatureId)
      This method returns the list of identifier of the timestamps related to the given signature.
      Parameters:
      signatureId - The identifier of the signature.
      Returns:
      The list of identifier of the timestamps
    • getTimestampList

      public List<TimestampWrapper> getTimestampList(String signatureId)
      This method returns the list of timestamps wrappers which covers the given signature.
      Parameters:
      signatureId - The identifier of the signature.
      Returns:
      The list of timestamp wrappers
    • isBLevelTechnicallyValid

      public boolean isBLevelTechnicallyValid(String signatureId)
      Indicates if the -B level is technically valid. It means that the signature value is valid.
      Parameters:
      signatureId - The identifier of the signature.
      Returns:
      true if the signature value is valid
    • isThereTLevel

      public boolean isThereTLevel(String signatureId)
      Indicates if there is a signature timestamp.
      Parameters:
      signatureId - The identifier of the signature.
      Returns:
      true if the signature timestamp is present
    • isTLevelTechnicallyValid

      public boolean isTLevelTechnicallyValid(String signatureId)
      Indicates if the -T level is technically valid. It means that the signature and the digest are valid.
      Parameters:
      signatureId - The identifier of the signature.
      Returns:
      true if the signature and digest are valid
    • isThereXLevel

      public boolean isThereXLevel(String signatureId)
      Indicates if there is an -X1 or -X2 timestamp.
      Parameters:
      signatureId - The identifier of the signature.
      Returns:
      true if the -X1 or -X2 is present
    • isXLevelTechnicallyValid

      public boolean isXLevelTechnicallyValid(String signatureId)
      Indicates if the -X level is technically valid. It means that the signature and the digest are valid.
      Parameters:
      signatureId - The identifier of the signature.
      Returns:
      true if the signature and digest are valid
    • isThereALevel

      public boolean isThereALevel(String signatureId)
      Indicates if there is an archive timestamp.
      Parameters:
      signatureId - The identifier of the signature.
      Returns:
      true if the archive timestamp is present
    • isALevelTechnicallyValid

      public boolean isALevelTechnicallyValid(String signatureId)
      Indicates if the -A (-LTA) level is technically valid. It means that the signature of the archive timestamps are valid and their imprint is valid too.
      Parameters:
      signatureId - The identifier of the signature.
      Returns:
      true if the signature and digest are valid
    • getSignerDocuments

      public List<SignerDataWrapper> getSignerDocuments(String signatureId)
      Returns a list of all Signer's documents used to create a signature NOTE: returns a first level documents only (e.g. a signed Manifest for XAdES, when applicable)
      Parameters:
      signatureId - The identifier of the signature.
      Returns:
      a list of SignerDataWrapper signer's documents
    • getTimestampSigningCertificateId

      public String getTimestampSigningCertificateId(String timestampId)
      Returns the identifier of the timestamp signing certificate.
      Parameters:
      timestampId - timestamp id
      Returns:
      signing certificate id
    • getTimestampType

      public TimestampType getTimestampType(String timestampId)
      This method returns the timestamp type of the given timestamp
      Parameters:
      timestampId - the timestamp id
      Returns:
      the related timestamp type
    • isValidCertificate

      public boolean isValidCertificate(String dssCertificateId)
      This method indicates if the certificate signature is valid and the revocation status is valid.
      Parameters:
      dssCertificateId - DSS certificate identifier to be checked
      Returns:
      certificate validity
    • getCertificateDN

      public String getCertificateDN(String dssCertificateId)
      This method returns the subject distinguished name for the given dss certificate identifier.
      Parameters:
      dssCertificateId - DSS certificate identifier to be checked
      Returns:
      subject distinguished name
    • getCertificateIssuerDN

      public String getCertificateIssuerDN(String dssCertificateId)
      This method returns the issuer distinguished name for the given dss certificate identifier.
      Parameters:
      dssCertificateId - DSS certificate identifier to be checked
      Returns:
      issuer distinguished name
    • getCertificateSerialNumber

      public String getCertificateSerialNumber(String dssCertificateId)
      This method returns the serial number of the given dss certificate identifier.
      Parameters:
      dssCertificateId - DSS certificate identifier to be checked
      Returns:
      serial number
    • getCertificateRevocationSource

      public RevocationType getCertificateRevocationSource(String dssCertificateId)
      This method returns the revocation source for the given certificate.
      Parameters:
      dssCertificateId - DSS certificate identifier to be checked
      Returns:
      revocation source
    • getCertificateRevocationStatus

      public CertificateStatus getCertificateRevocationStatus(String dssCertificateId)
      This method returns the revocation status for the given certificate.
      Parameters:
      dssCertificateId - DSS certificate identifier to be checked
      Returns:
      certificate status
    • getCertificateRevocationReason

      public RevocationReason getCertificateRevocationReason(String dssCertificateId)
      This method returns the revocation reason for the given certificate.
      Parameters:
      dssCertificateId - DSS certificate identifier to be checked
      Returns:
      revocation reason
    • getErrorMessage

      public String getErrorMessage(String signatureId)
      This method retrieves the error message for the given signature id
      Parameters:
      signatureId - the signature id
      Returns:
      the error message
    • getSignatureById

      public SignatureWrapper getSignatureById(String id)
      This method returns a signature wrapper for the given signature id
      Parameters:
      id - the signature id
      Returns:
      a signature wrapper or null
    • getTimestampById

      public TimestampWrapper getTimestampById(String id)
      Returns the TimestampWrapper corresponding to the given id.
      Parameters:
      id - timestamp id
      Returns:
      timestamp wrapper or null
    • getUsedCertificateByIdNullSafe

      public CertificateWrapper getUsedCertificateByIdNullSafe(String id)
      This method returns a certificate wrapper for the given certificate id
      Parameters:
      id - the certificate id
      Returns:
      a certificate wrapper (or empty object)
    • getUsedCertificateById

      public CertificateWrapper getUsedCertificateById(String id)
      This method returns a certificate wrapper for the given certificate id
      Parameters:
      id - the certificate id
      Returns:
      a certificate wrapper or null
    • getOrphanCertificateById

      public OrphanCertificateTokenWrapper getOrphanCertificateById(String id)
      This method returns an orphan certificate wrapper for the given certificate id
      Parameters:
      id - the certificate id
      Returns:
      a orphan certificate wrapper or null
    • getCertificatesFromSource

      public List<CertificateWrapper> getCertificatesFromSource(CertificateSourceType certificateSourceType)
      Returns a list of certificates by their origin source
      Parameters:
      certificateSourceType - CertificateSourceType to get certificates with
      Returns:
      list of CertificateWrappers
    • getAllOrphanCertificateObjects

      public List<OrphanCertificateTokenWrapper> getAllOrphanCertificateObjects()
      Returns a list of all found OrphanCertificateWrapper values
      Returns:
      list of OrphanCertificateWrappers
    • getAllOrphanCertificateReferences

      public List<OrphanCertificateTokenWrapper> getAllOrphanCertificateReferences()
      Returns a list of all found orphan certificate references
      Returns:
      list of OrphanTokenWrappers
    • getAllOrphanRevocationObjects

      public List<OrphanRevocationTokenWrapper> getAllOrphanRevocationObjects()
      Returns a list of all found OrphanRevocationWrapper values
      Returns:
      list of OrphanRevocationWrappers
    • getAllOrphanRevocationReferences

      public List<OrphanRevocationTokenWrapper> getAllOrphanRevocationReferences()
      Returns a list of all found orphan revocation references
      Returns:
      list of OrphanRevocationTokenWrappers
    • getCrossCertificates

      public List<CertificateWrapper> getCrossCertificates(CertificateWrapper certificate)
      Returns a list of cross-certificates
      Parameters:
      certificate - CertificateWrapper to find cross certificates for
      Returns:
      a list of cross certificate CertificateWrappers
    • getOrphanCrossCertificates

      public List<OrphanCertificateTokenWrapper> getOrphanCrossCertificates(CertificateWrapper certificate)
      Returns a list of orphan cross-certificates
      Parameters:
      certificate - CertificateWrapper to find cross certificates for
      Returns:
      a list of OrphanCertificateTokenWrappers
    • getEquivalentCertificates

      public List<CertificateWrapper> getEquivalentCertificates(CertificateWrapper certificate)
      Returns a list of equivalent certificates (certificates with the same public key)
      Parameters:
      certificate - CertificateWrapper to find equivalent certificates for
      Returns:
      a list of equivalent certificates
    • getOrphanEquivalentCertificates

      public List<OrphanCertificateTokenWrapper> getOrphanEquivalentCertificates(CertificateWrapper certificate)
      Returns a list of orphan equivalent certificates (certificates with the same public key)
      Parameters:
      certificate - CertificateWrapper to find equivalent certificates for
      Returns:
      a list of orphan equivalent certificates
    • getSignatures

      public List<SignatureWrapper> getSignatures()
      This method retrieves a list of signature wrappers.
      Returns:
      a list of SignatureWrappers.
    • getTimestampList

      public List<TimestampWrapper> getTimestampList()
      This method retrieves a set of timestamp wrappers
      Returns:
      a List of timestamp wrappers
    • getUsedCertificates

      public List<CertificateWrapper> getUsedCertificates()
      This method retrieves a list of certificate wrappers
      Returns:
      a list of CertificateWrappers.
    • getAllSignatures

      public Set<SignatureWrapper> getAllSignatures()
      This method returns signatures (not countersignatures)
      Returns:
      a set of SignatureWrapper
    • getAllCounterSignatures

      public Set<SignatureWrapper> getAllCounterSignatures()
      This method returns counter-signatures (not signatures)
      Returns:
      a set of SignatureWrapper
    • getAllCounterSignaturesForMasterSignature

      public Set<SignatureWrapper> getAllCounterSignaturesForMasterSignature(SignatureWrapper masterSignatureWrapper)
      Returns a set of SignatureWrappers for a given masterSignatureWrapper
      Parameters:
      masterSignatureWrapper - - SignatureWrapper to get counter signatures for
      Returns:
      set of SignatureWrappers
    • getTimestampSet

      @Deprecated public Set<TimestampWrapper> getTimestampSet()
      Deprecated.
      since 5.12. Use Set<TimestampWrapper> timestampSet = new LinkedHashSet<>(getTimestampList());
      This method returns timestamps
      Returns:
      a set of TimestampWrapper
    • getAllRevocationData

      public Set<RevocationWrapper> getAllRevocationData()
      This method returns all revocation data
      Returns:
      a set of revocation data
    • getLatestRevocationDataForCertificate

      public CertificateRevocationWrapper getLatestRevocationDataForCertificate(CertificateWrapper certificate)
      Returns the last actual revocation for the given certificate
      Parameters:
      certificate - CertificateWrapper to find the latest revocation for
      Returns:
      CertificateRevocationWrapper revocation
    • getCertificateById

      public CertificateWrapper getCertificateById(String id)
      Returns CertificateWrapper with the given id
      Parameters:
      id - String identifier to get CertificateWrapper with
      Returns:
      CertificateWrapper
    • getRevocationById

      public RevocationWrapper getRevocationById(String id)
      Returns RevocationWrapper with the given id
      Parameters:
      id - String identifier to get RevocationWrapper with
      Returns:
      RevocationWrapper
    • getOriginalSignerDocuments

      public List<SignerDataWrapper> getOriginalSignerDocuments()
      Returns a complete list of original signer documents signed by all signatures
      Returns:
      list of SignerDataWrappers
    • getAllSignerDocuments

      public List<SignerDataWrapper> getAllSignerDocuments()
      This method returns a list of all covered documents, including the ones covering by timestamp(s), when applicable
      Returns:
      list of SignerDataWrappers
    • getJaxbModel

      public XmlDiagnosticData getJaxbModel()
      This method returns the JAXB model
      Returns:
      the jaxb model of the diagnostic data
    • isContainerInfoPresent

      public boolean isContainerInfoPresent()
      This method checks if the document is a container (ASiC)
      Returns:
      true if the document is a container
    • getContainerType

      public ASiCContainerType getContainerType()
      This method returns the container type
      Returns:
      the container type (ASiC-S/E)
    • getZipComment

      public String getZipComment()
      This method returns the zip comment (if the document is a container)
      Returns:
      the zip comment for the current document (if container) or null
    • isMimetypeFilePresent

      public boolean isMimetypeFilePresent()
      This method checks if the container has a mimetype file
      Returns:
      true if the mimetype file is present
    • getMimetypeFileContent

      public String getMimetypeFileContent()
      This method returns the content of the mimetype file (if container)
      Returns:
      the content of the mimetype file
    • getContainerInfo

      public XmlContainerInfo getContainerInfo()
      Returns information about ASiC container (when applicable)
      Returns:
      XmlContainerInfo
    • isPDFAValidationPerformed

      public boolean isPDFAValidationPerformed()
      Returns whether a document has been validated against PDF/A compliance
      Returns:
      TRUE if the PDF/A validation has been performed, FALSE otherwise
    • getPDFAProfileId

      public String getPDFAProfileId()
      Returns evaluated PDF/A profile Id
      Returns:
      String
    • isPDFACompliant

      public boolean isPDFACompliant()
      Returns whether the document is a PDF/A compliant (PDF/A validation shall be performed!)
      Returns:
      TRUE if the document is PDF/A compliant, FALSE otherwise
    • getPDFAValidationErrors

      public Collection<String> getPDFAValidationErrors()
      Returns a collection of PDF/A validation errors occurred during the validation
      Returns:
      a collection of Strings
    • getTrustedLists

      public List<XmlTrustedList> getTrustedLists()
      This method returns the JAXB model of the used trusted lists
      Returns:
      the JAXB model of the used trusted lists
    • getListOfTrustedLists

      public List<XmlTrustedList> getListOfTrustedLists()
      This method returns the JAXB model of the LOTL
      Returns:
      the JAXB model of the LOTL
    • getValidationDate

      public Date getValidationDate()
      Returns the validation time
      Returns:
      Date