lv.eparaksts.tsl

## Class TrustedListManager

- java.lang.Object
- - lv.eparaksts.tsl.TrustedListManager

-     public class TrustedListManager
      extends Object

  Provides functionality to handle Trusted Lists of Certification Service Providers.

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `static String` | `EU_LOTL_TERRITORY`
    `static String` | `EU_LOTL_URL`
    `static String` | `EU_TC_LOTL_TERRITORY`
    `static String` | `EU_TC_LOTL_URL`

  - ### Method Summary

    All Methods Static Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `static TrustedListManager` | `getInstance()` Returns a `TrustedListManager` object.
    `Lotl` | `getLotl(LotlId id)`
    `String` | `getTerritoryByUrl(String url)` Returns territory code by the given URL.
    `TrustedList` | `getTerritoryList(String territory)` Returns TrustedList for the given territory.
    `List<TrustedCertificate>` | `getTrustedCertificates()` Returns the avaialble trusted certificates.
    `lv.eparaksts.util.ByteArrayDataSource` | `getTrustedListResource(String url)` Returns TrustedList resource by the given URL.
    `TrustedListResult` | `getTrustedListResult(String territory)`
    `TrustedListResult` | `getTrustedListResult(String territory, Set<LotlId> lotlIdFilter)`
    `static byte[]` | `readTrustedListURL(String url)`
    `boolean` | `update()` Updates the actual Trusted Lists of Certification Service Providers.
    `boolean` | `update(String... territory)`

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Field Detail

    - #### EU_LOTL_TERRITORY

          public static final String EU_LOTL_TERRITORY

      See Also:
        Constant Field Values

    - #### EU_LOTL_URL

          public static final String EU_LOTL_URL

      See Also:
        Constant Field Values

    - #### EU_TC_LOTL_TERRITORY

          public static final String EU_TC_LOTL_TERRITORY

      See Also:
        Constant Field Values

    - #### EU_TC_LOTL_URL

          public static final String EU_TC_LOTL_URL

      See Also:
        Constant Field Values

  - ### Method Detail

    - #### getInstance

          public static TrustedListManager getInstance()

      Returns a `TrustedListManager` object.
      Returns:
        a TrustedListManager object.

    - #### getLotl

          public Lotl getLotl(LotlId id)

    - #### getTerritoryList

          public TrustedList getTerritoryList(String territory)

      Returns TrustedList for the given territory. Use "EU" to get the primary TrustedList.
      Parameters:
        `territory` - code of the territory.
      Returns:
        TrustedList or null, if TrustedList is unavailable.
      See Also:
        `getLotl(LotlId)`, `Lotl.getTerritoryList(String)`

    - #### getTrustedListResult

          public TrustedListResult getTrustedListResult(String territory)

    - #### getTrustedListResult

          public TrustedListResult getTrustedListResult(String territory,
                                                        Set<LotlId> lotlIdFilter)

    - #### update

          public boolean update()
                         throws TrustedListException

      Updates the actual Trusted Lists of Certification Service Providers.
      Returns:
        true on update, false when update is not required.
      Throws:
        `TrustedListException` - if update failed.

    - #### update

          public boolean update(String... territory)
                         throws TrustedListException

      Throws:
        `TrustedListException`

    - #### getTrustedCertificates

          public List<TrustedCertificate> getTrustedCertificates()
                                                          throws TrustedListException

      Returns the avaialble trusted certificates.
      Returns:
        a List containing the available trusted certificates.
      Throws:
        `TrustedListException` - if certificate collection failed.
      See Also:
        `getLotl(LotlId)`, `Lotl.getTrustedCertificates()`

    - #### getTrustedListResource

          public lv.eparaksts.util.ByteArrayDataSource getTrustedListResource(String url)

      Returns TrustedList resource by the given URL. This function is used to support TSL proxy service.
      Parameters:
        `url` - TrustedList resource URL.
      Returns:
        TrustedList resource data or null if URL is unknown.

    - #### getTerritoryByUrl

          public String getTerritoryByUrl(String url)

      Returns territory code by the given URL. This function is used to support TSL proxy service.
      Parameters:
        `url` - TrustedList resource URL.
      Returns:
        territory code or null if URL is unknown.

    - #### readTrustedListURL

          public static byte[] readTrustedListURL(String url)
                                           throws Exception

      Throws:
        `Exception`

Copyright VAS Latvijas Valsts radio un televizijas centrs / Developed by SIA EUSO