Home / Function/ testPrivateKeyMethodFails() — netty Function Reference

testPrivateKeyMethodFails() — netty Function Reference

Architecture documentation for the testPrivateKeyMethodFails() function in OpenSslPrivateKeyMethodTest.java from the netty codebase.

Function java Buffer Allocators calls 3 called by 2

Entity Profile

Dependency Diagram

graph TD
  b15a5bb7_43a2_d1ed_9d3b_43d37b8d6f4b["testPrivateKeyMethodFails()"]
  e0537394_11f7_7d84_df6a_7390455b871b["OpenSslPrivateKeyMethodTest"]
  b15a5bb7_43a2_d1ed_9d3b_43d37b8d6f4b -->|defined in| e0537394_11f7_7d84_df6a_7390455b871b
  d2dcb905_2bba_58af_197e_780aa47b24bb["testPrivateKeyMethodFailsBecauseOfException()"]
  d2dcb905_2bba_58af_197e_780aa47b24bb -->|calls| b15a5bb7_43a2_d1ed_9d3b_43d37b8d6f4b
  b93182f7_a6b7_e2b3_fcbd_335ce31834cf["testPrivateKeyMethodFailsBecauseOfNull()"]
  b93182f7_a6b7_e2b3_fcbd_335ce31834cf -->|calls| b15a5bb7_43a2_d1ed_9d3b_43d37b8d6f4b
  1558c9b0_1905_5fc4_ab74_483e05181c96["sign()"]
  b15a5bb7_43a2_d1ed_9d3b_43d37b8d6f4b -->|calls| 1558c9b0_1905_5fc4_ab74_483e05181c96
  1dd89d03_8a52_ce64_f8f1_14c4530dada0["assertThread()"]
  b15a5bb7_43a2_d1ed_9d3b_43d37b8d6f4b -->|calls| 1dd89d03_8a52_ce64_f8f1_14c4530dada0
  64891399_7257_b41d_2d83_0a7379197ce0["decrypt()"]
  b15a5bb7_43a2_d1ed_9d3b_43d37b8d6f4b -->|calls| 64891399_7257_b41d_2d83_0a7379197ce0
  style b15a5bb7_43a2_d1ed_9d3b_43d37b8d6f4b fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

handler/src/test/java/io/netty/handler/ssl/OpenSslPrivateKeyMethodTest.java lines 342–390

    private void testPrivateKeyMethodFails(final boolean delegate, final boolean returnNull) throws Exception {
        final SslContext sslServerContext = buildServerContext(new OpenSslPrivateKeyMethod() {
            @Override
            public byte[] sign(SSLEngine engine, int signatureAlgorithm, byte[] input) throws Exception {
                assertThread(delegate);
                if (returnNull) {
                    return null;
                }
                throw new SignatureException();
            }

            @Override
            public byte[] decrypt(SSLEngine engine, byte[] input) {
                throw new UnsupportedOperationException();
            }
        });
        final SslContext sslClientContext = buildClientContext();

        SslHandler serverSslHandler = newSslHandler(
                sslServerContext, UnpooledByteBufAllocator.DEFAULT, delegateExecutor(delegate));
        SslHandler clientSslHandler = newSslHandler(
                sslClientContext, UnpooledByteBufAllocator.DEFAULT, delegateExecutor(delegate));

        try {
            try {
                LocalAddress address = new LocalAddress("test-" + SslProvider.OPENSSL
                        + '-' + SslProvider.JDK + '-' + RFC_CIPHER_NAME + '-' + delegate);

                Channel server = server(address, serverSslHandler);
                try {
                    Channel client = client(server, clientSslHandler);
                    try {
                        Throwable clientCause = clientSslHandler.handshakeFuture().await().cause();
                        Throwable serverCause = serverSslHandler.handshakeFuture().await().cause();
                        assertNotNull(clientCause);
                        assertInstanceOf(SSLHandshakeException.class, serverCause);
                    } finally {
                        client.close().sync();
                    }
                } finally {
                    server.close().sync();
                }
            } finally {
                ReferenceCountUtil.release(sslClientContext);
            }
        } finally {
            ReferenceCountUtil.release(sslServerContext);
        }
    }

Domain

Subdomains

Frequently Asked Questions

What does testPrivateKeyMethodFails() do?
testPrivateKeyMethodFails() is a function in the netty codebase, defined in handler/src/test/java/io/netty/handler/ssl/OpenSslPrivateKeyMethodTest.java.
Where is testPrivateKeyMethodFails() defined?
testPrivateKeyMethodFails() is defined in handler/src/test/java/io/netty/handler/ssl/OpenSslPrivateKeyMethodTest.java at line 342.
What does testPrivateKeyMethodFails() call?
testPrivateKeyMethodFails() calls 3 function(s): assertThread, decrypt, sign.
What calls testPrivateKeyMethodFails()?
testPrivateKeyMethodFails() is called by 2 function(s): testPrivateKeyMethodFailsBecauseOfException, testPrivateKeyMethodFailsBecauseOfNull.

Analyze Your Own Codebase

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

Try Supermodel Free