KeyStoresFactory (Apache Hadoop Common 3.5.0 API)
Description: declaration: package: org.apache.hadoop.security.ssl, interface: KeyStoresFactory

Package org.apache.hadoop.security.ssl

# Interface KeyStoresFactory

All Superinterfaces:
  `Configurable`

All Known Implementing Classes:
  `FileBasedKeyStoresFactory`

@Private @Evolving public interface KeyStoresFactory extends Configurable
Interface that gives access to `KeyManager` and `TrustManager` implementations.

- ## Method Summary

  Modifier and Type
  Method
  Description
  `void`
  `destroy()`
  Releases any resources being used.
  `KeyManager[]`
  `getKeyManagers()`
  Returns the keymanagers for owned certificates.
  `TrustManager[]`
  `getTrustManagers()`
  Returns the trustmanagers for trusted certificates.
  `void`
  `init(SSLFactory.Mode mode)`
  Initializes the keystores of the factory.

  ### Methods inherited from interface org.apache.hadoop.conf.Configurable

  `getConf, setConf`

- ## Method Details

  - ### init

    void init(SSLFactory.Mode mode) throws IOException, GeneralSecurityException
    Initializes the keystores of the factory.
    Parameters:
      `mode` - if the keystores are to be used in client or server mode.
    Throws:
      `IOException` - thrown if the keystores could not be initialized due to an IO error.
      `GeneralSecurityException` - thrown if the keystores could not be initialized due to an security error.

  - ### destroy

    void destroy()
    Releases any resources being used.

  - ### getKeyManagers

    KeyManager[] getKeyManagers()
    Returns the keymanagers for owned certificates.
    Returns:
      the keymanagers for owned certificates.

  - ### getTrustManagers

    TrustManager[] getTrustManagers()
    Returns the trustmanagers for trusted certificates.
    Returns:
      the trustmanagers for trusted certificates.