Class RepositoryAIASource

java.lang.Object
eu.europa.esig.dss.spi.x509.aia.RepositoryAIASource
All Implemented Interfaces:
AIASource, Serializable
Direct Known Subclasses:
JdbcCacheAIASource

public abstract class RepositoryAIASource extends Object implements AIASource
Abstract repository AIA source
See Also:
  • Field Details

    • proxiedSource

      protected AIASource proxiedSource
      Data source is used to access certificate tokens that are not present in the repository
  • Constructor Details

    • RepositoryAIASource

      protected RepositoryAIASource()
      Default constructor instantiating object with null proxied source
  • Method Details

    • setProxySource

      public void setProxySource(AIASource proxiedSource)
      Sets a source to access an AIA in case the requested certificates are not present in the repository
      Parameters:
      proxiedSource - AIASource a source to be used to download the data when no relevant certificates is found in the repository
    • getCertificatesByAIA

      public Set<CertificateToken> getCertificatesByAIA(CertificateToken certificateToken)
      Description copied from interface: AIASource
      Loads a set of CertificateTokens accessed by AIA URIs from the provided certificateToken
      Specified by:
      getCertificatesByAIA in interface AIASource
      Parameters:
      certificateToken - CertificateToken to get issuer candidates for
      Returns:
      a set of issuer candidates accessed by AIA URIs
    • getCertificatesByAIA

      public Set<CertificateToken> getCertificatesByAIA(CertificateToken certificateToken, boolean forceRefresh)
      This method allows to populate the source with new AIA certificates obtained from an proxied source, by forcing the refresh
      Parameters:
      certificateToken - CertificateToken to get certificate chain by AIA for
      forceRefresh - defines should the related certificates be refreshed within the source
      Returns:
      a set if CertificateTokens
    • getCertificateTokenAIAUrl

      protected String getCertificateTokenAIAUrl(CertificateToken certificateToken)
      Returns a caIssuers access URL
      Parameters:
      certificateToken - CertificateToken
      Returns:
      String
    • getExistingAIAKeys

      protected abstract List<String> getExistingAIAKeys()
      Returns a list of all existing AIA keys present in the DB
      Returns:
      a list of String AIA keys
    • initCertificateAIAKeys

      protected List<String> initCertificateAIAKeys(List<String> aiaUrls)
      Initialize a list of AIA certificate token keys String from the given urls
      Parameters:
      aiaUrls - a list of String AIA urls
      Returns:
      list of String AIA certificate keys
    • getAIAKey

      protected String getAIAKey(String aiaUrl)
      Creates a key corresponding to the given aiaUrl
      Parameters:
      aiaUrl - String URL
      Returns:
      String key
    • getUniqueCertificateAiaId

      protected String getUniqueCertificateAiaId(CertificateToken certificateToken, String aiaUrl)
      Generates a unique identifier for the CertificateToken and aiaUrl pair
      Parameters:
      certificateToken - CertificateToken
      aiaUrl - String
      Returns:
      String
    • findCertificates

      protected abstract Set<CertificateToken> findCertificates(String key)
      This method returns a set of certificates from a DB with the given key
      Parameters:
      key - String the aiaKey to extract certificates by
      Returns:
      a set of CertificateTokens
    • insertCertificates

      @Deprecated protected abstract void insertCertificates(String aiaKey, Collection<CertificateToken> certificateTokens)
      Deprecated.
      since DSS 5.13. Use #insertCertificate method instead.
      This method allows inserting of a certificate into the DB
      Parameters:
      aiaKey - String AIA key identifying an AIA access URL
      certificateTokens - a collection of CertificateTokens to insert
    • insertCertificate

      protected abstract void insertCertificate(String aiaKey, CertificateToken certificateToken)
      This method allows inserting of a certificate into the DB
      Parameters:
      aiaKey - String AIA key identifying an AIA access URL
      certificateToken - CertificateToken to insert
    • removeCertificates

      protected abstract void removeCertificates(String aiaKey)
      This method removes the certificates from DB with the given aiaKey
      Parameters:
      aiaKey - String representing an AIA URL identifier