Package eu.europa.esig.dss.diagnostic
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 Summary
Constructors Constructor Description DiagnosticData(XmlDiagnosticData wrapped) -
Method Summary
Modifier and Type Method Description Set<SignatureWrapper>getAllCounterSignatures()This method returns counter-signatures (not signatures)Set<SignatureWrapper>getAllCounterSignaturesForMasterSignature(SignatureWrapper masterSignatureWrapper)Returns a set ofSignatureWrappers for a givenmasterSignatureWrapperList<OrphanCertificateWrapper>getAllOrphanCertificateObjects()Returns a list of all foundOrphanCertificateWrappervaluesList<OrphanTokenWrapper>getAllOrphanCertificateReferences()Returns a list of all found orphan certificate referencesList<OrphanRevocationWrapper>getAllOrphanRevocationObjects()Returns a list of all foundOrphanRevocationWrappervaluesList<OrphanTokenWrapper>getAllOrphanRevocationReferences()Returns a list of all found orphan revocation referencesSet<RevocationWrapper>getAllRevocationData()This method returns all revocation dataSet<SignatureWrapper>getAllSignatures()This method returns signatures (not countersignatures)StringgetCertificateDN(String dssCertificateId)This method returns the subject distinguished name for the given dss certificate identifier.StringgetCertificateIssuerDN(String dssCertificateId)This method returns the issuer distinguished name for the given dss certificate identifier.RevocationReasongetCertificateRevocationReason(String dssCertificateId)This method returns the revocation reason for the given certificate.RevocationTypegetCertificateRevocationSource(String dssCertificateId)This method returns the revocation source for the given certificate.CertificateStatusgetCertificateRevocationStatus(String dssCertificateId)This method returns the revocation status for the given certificate.StringgetCertificateSerialNumber(String dssCertificateId)This method returns the serial number of the given dss certificate identifier.List<CertificateWrapper>getCertificatesFromSource(CertificateSourceType certificateSourceType)Returns a list of certificates by their origin sourceXmlContainerInfogetContainerInfo()ASiCContainerTypegetContainerType()This method returns the container typeList<CertificateWrapper>getCrossCertificates(CertificateWrapper certificate)Returns a list of cross-certificatesStringgetDocumentName()List<CertificateWrapper>getEquivalentCertificates(CertificateWrapper certificate)Returns a list of equivalent certificates (certificates with the same public key)StringgetErrorMessage(String signatureId)This method retrieves the error message for the given signature idStringgetFirstPolicyId()The identifier of the policy of the first signature.DategetFirstSignatureDate()This method returns the first signature time.DigestAlgorithmgetFirstSignatureDigestAlgorithm()This method returns theDigestAlgorithmof the first signature.EncryptionAlgorithmgetFirstSignatureEncryptionAlgorithm()This method returns theEncryptionAlgorithmof the first signature.SignatureLevelgetFirstSignatureFormat()This method returns the signature format for the first signature.StringgetFirstSignatureId()This method returns the first signature id.XmlDiagnosticDatagetJaxbModel()This method returns the JAXB modelCertificateRevocationWrappergetLatestRevocationDataForCertificate(CertificateWrapper certificate)Returns the last actual revocation for the givencertificateList<XmlTrustedList>getListOfTrustedLists()This method returns the JAXB model of the LOTLStringgetMimetypeFileContent()This method returns the content of the mimetype file (if container)List<SignerDataWrapper>getOriginalSignerDocuments()Returns a complete list of original signer documents signed by all signaturesStringgetPolicyDescription(String signatureId)The description of the policy.List<String>getPolicyDocumentationReferences(String signatureId)The documentation references of the policyStringgetPolicyId(String signatureId)The identifier of the policy.RevocationWrappergetRevocationById(String id)ReturnsRevocationWrapperwith the givenidSignatureWrappergetSignatureById(String id)This method returns a signature wrapper for the given signature idList<String>getSignatureCertificateChain(String signatureId)This method returns the list of certificates in the chain of the main signature.DategetSignatureDate(String signatureId)This method returns the claimed signing time.DigestAlgorithmgetSignatureDigestAlgorithm(String signatureId)This method returns theDigestAlgorithmfor the given signature.EncryptionAlgorithmgetSignatureEncryptionAlgorithm(String signatureId)This method returns theDigestAlgorithmfor the given signature.SignatureLevelgetSignatureFormat(String signatureId)This method returns the signature format for the given signature.List<String>getSignatureIdList()This method returns the list of the signature id.MaskGenerationFunctiongetSignatureMaskGenerationFunction(String signatureId)This method returns theMaskGenerationFunctionfor the given signature.List<SignatureWrapper>getSignatures()This method retrieves a list of signature wrappers.List<XmlSignerRole>getSignedAssertions(String signatureId)This method returns the signed assertions for the given signature.List<XmlSignerRole>getSignedAssertionsInFirstSignature()This method returns the signed assertions for the first signature.StringgetSigningCertificateId(String signatureId)This method returns signing certificate dss id for the given signature.TimestampWrappergetTimestampById(String id)Returns the TimestampWrapper corresponding to the given id.List<String>getTimestampIdList()This method returns the list of identifier of the all timestamps found during the validation.List<String>getTimestampIdList(String signatureId)This method returns the list of identifier of the timestamps related to the given signature.List<TimestampWrapper>getTimestampList()This method retrieves a set of timestamp wrappersList<TimestampWrapper>getTimestampList(String signatureId)This method returns the list of timestamps wrappers which covers the given signature.Set<TimestampWrapper>getTimestampSet()This method returns timestampsStringgetTimestampSigningCertificateId(String timestampId)Returns the identifier of the timestamp signing certificate.TimestampTypegetTimestampType(String timestampId)This method returns the timestamp type of the given timestampList<XmlTrustedList>getTrustedLists()This method returns the JAXB model of the used trusted listsCertificateWrappergetUsedCertificateById(String id)This method returns a certificate wrapper for the given certificate idCertificateWrappergetUsedCertificateByIdNullSafe(String id)This method returns a certificate wrapper for the given certificate idList<CertificateWrapper>getUsedCertificates()This method retrieves a list of certificate wrappersDategetValidationDate()StringgetZipComment()This method returns the zip comment (if the document is a container)booleanisALevelTechnicallyValid(String signatureId)Indicates if the -A (-LTA) level is technically valid.booleanisBLevelTechnicallyValid(String signatureId)Indicates if the -B level is technically valid.booleanisContainerInfoPresent()This method checks if the document is a container (ASiC)booleanisMimetypeFilePresent()This method checks if the container has a mimetype filebooleanisSigningCertificateIdentified(String signatureId)This method indicates if the digest value and the issuer and serial match for the signing certificate .booleanisThereALevel(String signatureId)Indicates if there is an archive timestamp.booleanisThereTLevel(String signatureId)Indicates if there is a signature timestamp.booleanisThereXLevel(String signatureId)Indicates if there is an -X1 or -X2 timestamp.booleanisTLevelTechnicallyValid(String signatureId)Indicates if the -T level is technically valid.booleanisValidCertificate(String dssCertificateId)This method indicates if the certificate signature is valid and the revocation status is valid.booleanisXLevelTechnicallyValid(String signatureId)Indicates if the -X level is technically valid.
-
Constructor Details
-
Method Details
-
getDocumentName
-
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
This method returns the first signature id.- Returns:
- the first signature id
-
getFirstSignatureDate
This method returns the first signature time.- Returns:
- the first signature time
-
getSignatureDate
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
This method returns the signature format for the first signature.- Returns:
- The first signature format
-
getSignatureFormat
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
This method returns the signed assertions for the first signature.- Returns:
- list of
XmlSignerRoles
-
getSignedAssertions
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
This method returns theDigestAlgorithmof the first signature.- Returns:
- The
DigestAlgorithmof the first signature
-
getSignatureDigestAlgorithm
This method returns theDigestAlgorithmfor the given signature.- Parameters:
signatureId- The identifier of the signature, for which the algorithm is sought.- Returns:
- The
DigestAlgorithmfor the given signature
-
getFirstSignatureEncryptionAlgorithm
This method returns theEncryptionAlgorithmof the first signature.- Returns:
- The
EncryptionAlgorithmof the first signature
-
getSignatureEncryptionAlgorithm
This method returns theDigestAlgorithmfor the given signature.- Parameters:
signatureId- The identifier of the signature, for which the algorithm is sought.- Returns:
- The
DigestAlgorithmfor the given signature
-
getSignatureMaskGenerationFunction
This method returns theMaskGenerationFunctionfor the given signature.- Parameters:
signatureId- The identifier of the signature, for which the algorithm is sought.- Returns:
- The
MaskGenerationFunctionfor the given signature
-
getSigningCertificateId
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
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
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
The identifier of the policy of the first signature.- Returns:
- the policy identifier of the first signature
-
getPolicyId
The identifier of the policy.- Parameters:
signatureId- The identifier of the signature.- Returns:
- the policy identifier
-
getPolicyDescription
The description of the policy.- Parameters:
signatureId- The identifier of the signature.- Returns:
- the policy description
-
getPolicyDocumentationReferences
The documentation references of the policy- Parameters:
signatureId- The identifier of the signature.- Returns:
- the policy documentation references
-
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
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
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
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
Indicates if there is a signature timestamp.- Parameters:
signatureId- The identifier of the signature.- Returns:
- true if the signature timestamp is present
-
isTLevelTechnicallyValid
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
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
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
Indicates if there is an archive timestamp.- Parameters:
signatureId- The identifier of the signature.- Returns:
- true if the archive timestamp is present
-
isALevelTechnicallyValid
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
-
getTimestampSigningCertificateId
Returns the identifier of the timestamp signing certificate.- Parameters:
timestampId- timestamp id- Returns:
- signing certificate id
-
getTimestampType
This method returns the timestamp type of the given timestamp- Parameters:
timestampId- the timestamp id- Returns:
- the related timestamp type
-
isValidCertificate
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
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
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
This method returns the serial number of the given dss certificate identifier.- Parameters:
dssCertificateId- DSS certificate identifier to be checked- Returns:
- serial number
-
getCertificateRevocationSource
This method returns the revocation source for the given certificate.- Parameters:
dssCertificateId- DSS certificate identifier to be checked- Returns:
- revocation source
-
getCertificateRevocationStatus
This method returns the revocation status for the given certificate.- Parameters:
dssCertificateId- DSS certificate identifier to be checked- Returns:
- certificate status
-
getCertificateRevocationReason
This method returns the revocation reason for the given certificate.- Parameters:
dssCertificateId- DSS certificate identifier to be checked- Returns:
- revocation reason
-
getErrorMessage
This method retrieves the error message for the given signature id- Parameters:
signatureId- the signature id- Returns:
- the error message
-
getSignatureById
This method returns a signature wrapper for the given signature id- Parameters:
id- the signature id- Returns:
- a signature wrapper or null
-
getTimestampById
Returns the TimestampWrapper corresponding to the given id.- Parameters:
id- timestamp id- Returns:
- timestamp wrapper or null
-
getUsedCertificateByIdNullSafe
This method returns a certificate wrapper for the given certificate id- Parameters:
id- the certificate id- Returns:
- a certificate wrapper (or empty object)
-
getUsedCertificateById
This method returns a certificate wrapper for the given certificate id- Parameters:
id- the certificate id- Returns:
- a certificate wrapper or null
-
getCertificatesFromSource
public List<CertificateWrapper> getCertificatesFromSource(CertificateSourceType certificateSourceType)Returns a list of certificates by their origin source- Parameters:
certificateSourceType-CertificateSourceTypeto get certificates with- Returns:
- list of
CertificateWrappers
-
getAllOrphanCertificateObjects
Returns a list of all foundOrphanCertificateWrappervalues- Returns:
- list of
OrphanCertificateWrappers
-
getAllOrphanCertificateReferences
Returns a list of all found orphan certificate references- Returns:
- list of
OrphanTokenWrappers
-
getAllOrphanRevocationObjects
Returns a list of all foundOrphanRevocationWrappervalues- Returns:
- list of
OrphanRevocationWrappers
-
getAllOrphanRevocationReferences
Returns a list of all found orphan revocation references- Returns:
- list of
OrphanTokenWrappers
-
getCrossCertificates
Returns a list of cross-certificates- Parameters:
certificate-CertificateWrapperto find cross certificates for- Returns:
- a list of cross certificate
CertificateWrappers
-
getEquivalentCertificates
Returns a list of equivalent certificates (certificates with the same public key)- Parameters:
certificate-CertificateWrapperto find equivalent certificates for- Returns:
- a list of equivalent certificates
-
getSignatures
This method retrieves a list of signature wrappers.- Returns:
- a list of
SignatureWrappers.
-
getTimestampList
This method retrieves a set of timestamp wrappers- Returns:
- a List of timestamp wrappers
-
getUsedCertificates
This method retrieves a list of certificate wrappers- Returns:
- a list of
CertificateWrappers.
-
getAllSignatures
This method returns signatures (not countersignatures)- Returns:
- a set of SignatureWrapper
-
getAllCounterSignatures
This method returns counter-signatures (not signatures)- Returns:
- a set of SignatureWrapper
-
getAllCounterSignaturesForMasterSignature
public Set<SignatureWrapper> getAllCounterSignaturesForMasterSignature(SignatureWrapper masterSignatureWrapper)Returns a set ofSignatureWrappers for a givenmasterSignatureWrapper- Parameters:
masterSignatureWrapper- -SignatureWrapperto get counter signatures for- Returns:
- set of
SignatureWrappers
-
getTimestampSet
This method returns timestamps- Returns:
- a set of TimestampWrapper
-
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 givencertificate- Parameters:
certificate-CertificateWrapperto find the latest revocation for- Returns:
CertificateRevocationWrapperrevocation
-
getRevocationById
ReturnsRevocationWrapperwith the givenid- Parameters:
id-Stringidentifier to getRevocationWrapperwith- Returns:
RevocationWrapper
-
getOriginalSignerDocuments
Returns a complete list of original signer documents signed by all signatures- Returns:
- list of
SignerDataWrappers
-
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
This method returns the container type- Returns:
- the container type (ASiC-S/E)
-
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
This method returns the content of the mimetype file (if container)- Returns:
- the content of the mimetype file
-
getContainerInfo
-
getTrustedLists
This method returns the JAXB model of the used trusted lists- Returns:
- the JAXB model of the used trusted lists
-
getListOfTrustedLists
This method returns the JAXB model of the LOTL- Returns:
- the JAXB model of the LOTL
-
getValidationDate
-