Home / Class/ SslContextBuilder Class — netty Architecture

SslContextBuilder Class — netty Architecture

Architecture documentation for the SslContextBuilder class in SslContextBuilder.java from the netty codebase.

Entity Profile

Dependency Diagram

graph TD
  10636013_ce26_62a5_2b7d_4d154c756277["SslContextBuilder"]
  fe42d6d4_1e92_1519_b6a5_c3e5074374d6["SslContextBuilder.java"]
  10636013_ce26_62a5_2b7d_4d154c756277 -->|defined in| fe42d6d4_1e92_1519_b6a5_c3e5074374d6
  d33452d4_81ec_21ef_9ee9_11d2322b61b5["SslContextBuilder()"]
  10636013_ce26_62a5_2b7d_4d154c756277 -->|method| d33452d4_81ec_21ef_9ee9_11d2322b61b5
  7689562c_3d47_1921_98c2_527d28519dbe["SslContext()"]
  10636013_ce26_62a5_2b7d_4d154c756277 -->|method| 7689562c_3d47_1921_98c2_527d28519dbe
  42d9286b_7e40_e2b5_6fdb_40690aaf5ec5["toArray()"]
  10636013_ce26_62a5_2b7d_4d154c756277 -->|method| 42d9286b_7e40_e2b5_6fdb_40690aaf5ec5

Relationship Graph

Source Code

handler/src/main/java/io/netty/handler/ssl/SslContextBuilder.java lines 53–697

public final class SslContextBuilder {
    @SuppressWarnings("rawtypes")
    private static final Map.Entry[] EMPTY_ENTRIES = new Map.Entry[0];

    /**
     * Creates a builder for new client-side {@link SslContext}.
     */
    public static SslContextBuilder forClient() {
        return new SslContextBuilder(false);
    }

    /**
     * Creates a builder for new server-side {@link SslContext}.
     *
     * @param keyCertChainFile an X.509 certificate chain file in PEM format
     * @param keyFile a PKCS#8 private key file in PEM format
     * @see #keyManager(File, File)
     */
    public static SslContextBuilder forServer(File keyCertChainFile, File keyFile) {
        return new SslContextBuilder(true).keyManager(keyCertChainFile, keyFile);
    }

    /**
     * Creates a builder for new server-side {@link SslContext}.
     *
     * @param keyCertChainInputStream   an input stream for an X.509 certificate chain in PEM format. The caller is
     *                                  responsible for calling {@link InputStream#close()} after {@link #build()}
     *                                  has been called.
     * @param keyInputStream            an input stream for a PKCS#8 private key in PEM format. The caller is
     *                                  responsible for calling {@link InputStream#close()} after {@link #build()}
     *                                  has been called.
     *
     * @see #keyManager(InputStream, InputStream)
     */
    public static SslContextBuilder forServer(InputStream keyCertChainInputStream, InputStream keyInputStream) {
        return new SslContextBuilder(true).keyManager(keyCertChainInputStream, keyInputStream);
    }

    /**
     * Creates a builder for new server-side {@link SslContext}.
     *
     * @param key a PKCS#8 private key
     * @param keyCertChain the X.509 certificate chain
     * @see #keyManager(PrivateKey, X509Certificate[])
     */
    public static SslContextBuilder forServer(PrivateKey key, X509Certificate... keyCertChain) {
        return new SslContextBuilder(true).keyManager(key, keyCertChain);
    }

    /**
     * Creates a builder for new server-side {@link SslContext}.
     *
     * @param key a PKCS#8 private key
     * @param keyCertChain the X.509 certificate chain
     * @see #keyManager(PrivateKey, X509Certificate[])
     */
    public static SslContextBuilder forServer(PrivateKey key, Iterable<? extends X509Certificate> keyCertChain) {
        return forServer(key, toArray(keyCertChain, EMPTY_X509_CERTIFICATES));
    }

    /**
     * Creates a builder for new server-side {@link SslContext}.
     *
     * @param keyCertChainFile an X.509 certificate chain file in PEM format
     * @param keyFile a PKCS#8 private key file in PEM format
     * @param keyPassword the password of the {@code keyFile}, or {@code null} if it's not
     *     password-protected
     * @see #keyManager(File, File, String)
     */
    public static SslContextBuilder forServer(
            File keyCertChainFile, File keyFile, String keyPassword) {
        return new SslContextBuilder(true).keyManager(keyCertChainFile, keyFile, keyPassword);
    }

    /**
     * Creates a builder for new server-side {@link SslContext}.
     *
     * @param keyCertChainInputStream   an input stream for an X.509 certificate chain in PEM format. The caller is
     *                                  responsible for calling {@link InputStream#close()} after {@link #build()}
     *                                  has been called.
     * @param keyInputStream            an input stream for a PKCS#8 private key in PEM format. The caller is

Frequently Asked Questions

What is the SslContextBuilder class?
SslContextBuilder is a class in the netty codebase, defined in handler/src/main/java/io/netty/handler/ssl/SslContextBuilder.java.
Where is SslContextBuilder defined?
SslContextBuilder is defined in handler/src/main/java/io/netty/handler/ssl/SslContextBuilder.java at line 53.

Analyze Your Own Codebase

Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.

Try Supermodel Free