Class SignatureCertificateSource

All Implemented Interfaces:
CertificateSource, Serializable
Direct Known Subclasses:
CMSCertificateSource, JAdESCertificateSource, XAdESCertificateSource

public abstract class SignatureCertificateSource extends TokenCertificateSource
The advanced signature contains a list of certificate that was needed to validate the signature. This class is a basic skeleton that is able to retrieve the needed certificate from a list. The child need to retrieve the list of wrapped certificates.
See Also:
  • Field Details

    • candidatesForSigningCertificate

      protected CandidatesForSigningCertificate candidatesForSigningCertificate
      The reference to the object containing all candidates to the signing certificate.
  • Constructor Details

    • SignatureCertificateSource

      protected SignatureCertificateSource()
      Default constructor initializing object with null signing certificate candidates list
  • Method Details

    • getSignedDataCertificates

      public List<CertificateToken> getSignedDataCertificates()
      Retrieves the list of all certificates present in a signed element (i.e. the CMS Signed data (CAdES))
      Returns:
      list of all certificates present in a signed element
    • getKeyInfoCertificates

      public List<CertificateToken> getKeyInfoCertificates()
      Retrieves the list of all certificates present in the KeyInfo element (XAdES) (can be unsigned)
      Returns:
      list of all certificates present in KeyInfo
    • getCertificateValues

      public List<CertificateToken> getCertificateValues()
      Retrieves the list of all certificates from CertificateValues (XAdES/CAdES)
      Returns:
      the list of all certificates present in the CertificateValues
    • getAttrAuthoritiesCertValues

      public List<CertificateToken> getAttrAuthoritiesCertValues()
      Retrieves the list of all certificates from the AttrAuthoritiesCertValues (XAdES)
      Returns:
      the list of all certificates present in the AttrAuthoritiesCertValues
    • getTimeStampValidationDataCertValues

      public List<CertificateToken> getTimeStampValidationDataCertValues()
      Retrieves the list of all certificates from the TimeStampValidationData (XAdES)
      Returns:
      the list of all certificates present in the TimeStampValidationData
    • getDSSDictionaryCertValues

      public List<CertificateToken> getDSSDictionaryCertValues()
      Retrieves the list of all certificates from the DSS dictionary (PAdES)
      Returns:
      the list of all certificates present in the DSS dictionary
    • getVRIDictionaryCertValues

      public List<CertificateToken> getVRIDictionaryCertValues()
      Retrieves the list of all certificates from the VRI dictionary (PAdES)
      Returns:
      the list of all certificates present in the VRI dictionary
    • getSigningCertificateRefs

      public List<CertificateRef> getSigningCertificateRefs()
      Retrieves the list of CertificateRefs for the signing certificate (V1/V2)
      Returns:
      the list of references to the signing certificate
    • getCompleteCertificateRefs

      public List<CertificateRef> getCompleteCertificateRefs()
      Retrieves the list of CertificateRefs included in the attribute complete-certificate-references (CAdES) or the CompleteCertificateRefs/CompleteCertificateRefsV2 (XAdES)
      Returns:
      the list of certificate references
    • getAttributeCertificateRefs

      public List<CertificateRef> getAttributeCertificateRefs()
      Retrieves the list of CertificateRefs included in the attribute attribute-certificate-references (CAdES) or the AttributeCertificateRefs/AttributeCertificateRefsV2 (XAdES)
      Returns:
      the list of certificate references
    • getSigningCertificates

      public Set<CertificateToken> getSigningCertificates()
      Retrieves the Set of CertificateTokens for the signing certificate (V1/V2)
      Returns:
      Set of CertificateTokens
    • getCompleteCertificates

      public Set<CertificateToken> getCompleteCertificates()
      Retrieves the Set of CertificateTokens according references to included in the attribute complete-certificate-references (CAdES) or the CompleteCertificateRefs/CompleteCertificateRefsV2 (XAdES)
      Returns:
      Set of CertificateTokens
    • getAttributeCertificates

      public Set<CertificateToken> getAttributeCertificates()
      Retrieves the Set of CertificateTokens according to references included in the attribute attribute-certificate-references (CAdES) or the AttributeCertificateRefs/AttributeCertificateRefsV2 (XAdES)
      Returns:
      Set of CertificateTokens
    • getCandidatesForSigningCertificate

      public CandidatesForSigningCertificate getCandidatesForSigningCertificate(CertificateSource signingCertificateSource)
      Gets an object containing the signing certificate or information indicating why it is impossible to extract it from the signature. If the signing certificate is identified then it is cached and the subsequent calls to this method will return this cached value. This method never returns null.
      Parameters:
      signingCertificateSource - CertificateSource which allows to resolve the signing certificate from external sources
      Returns:
      CandidatesForSigningCertificate
    • extractCandidatesForSigningCertificate

      protected abstract CandidatesForSigningCertificate extractCandidatesForSigningCertificate(CertificateSource signingCertificateSource)
      Extracts candidates to be a signing certificate from the source
      Parameters:
      signingCertificateSource - CertificateSource which allows to resolve the signing certificate from external sources (optional)
      Returns:
      CandidatesForSigningCertificate
    • getCertificateSourceType

      public CertificateSourceType getCertificateSourceType()
      Description copied from interface: CertificateSource
      This method returns the certificate source type associated to the implementation class.
      Specified by:
      getCertificateSourceType in interface CertificateSource
      Overrides:
      getCertificateSourceType in class CommonCertificateSource
      Returns:
      the certificate origin