Home / Class/ BoringSSLAsyncPrivateKeyMethodAdapter Class — netty Architecture

BoringSSLAsyncPrivateKeyMethodAdapter Class — netty Architecture

Architecture documentation for the BoringSSLAsyncPrivateKeyMethodAdapter class in QuicheQuicSslContext.java from the netty codebase.

Entity Profile

Dependency Diagram

graph TD
  e322a150_cffc_4949_c14a_562c2b042615["BoringSSLAsyncPrivateKeyMethodAdapter"]
  7b815335_75fd_a659_f30a_67478cd8f044["QuicheQuicSslContext.java"]
  e322a150_cffc_4949_c14a_562c2b042615 -->|defined in| 7b815335_75fd_a659_f30a_67478cd8f044
  d259fbec_d17c_642c_2c9b_3340441ddb81["BoringSSLAsyncPrivateKeyMethodAdapter()"]
  e322a150_cffc_4949_c14a_562c2b042615 -->|method| d259fbec_d17c_642c_2c9b_3340441ddb81
  e80be95f_022b_1884_2065_c0f3a6af29dd["sign()"]
  e322a150_cffc_4949_c14a_562c2b042615 -->|method| e80be95f_022b_1884_2065_c0f3a6af29dd
  7fdf644f_3d9f_4d74_fd9c_d0ada25bda65["decrypt()"]
  e322a150_cffc_4949_c14a_562c2b042615 -->|method| 7fdf644f_3d9f_4d74_fd9c_d0ada25bda65

Relationship Graph

Source Code

codec-classes-quic/src/main/java/io/netty/handler/codec/quic/QuicheQuicSslContext.java lines 594–639

    private static final class BoringSSLAsyncPrivateKeyMethodAdapter implements BoringSSLPrivateKeyMethod {
        private final QuicheQuicSslEngineMap engineMap;
        private final BoringSSLAsyncPrivateKeyMethod privateKeyMethod;

        BoringSSLAsyncPrivateKeyMethodAdapter(QuicheQuicSslEngineMap engineMap,
                                              BoringSSLAsyncPrivateKeyMethod privateKeyMethod) {
            this.engineMap = engineMap;
            this.privateKeyMethod = privateKeyMethod;
        }

        @Override
        public void sign(long ssl, int signatureAlgorithm, byte[] input, BiConsumer<byte[], Throwable> callback) {
            final QuicheQuicSslEngine engine = engineMap.get(ssl);
            if (engine == null) {
                // May be null if it was destroyed in the meantime.
                callback.accept(null, null);
            } else {
                privateKeyMethod.sign(engine, signatureAlgorithm, input).addListener(f -> {
                    Throwable cause = f.cause();
                    if (cause != null) {
                        callback.accept(null, cause);
                    } else {
                        callback.accept((byte[]) f.getNow(), null);
                    }
                });
            }
        }

        @Override
        public void decrypt(long ssl, byte[] input, BiConsumer<byte[], Throwable> callback) {
            final QuicheQuicSslEngine engine = engineMap.get(ssl);
            if (engine == null) {
                // May be null if it was destroyed in the meantime.
                callback.accept(null, null);
            } else {
                privateKeyMethod.decrypt(engine, input).addListener(f -> {
                    Throwable cause = f.cause();
                    if (cause != null) {
                        callback.accept(null, cause);
                    } else {
                        callback.accept((byte[]) f.getNow(), null);
                    }
                });
            }
        }
    }

Frequently Asked Questions

What is the BoringSSLAsyncPrivateKeyMethodAdapter class?
BoringSSLAsyncPrivateKeyMethodAdapter is a class in the netty codebase, defined in codec-classes-quic/src/main/java/io/netty/handler/codec/quic/QuicheQuicSslContext.java.
Where is BoringSSLAsyncPrivateKeyMethodAdapter defined?
BoringSSLAsyncPrivateKeyMethodAdapter is defined in codec-classes-quic/src/main/java/io/netty/handler/codec/quic/QuicheQuicSslContext.java at line 594.

Analyze Your Own Codebase

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

Try Supermodel Free