# grqz/openssl-dev architecture

> Architecture diagram of the GitHub repository grqz/openssl-dev, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-19). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/grqz/openssl-dev
- Repository: https://github.com/grqz/openssl-dev

## Overview

OpenSSL combines a command-line toolkit, a general-purpose cryptographic library, and TLS/DTLS/QUIC protocol implementations. Users invoke CLI commands for key and certificate work, cryptographic operations, or client/server testing; the toolkit also exposes libraries for standalone use. The graph preserves major documented capabilities and separates TLS handshake, record processing, and QUIC event handling. Edges rely on README statements or shown source references; unsampled implementation detail is represented at subsystem level.

Main entry points: [`apps/openssl.c`](https://github.com/grqz/openssl-dev/blob/master/apps/openssl.c) (openssl commands), [`ssl`](https://github.com/grqz/openssl-dev/tree/master/ssl) (TLS and DTLS), [`crypto`](https://github.com/grqz/openssl-dev/tree/master/crypto) (Cryptographic services), [`apps/req.c`](https://github.com/grqz/openssl-dev/blob/master/apps/req.c) (Certificate operations)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_cli["Command-line toolkit"]
  node_openssl_cli["openssl commands<br/>[openssl.c]"]
  node_key_params["Key parameters<br/>[genpkey.c]"]
  node_cert_ops["Certificate operations<br/>[req.c]"]
  node_digest_encrypt["Digest and encryption<br/>[dgst.c]"]
  node_client_tests["Client tests<br/>[s_client.c]"]
  node_server_tests["Server tests<br/>[s_server.c]"]
  node_mail_ops["S/MIME operations<br/>[smime.c]"]
end

subgraph group_protocols["Secure protocols"]
  node_libssl["TLS and DTLS"]
  node_handshake["Handshake state<br/>[statem_srvr.c]"]
  node_record_layer["Record layer<br/>[rec_layer_s3.c]"]
  node_ech["Encrypted ClientHello<br/>[ech_internal.c]"]
  node_quic["QUIC engine<br/>[quic_engine.c]"]
end

subgraph group_crypto["Cryptographic library"]
  node_libcrypto["Cryptographic services"]
  node_providers["Provider implementations<br/>[defltprov.c]"]
  node_algorithms["Crypto algorithms"]
end

subgraph group_certs["Certificates and formats"]
  node_asn1["ASN.1 encoding"]
  node_x509["X.509 services"]
  node_cms["CMS and S/MIME"]
end

subgraph group_runtime["Shared runtime"]
  node_app_support["CLI support<br/>[apps.c]"]
  node_libctx["Library contexts<br/>[context.c]"]
end

node_user(("User"))

node_user -->|"invokes"| node_openssl_cli
node_openssl_cli -->|"creates parameters"| node_key_params
node_openssl_cli -->|"creates certificates"| node_cert_ops
node_openssl_cli -->|"runs operations"| node_digest_encrypt
node_openssl_cli -->|"runs client tests"| node_client_tests
node_openssl_cli -->|"runs server tests"| node_server_tests
node_openssl_cli -->|"handles mail"| node_mail_ops
node_client_tests -->|"creates SSL connection"| node_libssl
node_libssl -.->|"performs handshake"| node_handshake
node_libssl -.->|"processes records"| node_record_layer
node_libssl -.->|"supports ECH"| node_ech
node_libssl -->|"implements QUIC"| node_quic
node_openssl_cli -->|"uses toolkit library"| node_libcrypto
node_libssl -->|"based on library"| node_libcrypto
node_libcrypto -.->|"provides algorithms"| node_providers
node_libcrypto -.->|"exposes services"| node_algorithms
node_cert_ops -->|"handles certificates"| node_x509
node_cert_ops -.->|"encodes objects"| node_asn1
node_mail_ops -->|"handles messages"| node_cms
node_openssl_cli -.->|"uses shared support"| node_app_support
node_libcrypto -.->|"manages contexts"| node_libctx

click node_openssl_cli "https://github.com/grqz/openssl-dev/blob/master/apps/openssl.c"
click node_key_params "https://github.com/grqz/openssl-dev/blob/master/apps/genpkey.c"
click node_cert_ops "https://github.com/grqz/openssl-dev/blob/master/apps/req.c"
click node_digest_encrypt "https://github.com/grqz/openssl-dev/blob/master/apps/dgst.c"
click node_client_tests "https://github.com/grqz/openssl-dev/blob/master/apps/s_client.c"
click node_server_tests "https://github.com/grqz/openssl-dev/blob/master/apps/s_server.c"
click node_mail_ops "https://github.com/grqz/openssl-dev/blob/master/apps/smime.c"
click node_libssl "https://github.com/grqz/openssl-dev/tree/master/ssl"
click node_handshake "https://github.com/grqz/openssl-dev/blob/master/ssl/statem/statem_srvr.c"
click node_record_layer "https://github.com/grqz/openssl-dev/blob/master/ssl/record/rec_layer_s3.c"
click node_ech "https://github.com/grqz/openssl-dev/blob/master/ssl/ech/ech_internal.c"
click node_quic "https://github.com/grqz/openssl-dev/blob/master/ssl/quic/quic_engine.c"
click node_libcrypto "https://github.com/grqz/openssl-dev/tree/master/crypto"
click node_providers "https://github.com/grqz/openssl-dev/blob/master/providers/defltprov.c"
click node_algorithms "https://github.com/grqz/openssl-dev/tree/master/crypto/evp"
click node_asn1 "https://github.com/grqz/openssl-dev/tree/master/crypto/asn1"
click node_x509 "https://github.com/grqz/openssl-dev/tree/master/crypto/x509"
click node_cms "https://github.com/grqz/openssl-dev/tree/master/crypto/cms"
click node_app_support "https://github.com/grqz/openssl-dev/blob/master/apps/lib/apps.c"
click node_libctx "https://github.com/grqz/openssl-dev/blob/master/crypto/context.c"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_openssl_cli,node_key_params,node_cert_ops,node_digest_encrypt,node_client_tests,node_server_tests,node_mail_ops,node_user toneBlue
class node_libssl,node_handshake,node_record_layer,node_ech,node_quic toneAmber
class node_libcrypto,node_providers,node_algorithms toneMint
class node_asn1,node_x509,node_cms toneRose
class node_app_support,node_libctx toneIndigo
```

## Components

### Command-line toolkit

- [openssl commands](https://github.com/grqz/openssl-dev/blob/master/apps/openssl.c): `apps/openssl.c`
- [Key parameters](https://github.com/grqz/openssl-dev/blob/master/apps/genpkey.c): `apps/genpkey.c`
- [Certificate operations](https://github.com/grqz/openssl-dev/blob/master/apps/req.c): `apps/req.c`
- [Digest and encryption](https://github.com/grqz/openssl-dev/blob/master/apps/dgst.c): `apps/dgst.c`
- [Client tests](https://github.com/grqz/openssl-dev/blob/master/apps/s_client.c): `apps/s_client.c`
- [Server tests](https://github.com/grqz/openssl-dev/blob/master/apps/s_server.c): `apps/s_server.c`
- [S/MIME operations](https://github.com/grqz/openssl-dev/blob/master/apps/smime.c): `apps/smime.c`

### Secure protocols

- [TLS and DTLS](https://github.com/grqz/openssl-dev/tree/master/ssl): `ssl`
- [Handshake state](https://github.com/grqz/openssl-dev/blob/master/ssl/statem/statem_srvr.c): `ssl/statem/statem_srvr.c`
- [Record layer](https://github.com/grqz/openssl-dev/blob/master/ssl/record/rec_layer_s3.c): `ssl/record/rec_layer_s3.c`
- [Encrypted ClientHello](https://github.com/grqz/openssl-dev/blob/master/ssl/ech/ech_internal.c): `ssl/ech/ech_internal.c`
- [QUIC engine](https://github.com/grqz/openssl-dev/blob/master/ssl/quic/quic_engine.c): `ssl/quic/quic_engine.c`

### Cryptographic library

- [Cryptographic services](https://github.com/grqz/openssl-dev/tree/master/crypto): `crypto`
- [Provider implementations](https://github.com/grqz/openssl-dev/blob/master/providers/defltprov.c): `providers/defltprov.c`
- [Crypto algorithms](https://github.com/grqz/openssl-dev/tree/master/crypto/evp): `crypto/evp`

### Certificates and formats

- [ASN.1 encoding](https://github.com/grqz/openssl-dev/tree/master/crypto/asn1): `crypto/asn1`
- [X.509 services](https://github.com/grqz/openssl-dev/tree/master/crypto/x509): `crypto/x509`
- [CMS and S/MIME](https://github.com/grqz/openssl-dev/tree/master/crypto/cms): `crypto/cms`

### Shared runtime

- [CLI support](https://github.com/grqz/openssl-dev/blob/master/apps/lib/apps.c): `apps/lib/apps.c`
- [Library contexts](https://github.com/grqz/openssl-dev/blob/master/crypto/context.c): `crypto/context.c`

### Other components

- **User**

## Connections

- User → openssl commands: invokes (evidence: `README.md`)
- openssl commands → Key parameters: creates parameters (evidence: `README.md`)
- openssl commands → Certificate operations: creates certificates (evidence: `README.md`)
- openssl commands → Digest and encryption: runs operations (evidence: `README.md`)
- openssl commands → Client tests: runs client tests (evidence: `README.md`)
- openssl commands → Server tests: runs server tests (evidence: `README.md`)
- openssl commands → S/MIME operations: handles mail (evidence: `README.md`)
- Client tests → TLS and DTLS: creates SSL connection (evidence: `apps/s_client.c`)
- TLS and DTLS → Handshake state: performs handshake (evidence: `ssl/statem/statem_srvr.c`)
- TLS and DTLS → Record layer: processes records
- TLS and DTLS → Encrypted ClientHello: supports ECH
- TLS and DTLS → QUIC engine: implements QUIC (evidence: `README.md`)
- openssl commands → Cryptographic services: uses toolkit library (evidence: `README.md`)
- TLS and DTLS → Cryptographic services: based on library (evidence: `README.md`)
- Cryptographic services → Provider implementations: provides algorithms
- Cryptographic services → Crypto algorithms: exposes services
- Certificate operations → X.509 services: handles certificates (evidence: `README.md`)
- Certificate operations → ASN.1 encoding: encodes objects
- S/MIME operations → CMS and S/MIME: handles messages (evidence: `README.md`)
- openssl commands → CLI support: uses shared support
- Cryptographic services → Library contexts: manages contexts
