lv.pasts.eme.cert

## Class CertManager

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

-     public final class CertManager
      extends Object

  `CertManager` class provides service to access E-ME certificates.

- - ### Method Summary

    All Methods Static Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `static LinkedHashMap<BigInteger,X509Certificate>` | `getCertificateMap(CertPath certPath, X509Certificate root)` Returns map containing all certificates from the given certification path.
    `static X509Certificate[]` | `search(String cn, String serialNumber, String uid)` Performs a certificate search by the given filter parameters.

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

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

- - ### Method Detail

    - #### getCertificateMap

          public static LinkedHashMap<BigInteger,X509Certificate> getCertificateMap(CertPath certPath,
                                                                                    X509Certificate root)

      Returns map containing all certificates from the given certification path. Each entry contains certificate's serial number as key and the issuer certificate as value.
      Parameters:
        `certPath` - the certification path.
        `root` - the root certificate of the given certification path.
      Returns:
        map containing certificates from the given certification path.

    - #### search

          public static X509Certificate[] search(String cn,
                                                 String serialNumber,
                                                 String uid)
                                          throws NamingException,
                                                 CertificateException

      Performs a certificate search by the given filter parameters.

      For a certificate to be selected, each of the given filter parameters must match the appropriate attribute.

      Each of the filter parameters is optional, but one of them is mandatory for a successful search operation. The format and interpretation of filter parameters follows 'The String Representation of LDAP Search Filters' (RFC 2254).

      Certificates are searched in a LDAP context specified by the EDOC configuration. An EDOC configuration property `ldap.provider.url` identifies the location of the LDAP service.

      Parameters:
        `cn` - filter value for the 'cn' attribute, or `null` if this attribute should be omitted.
        `serialNumber` - filter value for the 'serialNumber' attribute, or `null` if this attribute should be omitted.
        `uid` - filter value for the 'uid' attribute, or `null` if this attribute should be omitted.
      Returns:
        an array of certificates returned by this search operation. If no certificates are found, an empty array is returned.
      Throws:
        `NamingException` - if a naming exception is encountered.
        `CertificateException` - if a certificate parsing exception is encountered.
      Since:
        1.3.2

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