Home / Function/ getCertificatesFromBuffers() — netty Function Reference

getCertificatesFromBuffers() — netty Function Reference

Architecture documentation for the getCertificatesFromBuffers() function in SslContext.java from the netty codebase.

Entity Profile

Dependency Diagram

graph TD
  4bd8cba6_cfe4_ea07_32d2_6aa94d2cbc4c["getCertificatesFromBuffers()"]
  ec56e535_0508_8846_8172_a704185d370e["SslContext"]
  4bd8cba6_cfe4_ea07_32d2_6aa94d2cbc4c -->|defined in| ec56e535_0508_8846_8172_a704185d370e
  7f8bd12b_fa05_c7e2_d72f_dab4e02c22e7["toX509Certificates()"]
  7f8bd12b_fa05_c7e2_d72f_dab4e02c22e7 -->|calls| 4bd8cba6_cfe4_ea07_32d2_6aa94d2cbc4c
  style 4bd8cba6_cfe4_ea07_32d2_6aa94d2cbc4c fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

handler/src/main/java/io/netty/handler/ssl/SslContext.java lines 1286–1305

    private static X509Certificate[] getCertificatesFromBuffers(ByteBuf[] certs) throws CertificateException {
        CertificateFactory cf = CertificateFactory.getInstance("X.509");
        X509Certificate[] x509Certs = new X509Certificate[certs.length];

        try {
            for (int i = 0; i < certs.length; i++) {
                try (InputStream is = new ByteBufInputStream(certs[i], false)) {
                    x509Certs[i] = (X509Certificate) cf.generateCertificate(is);
                } catch (IOException e) {
                    // This is not expected to happen, but re-throw in case it does.
                    throw new RuntimeException(e);
                }
            }
        } finally {
            for (ByteBuf buf: certs) {
                buf.release();
            }
        }
        return x509Certs;
    }

Domain

Subdomains

Frequently Asked Questions

What does getCertificatesFromBuffers() do?
getCertificatesFromBuffers() is a function in the netty codebase, defined in handler/src/main/java/io/netty/handler/ssl/SslContext.java.
Where is getCertificatesFromBuffers() defined?
getCertificatesFromBuffers() is defined in handler/src/main/java/io/netty/handler/ssl/SslContext.java at line 1286.
What calls getCertificatesFromBuffers()?
getCertificatesFromBuffers() is called by 1 function(s): toX509Certificates.

Analyze Your Own Codebase

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

Try Supermodel Free