Home / Class/ OpenSslKeyMaterialManagerTest Class — netty Architecture

OpenSslKeyMaterialManagerTest Class — netty Architecture

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

Entity Profile

Dependency Diagram

graph TD
  a2863871_c384_c4dd_4816_4f88c879c87d["OpenSslKeyMaterialManagerTest"]
  969cc4e3_2f08_ee70_4b56_cdc6493c8226["OpenSslKeyMaterialManagerTest.java"]
  a2863871_c384_c4dd_4816_4f88c879c87d -->|defined in| 969cc4e3_2f08_ee70_4b56_cdc6493c8226
  cfa8910e_7c8f_ec69_e80d_8bb59aefe2f8["testChooseClientAliasReturnsNull()"]
  a2863871_c384_c4dd_4816_4f88c879c87d -->|method| cfa8910e_7c8f_ec69_e80d_8bb59aefe2f8

Relationship Graph

Source Code

handler/src/test/java/io/netty/handler/ssl/OpenSslKeyMaterialManagerTest.java lines 33–86

public class OpenSslKeyMaterialManagerTest {

    @Test
    public void testChooseClientAliasReturnsNull() throws SSLException {
        OpenSsl.ensureAvailability();

        X509ExtendedKeyManager keyManager = new X509ExtendedKeyManager() {
            @Override
            public String[] getClientAliases(String s, Principal[] principals) {
                return EmptyArrays.EMPTY_STRINGS;
            }

            @Override
            public String chooseClientAlias(String[] strings, Principal[] principals, Socket socket) {
                return null;
            }

            @Override
            public String[] getServerAliases(String s, Principal[] principals) {
                return EmptyArrays.EMPTY_STRINGS;
            }

            @Override
            public String chooseServerAlias(String s, Principal[] principals, Socket socket) {
                return null;
            }

            @Override
            public X509Certificate[] getCertificateChain(String s) {
                return EmptyArrays.EMPTY_X509_CERTIFICATES;
            }

            @Override
            public PrivateKey getPrivateKey(String s) {
                return null;
            }
        };

        OpenSslKeyMaterialManager manager = new OpenSslKeyMaterialManager(
                new OpenSslKeyMaterialProvider(keyManager, null) {
            @Override
            OpenSslKeyMaterial chooseKeyMaterial(ByteBufAllocator allocator, String alias) throws Exception {
                fail("Should not be called when alias is null");
                return null;
            }
        }, false);
        SslContext context = SslContextBuilder.forClient().sslProvider(SslProvider.OPENSSL).build();
        OpenSslEngine engine =
                (OpenSslEngine) context.newEngine(UnpooledByteBufAllocator.DEFAULT);
        manager.setKeyMaterialClientSide(engine, EmptyArrays.EMPTY_STRINGS, null);
        ReferenceCountUtil.release(engine);
        ReferenceCountUtil.release(context);
    }
}

Frequently Asked Questions

What is the OpenSslKeyMaterialManagerTest class?
OpenSslKeyMaterialManagerTest is a class in the netty codebase, defined in handler/src/test/java/io/netty/handler/ssl/OpenSslKeyMaterialManagerTest.java.
Where is OpenSslKeyMaterialManagerTest defined?
OpenSslKeyMaterialManagerTest is defined in handler/src/test/java/io/netty/handler/ssl/OpenSslKeyMaterialManagerTest.java at line 33.

Analyze Your Own Codebase

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

Try Supermodel Free