lv.pasts.eme.cert

## Class TrustedCertificate

- java.lang.Object
- - lv.pasts.eme.cert.TrustedCertificate

- All Implemented Interfaces:
    Serializable

      public class TrustedCertificate
      extends Object
      implements Serializable

  `TrustedCertificate` class represents the trusted certificate.
  See Also:
    Serialized Form

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `TrustedCertificate(X509Certificate certificate, String thumbprintSHA1)`

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `addService(TrustedListService service)` Add associated trusted list service.
    `void` | `addServices(List<TrustedListService> list)` Add associated trusted list services.
    `void` | `checkValidity(Date validationDate)`
    `X509Certificate` | `getCertificate()` Returns the trusted certificate.
    `List<TrustedListService>` | `getServices()` Returns the associated services, if the certificate is part of the trusted list.
    `String` | `getThumbprintSHA1()` Returns SHA-1 thumbprint of the trusted certificate.
    `TrustedListService` | `getTrustedListService(String type, Date date)`
    `boolean` | `hasTrustedListServices()` Returns true, if the certificate is part of the trusted list.

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

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

- - ### Constructor Detail

    - #### TrustedCertificate

          public TrustedCertificate(X509Certificate certificate,
                                    String thumbprintSHA1)

  - ### Method Detail

    - #### getCertificate

          public X509Certificate getCertificate()

      Returns the trusted certificate.
      Returns:
        X509Certificate.

    - #### getThumbprintSHA1

          public String getThumbprintSHA1()

      Returns SHA-1 thumbprint of the trusted certificate.
      Returns:
        SHA-1 thumbprint.

    - #### getServices

          public List<TrustedListService> getServices()

      Returns the associated services, if the certificate is part of the trusted list. If the trusted services are available, certificate status is provided by the service.
      Returns:
        the associated services.

    - #### addService

          public void addService(TrustedListService service)

      Add associated trusted list service.
      Parameters:
        `service` - the associated service.

    - #### addServices

          public void addServices(List<TrustedListService> list)

      Add associated trusted list services.
      Parameters:
        `list` - the associated services.

    - #### hasTrustedListServices

          public boolean hasTrustedListServices()

      Returns true, if the certificate is part of the trusted list.
      Returns:
        true, if the certificate is part of the trusted list.

    - #### getTrustedListService

          public TrustedListService getTrustedListService(String type,
                                                          Date date)

    - #### checkValidity

          public void checkValidity(Date validationDate)
                             throws CertValidatorException

      Throws:
        `CertValidatorException`

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