Home / Function/ testAlgorithmSupport() — netty Function Reference

testAlgorithmSupport() — netty Function Reference

Architecture documentation for the testAlgorithmSupport() function in JdkDelegatingPrivateKeyMethodTest.java from the netty codebase.

Entity Profile

Dependency Diagram

graph TD
  4a2d9bb8_8e89_f8a6_4ddb_3c1163dd54fe["testAlgorithmSupport()"]
  2ac7122d_91ea_6ce8_76a0_fb9ed7fcbdbc["JdkDelegatingPrivateKeyMethodTest"]
  4a2d9bb8_8e89_f8a6_4ddb_3c1163dd54fe -->|defined in| 2ac7122d_91ea_6ce8_76a0_fb9ed7fcbdbc
  5a3245c2_68b7_f5a4_493d_f9902be0f416["configureCipherSuitesForAlgorithm()"]
  4a2d9bb8_8e89_f8a6_4ddb_3c1163dd54fe -->|calls| 5a3245c2_68b7_f5a4_493d_f9902be0f416
  style 4a2d9bb8_8e89_f8a6_4ddb_3c1163dd54fe fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

handler/src/test/java/io/netty/handler/ssl/JdkDelegatingPrivateKeyMethodTest.java lines 238–290

    @ParameterizedTest
    @MethodSource("supportedAlgorithms")
    void testAlgorithmSupport(String description, int opensslAlgorithm,
                              CertificateBuilder.Algorithm algorithm, boolean clientUsesProvider) throws Exception {
        // Generate certificate with matching key type
        X509Bundle certKeyPair = generateCertificateForAlgorithm(algorithm);
        PrivateKey wrappedKey = wrapPrivateKey(certKeyPair.getKeyPair().getPrivate());
        assertNull(wrappedKey.getEncoded(), "Alternative key should return null from getEncoded()");

        // Reset signature operation counter
        MockAlternativeKeyProvider.resetSignatureOperationCount();

        // Configure SSL contexts with algorithm-specific settings
        SslContextBuilder serverBuilder;
        SslContextBuilder clientBuilder;

        if (clientUsesProvider) {
            serverBuilder = SslContextBuilder.forServer(certKeyPair.getKeyPair().getPrivate(),
                            certKeyPair.getCertificate())
                    .sslProvider(SslProvider.OPENSSL)
                    .trustManager(certKeyPair.getCertificate())
                    .clientAuth(ClientAuth.REQUIRE);

            clientBuilder = SslContextBuilder.forClient()
                    .sslProvider(SslProvider.OPENSSL)
                    .option(OpenSslContextOption.USE_JDK_PROVIDER_SIGNATURES, true)
                    .keyManager(wrappedKey, "", certKeyPair.getCertificate())
                    .trustManager(certKeyPair.getCertificate());
        } else {
            serverBuilder = SslContextBuilder.forServer(wrappedKey, certKeyPair.getCertificate())
                    .sslProvider(SslProvider.OPENSSL)
                    .option(OpenSslContextOption.USE_JDK_PROVIDER_SIGNATURES, true);

            clientBuilder = SslContextBuilder.forClient()
                    .sslProvider(SslProvider.OPENSSL)
                    .trustManager(certKeyPair.getCertificate());
        }

        configureCipherSuitesForAlgorithm(serverBuilder, clientBuilder, opensslAlgorithm);

        SslContext serverContext = serverBuilder.build();
        SslContext clientContext = clientBuilder.build();

        String result = performHandshakeTest(serverContext, clientContext);
        assertEquals("R", result, "Handshake should complete successfully for " + description);

        int signatureOperations = MockAlternativeKeyProvider.getSignatureOperationCount();
        assertTrue(signatureOperations > 0,
            "Expected signature operations to be recorded for " + description + ", got: " + signatureOperations);

        ReferenceCountUtil.release(serverContext);
        ReferenceCountUtil.release(clientContext);
    }

Domain

Subdomains

Frequently Asked Questions

What does testAlgorithmSupport() do?
testAlgorithmSupport() is a function in the netty codebase, defined in handler/src/test/java/io/netty/handler/ssl/JdkDelegatingPrivateKeyMethodTest.java.
Where is testAlgorithmSupport() defined?
testAlgorithmSupport() is defined in handler/src/test/java/io/netty/handler/ssl/JdkDelegatingPrivateKeyMethodTest.java at line 238.
What does testAlgorithmSupport() call?
testAlgorithmSupport() calls 1 function(s): configureCipherSuitesForAlgorithm.

Analyze Your Own Codebase

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

Try Supermodel Free