Class SSLContexts

java.lang.Object
net.ygbstudio.powerwp4j.services.SSLContexts

public final class SSLContexts extends Object
Factory for SSLContext instances used by the WordPress client.

Provides helpers for default, custom trust-manager, and trust-store configurations.

Since:
0.1.0
  • Method Details

    • defaultSSLContext

      @NotNull public static @NotNull SSLContext defaultSSLContext()
      Returns a default TLS context with no custom managers.
      Returns:
      default SSLContext
    • withTrustManagers

      @NotNull public static @NotNull SSLContext withTrustManagers(TrustManager[] trustManagers)
      Returns an SSL context using the given trust managers.
      Parameters:
      trustManagers - trust managers to use
      Returns:
      configured SSLContext
      Throws:
      SSLConfigurationException - if the TLS algorithm is unavailable or init fails
    • withTrustStore

      @NotNull public static @NotNull SSLContext withTrustStore(KeyStore keyStore)
      Returns an SSL context initialized from the given trust store.
      Parameters:
      keyStore - trust store containing trusted certificates
      Returns:
      configured SSLContext
      Throws:
      SSLConfigurationException - if the trust store cannot be initialized