Package tigase.io

# Interface CertificateContainerIfc

All Known Implementing Classes:
  `CertificateContainer`

public interface CertificateContainerIfc
Interface implemented by classes responsible for keeping SSL certificates in memory
Created by andrzej on 29.02.2016.

- ## Nested Class Summary

  Nested Classes
  Modifier and Type
  Interface
  Description
  `static final record`
  `CertificateContainerIfc.CertificateEntity`

- ## Field Summary

  Fields
  Modifier and Type
  Field
  Description
  `static final String`
  `CERTIFICATE_CONTAINER_CLASS_KEY`
  `static final String`
  `CERTIFICATE_CONTAINER_CLASS_VAL`

- ## Method Summary

  Modifier and Type
  Method
  Description
  `void`
  `addCertificates(Map<String,String> params)`
  Deprecated.
  `void`
  `addCertificates(CertificateContainerIfc.CertificateEntity certificateEntity)`
  `KeyManager[]`
  `createCertificate(String domain)`
  Method `createCertificate` allows to generate self-signed certificate for passed domain name.s
  `CertificateEntry`
  `getCertificateEntry(String hostname)`
  `String`
  `getDefCertAlias()`
  Method to retrieve default alias of certificate to use when domain is `null`
  `KeyManager[]`
  `getKeyManagers(String domain)`
  Method returns array of `KeyManager` with certificate for domain or `null` if there is no certificate for domain
  `TrustManager[]`
  `getTrustManagers()`
  `KeyStore`
  `getTrustStore()`
  `void`
  `init(Map<String,Object> params)`
  Method used to pass parameters to initialize instance of class

- ## Field Details

  - ### CERTIFICATE_CONTAINER_CLASS_KEY

    static final String CERTIFICATE_CONTAINER_CLASS_KEY
    See Also:
      - Constant Field Values

  - ### CERTIFICATE_CONTAINER_CLASS_VAL

    static final String CERTIFICATE_CONTAINER_CLASS_VAL

- ## Method Details

  - ### addCertificates

    @Deprecated void addCertificates(Map<String,String> params) throws CertificateParsingException
    Deprecated.
    Method `addCertificates` allows to add more certificates at run time after the container has bee already initialized. This is to avoid server restart if there are certificates updates or new certificates for new virtual domain. The method should add new certificates or replace existing one if there is already a certificate for a domain.
    Parameters:
      `params` - a `Map` value with configuration parameters.
    Throws:
      `CertificateParsingException`

  - ### addCertificates

    void addCertificates(CertificateContainerIfc.CertificateEntity certificateEntity) throws CertificateParsingException
    Throws:
      `CertificateParsingException`

  - ### createCertificate

    KeyManager[] createCertificate(String domain) throws NoSuchAlgorithmException, CertificateException, SignatureException, NoSuchProviderException, InvalidKeyException, IOException, UnrecoverableKeyException, KeyStoreException
    Method `createCertificate` allows to generate self-signed certificate for passed domain name.s
    Parameters:
      `domain` - domain for which certificate should be generated
    Returns:
      an array of `KeyManager` containing generated certificate
    Throws:
      `NoSuchAlgorithmException`
      `CertificateException`
      `SignatureException`
      `NoSuchProviderException`
      `InvalidKeyException`
      `IOException`
      `UnrecoverableKeyException`
      `KeyStoreException`

  - ### getDefCertAlias

    String getDefCertAlias()
    Method to retrieve default alias of certificate to use when domain is `null`
    Returns:
      default alias

  - ### getCertificateEntry

    CertificateEntry getCertificateEntry(String hostname)

  - ### getKeyManagers

    KeyManager[] getKeyManagers(String domain)
    Method returns array of `KeyManager` with certificate for domain or `null` if there is no certificate for domain

  - ### getTrustManagers

    TrustManager[] getTrustManagers()

  - ### getTrustStore

    KeyStore getTrustStore()

  - ### init

    void init(Map<String,Object> params)
    Method used to pass parameters to initialize instance of class