# sahabulh/sandiaca architecture

> Architecture diagram of the GitHub repository sahabulh/sandiaca, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2024-12-26). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/sahabulh/sandiaca
- Repository: https://github.com/sahabulh/sandiaca

## Overview

##### Main Components

a) Certificate Authority (CA) Service
- Primary certificate management system
- Located in the 'ca' directory
- Handles certificate generation and management

b) OCSP Responder Service
- Certificate status verification service
- Located in the 'ocsp_responder' directory
- Provides real-time certificate validation

c) Examples/Utilities
- Certificate bundle generation
- Profile generation
- Located in the 'examples' directory

d) Storage Component
- Temporary storage (non-persistent)
- 'vault' directory for certificate storage

**[Client Applications]**
- ↓
**[Docker Container Environment]**
- [CA Service]
- [Certificate Management]

- [OCSP Responder]
- [Certificate Status Verification]

- [Storage]
- [Vault Directory]

##### Component Relationships

Key interactions:
- CA Service → Storage (certificate writing)
- OCSP Responder → Storage (certificate status reading)
- External Clients → CA Service (certificate requests)
- External Clients → OCSP Responder (status queries)
- Examples → CA Service (bundle generation)

##### Additional Details

a) Technical Specifications:
- Python 3.12 runtime
- Docker containerization
- EVerest and MaEVe file structure compliance

b) Data Flow Annotations:
- Certificate issuance flow
- Status check flow
- Bundle generation flow

##### Implementation Notes

- Use standardized PKI symbols where appropriate
- Notes about the non-persistent nature of storage
- Relationship with EVs@Scale project context

##### Specific Recommendations

- Container boundaries to show Docker isolation
- Interface points for external system integration
- Certificate lifecycle flow

## Diagram (Mermaid)

```mermaid
graph TB
    subgraph Client["Client Applications"]
        ExtClient["External Client Systems"]
    end

    subgraph Docker["Docker Container Environment"]
        subgraph Services["Core Services"]
            CA["Certificate Authority Service"]
            OCSP["OCSP Responder Service"]
            Models["Shared Data Models"]
            Utils["Shared Utilities"]
            Exceptions["Custom Exceptions"]
        end

        subgraph Storage["Storage Layer"]
            Vault["Vault Directory"]:::storage
        end

        subgraph Utils["Utility Components"]
            Bundle["Certificate Bundle Generator"]
            Profile["Profile Generator"]
        end

        subgraph Testing["Testing Components"]
            CATest["CA Service Tests"]
            OCSPTest["OCSP Responder Tests"]
        end
    end

    %% Relationships
    ExtClient --> CA
    ExtClient --> OCSP
    CA --> Vault
    OCSP --> Vault
    Bundle --> CA
    Profile --> CA
    CA --> Models
    OCSP --> Models
    CA --> Utils
    OCSP --> Utils
    CA --> Exceptions
    OCSP --> Exceptions
    CATest --> CA
    OCSPTest --> OCSP

    %% Click Events
    click CA "https://github.com/sahabulh/SandiaCA/blob/main/ca/main.py"
    click CATest "https://github.com/sahabulh/SandiaCA/blob/main/ca/test_ca.py"
    click OCSP "https://github.com/sahabulh/SandiaCA/blob/main/ocsp_responder/main.py"
    click OCSPTest "https://github.com/sahabulh/SandiaCA/blob/main/ocsp_responder/test_ocsp.py"
    click Bundle "https://github.com/sahabulh/SandiaCA/blob/main/examples/generate_bundle.py"
    click Profile "https://github.com/sahabulh/SandiaCA/blob/main/examples/generate_profiles.py"
    click Models "https://github.com/sahabulh/SandiaCA/blob/main/models.py"
    click Utils "https://github.com/sahabulh/SandiaCA/blob/main/utils.py"
    click Exceptions "https://github.com/sahabulh/SandiaCA/blob/main/exceptions.py"
    click Docker "https://github.com/sahabulh/SandiaCA/blob/main/docker-compose.yaml"

    %% Styling
    classDef default fill:#f9f9f9,stroke:#333,stroke-width:2px
    classDef storage fill:#90EE90,stroke:#333
    classDef service fill:#ADD8E6,stroke:#333
    classDef testing fill:#FFB6C1,stroke:#333
    classDef utility fill:#FFE4B5,stroke:#333

    class CA,OCSP service
    class Vault storage
    class Bundle,Profile utility
    class CATest,OCSPTest testing

    %% Legend
    subgraph Legend
        Service["Service Component"]:::service
        StorageComp["Storage Component"]:::storage
        TestComp["Testing Component"]:::testing
        UtilComp["Utility Component"]:::utility
    end
```
