Home / Function/ selectMaterial() — netty Function Reference

selectMaterial() — netty Function Reference

Architecture documentation for the selectMaterial() function in BoringSSLCertificateCallback.java from the netty codebase.

Function java Buffer Allocators calls 1 called by 2

Entity Profile

Dependency Diagram

graph TD
  917a7e9a_6d50_2b66_3dc7_6c4921049701["selectMaterial()"]
  0fd0c2dd_82bc_1c80_9d13_1c23c790e939["BoringSSLCertificateCallback"]
  917a7e9a_6d50_2b66_3dc7_6c4921049701 -->|defined in| 0fd0c2dd_82bc_1c80_9d13_1c23c790e939
  59a02504_ab5b_7b5b_8310_539c93c5a317["selectKeyMaterialServerSide()"]
  59a02504_ab5b_7b5b_8310_539c93c5a317 -->|calls| 917a7e9a_6d50_2b66_3dc7_6c4921049701
  252b7f62_56c7_6714_7ef3_718b8db1a936["selectKeyMaterialClientSide()"]
  252b7f62_56c7_6714_7ef3_718b8db1a936 -->|calls| 917a7e9a_6d50_2b66_3dc7_6c4921049701
  2249a005_a520_0ea3_b34b_2249ecad6a65["toPemEncoded()"]
  917a7e9a_6d50_2b66_3dc7_6c4921049701 -->|calls| 2249a005_a520_0ea3_b34b_2249ecad6a65
  style 917a7e9a_6d50_2b66_3dc7_6c4921049701 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

codec-classes-quic/src/main/java/io/netty/handler/codec/quic/BoringSSLCertificateCallback.java lines 193–224

    private long @Nullable [] selectMaterial(long ssl, QuicheQuicSslEngine engine, String alias)  {
        X509Certificate[] certificates = keyManager.getCertificateChain(alias);
        if (certificates == null || certificates.length == 0) {
            return null;
        }
        byte[][] certs = new byte[certificates.length][];

        for (int i = 0; i < certificates.length; i++) {
            try {
                certs[i] = certificates[i].getEncoded();
            } catch (CertificateEncodingException e) {
                return null;
            }
        }

        final long key;
        PrivateKey privateKey = keyManager.getPrivateKey(alias);
        if (privateKey == BoringSSLKeylessPrivateKey.INSTANCE) {
            key = 0;
        } else {
            byte[] pemKey = toPemEncoded(privateKey);
            if (pemKey == null) {
                return null;
            }
            key = BoringSSL.EVP_PKEY_parse(pemKey, password);
        }
        long chain = BoringSSL.CRYPTO_BUFFER_stack_new(ssl, certs);
        engine.setLocalCertificateChain(certificates);

        // Return and signal that the key and chain should be released as well.
        return new long[] { key,  chain };
    }

Domain

Subdomains

Frequently Asked Questions

What does selectMaterial() do?
selectMaterial() is a function in the netty codebase, defined in codec-classes-quic/src/main/java/io/netty/handler/codec/quic/BoringSSLCertificateCallback.java.
Where is selectMaterial() defined?
selectMaterial() is defined in codec-classes-quic/src/main/java/io/netty/handler/codec/quic/BoringSSLCertificateCallback.java at line 193.
What does selectMaterial() call?
selectMaterial() calls 1 function(s): toPemEncoded.
What calls selectMaterial()?
selectMaterial() is called by 2 function(s): selectKeyMaterialClientSide, selectKeyMaterialServerSide.

Analyze Your Own Codebase

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

Try Supermodel Free