How elcanion/cornojoblesscertificatemanager works
1. Overall shape
- This is a .NET 8, Windows-only certificate management tool.
- The main shipped experience is a WPF desktop app (CornojoblessCertificateManager.UI), backed by a reusable core library (CornojoblessCertificateManager.Core).
- There is also a console project (CornojoblessCertificateManager.Console), but the README only documents the WPF app, so the console host’s role is not clearly described in the snapshot.
2. Primary architectural boundary
- The code is split into a presentation layer and a certificate-processing layer.
- The UI project handles windows, dialogs, view models, and user interaction.
- The Core project contains the business logic for querying, filtering, backing up, and deleting certificates.
3. Domain model and configuration
- CertificateInfo represents certificate data surfaced to the UI and service layer.
- CertificateSettings maps runtime configuration, including issuer-related filtering rules loaded from appsettings.json.
- This makes issuer filtering configurable without recompiling the app.
4. Certificate query/filter flow
- CertificateQuery is the central query object used to describe what certificates should be listed or acted on.
- The README indicates filtering by issuer, expired certificates, and exportable certificates.
- The architecture suggests the UI builds a query, passes it to the service, and receives a filtered certificate list for display or selection.
5. Action requests
- The Core layer uses explicit request objects for mutating operations:
- CertificateBackupRequest
- CertificateDeleteRequest
- This separates “what the user wants to do” from the service implementation and keeps backup/delete workflows distinct.
6. Service layer
- ICertificateService defines the main contract for certificate operations.
- CertificateService likely orchestrates:
- reading from Windows certificate stores,
- applying filters,
- exporting backup files,
- deleting certificates.
- This is the main application logic boundary between UI and the Windows certificate APIs.
7. Certificate utilities
- CertificateUtils holds shared helper logic around certificate handling.
- In this kind of design, utilities typically support common checks and transformations used by the service and query logic, keeping the service class focused on orchestration.
8. UI composition
- MainWindow.xaml and MainWindowViewModel form the main MVVM entry point.
- RelayCommand provides command binding for user actions such as refresh, backup, delete, and filtering.
- The UI also includes confirmation dialogs:
- DialogConfirmBackup
- DialogConfirmDelete
- These dialogs create an explicit safety boundary before destructive operations.
9. WPF-specific interaction details
- DataGridSelectedItemsBehavior indicates the UI uses a DataGrid and needs multi-selection or selected-item synchronization with the view model.
- This is important for architecture because deletion/backup actions are likely applied to a batch of selected certificates rather than a single item.
10. External system integration
- The app interacts with Windows certificate stores in:
- CurrentUser
- LocalMachine
- Backups are stored under Documents/CertificateBackups.
- The README notes that LocalMachine access may require elevated privileges, and the UI project includes app.manifest for the requested execution level.
11. Safety and destructive-operation design
- Backup is a first-class workflow before deletion, but only for exportable certificates.
- Deletion is intentionally gated by confirmation dialogs.
- The README emphasizes the risk of deleting the wrong certificate; architecturally, that is reflected in the explicit request objects, filtering, and confirmation steps.
12. Testing structure
- The test project is organized around story-based scenarios rather than isolated unit tests only.
- Factories/CertificateFactory.cs provides test data builders.
- Stories/Certificates/CertificateBackup.cs suggests behavior-focused coverage around backup workflows.
- ICertificateStore in the test project indicates the certificate store is abstracted for testability, so certificate I/O can be simulated without touching real Windows stores.
13. Likely end-to-end data flow
- User opens the WPF app → selects filters/settings → MainWindowViewModel builds a CertificateQuery → CertificateService reads certificates from Windows stores → filtered certificates are shown in the grid → user selects items → confirm dialogs appear → service backs up exportable certificates to Documents/CertificateBackups and/or deletes them from CurrentUser or LocalMachine.
14. Diagramming note
- A clear architecture diagram for this repo should show three main boxes:
- WPF UI/MVVM
- Core service/domain layer
- Windows certificate store + backup file system
- The tests should be shown as a separate verification layer around the Core contract, not as part of the runtime path.
Main entry points: MainWindowViewModel.cs Main VM · CertificateService.cs Certificate service · ICertificateService.cs Service contract · CertificateBackup.cs Backup story
Components 21
WPF UI
Desktop presentation and user interaction layer.
- Main window · Primary application window and certificate list surface.
CornojoblessCertificateManager.UI/MainWindow.xaml - Main VM · Builds queries, drives actions, and exposes certificate state to the view.
CornojoblessCertificateManager.UI/ViewModel/MainWindowViewModel.cs - Relay command · Command binding helper for refresh, backup, delete, and filter actions.
CornojoblessCertificateManager.UI/ViewModel/RelayCommand.cs - Backup confirm · Confirmation step before exporting certificates.
CornojoblessCertificateManager.UI/DialogConfirmBackup.xaml - Delete confirm · Confirmation step before deleting certificates.
CornojoblessCertificateManager.UI/DialogConfirmDelete.xaml - Grid selection · Synchronizes selected certificate rows with the view model.
CornojoblessCertificateManager.UI/Behavior/DataGridSelectedItemsBehavior.cs - App settings · Runtime configuration for issuer filtering and other UI-driven settings.
CornojoblessCertificateManager.UI/appsettings.json
Core
Reusable certificate domain and service layer.
- Certificate service · Orchestrates listing, filtering, backup, and delete workflows.
CornojoblessCertificateManager.Core/Services/CertificateService.cs - Service contract · Defines the application boundary for certificate operations.
CornojoblessCertificateManager.Core/Services/ICertificateService.cs - Certificate query · Describes which certificates to list or act on.
CornojoblessCertificateManager.Core/Queries/CertificateQuery.cs - Certificate info · Certificate data surfaced to the UI and service layer.
CornojoblessCertificateManager.Core/Model/CertificateInfo.cs - Certificate settings · Maps runtime settings such as issuer filtering rules.
CornojoblessCertificateManager.Core/Model/CertificateSettings.cs - Backup request · Explicit request object for certificate export workflows.
CornojoblessCertificateManager.Core/Requests/CertificateBackupRequest.cs - Delete request · Explicit request object for certificate deletion workflows.
CornojoblessCertificateManager.Core/Requests/CertificateDeleteRequest.cs - Certificate utils · Shared certificate helper logic used by the service and query flow.
CornojoblessCertificateManager.Core/Utils/CertificateUtils.cs
Tests
Story-based verification around the core contract.
- Test factory · Builds certificate test data for stories and scenarios.
CornojoblessCertificateManager.Tests/Factories/CertificateFactory.cs - Store stub · Abstracts certificate I/O so tests avoid touching real stores.
CornojoblessCertificateManager.Tests/ICertificateStore.cs - Backup story · Behavior-focused coverage for certificate backup workflows.
CornojoblessCertificateManager.Tests/Stories/Certificates/CertificateBackup.cs
External systems
Windows certificate stores and backup file system.
- Windows stores · CurrentUser and LocalMachine certificate stores.
- Backup folder · Documents/CertificateBackups destination for exported certificates.
Other components
- Console host · Alternative executable host; role is not clearly documented in the snapshot.
CornojoblessCertificateManager.Console/Program.cs
Connections 25
- Main window → Main VM: binds to · The window is driven by the main view model.
- Main VM → Relay command: uses · View model exposes actions through commands.
- Main VM → Grid selection: tracks selection · Selected certificate rows are synchronized into the VM.
- Main VM → Service contract: calls · Presentation layer depends on the core service boundary.
- Main VM → Certificate query: builds · User filters are translated into certificate queries.
- Main VM → Backup request: creates · Selected items are packaged for export workflows.
- Main VM → Delete request: creates · Selected items are packaged for deletion workflows.
- Main VM → Backup confirm: confirms · Backup is gated by user confirmation.
- Main VM → Delete confirm: confirms · Deletion is gated by user confirmation.
- Main VM → App settings: reads · UI settings shape filtering and runtime behavior.
- Certificate service → Windows stores: reads from · Service queries certificates from Windows stores.
- Certificate service → Backup folder: writes to · Exported backups are stored on disk.
- Certificate service → Certificate query: applies · Query object drives listing and filtering.
- Certificate service → Backup request: executes · Backup request drives export behavior.
- Certificate service → Delete request: executes · Delete request drives removal behavior.
- Certificate service → Certificate info: returns · Filtered certificate data is surfaced through the domain model.
- Certificate service → Certificate settings: uses · Issuer and related rules are loaded into service logic.
- Certificate service → Certificate utils: delegates to · Shared certificate checks and transformations are centralized here.
- Service contract → Certificate service: implemented by · Concrete orchestration lives in the service implementation.
- App settings → Certificate settings: maps to · UI runtime configuration feeds certificate settings.
- Test factory → Backup story: supports · Shared builders underpin story-based scenarios.
- Store stub → Service contract: mocks boundary · Tests abstract certificate I/O behind a store interface.
- Backup story → Service contract: verifies · Stories exercise the certificate service contract.
- Backup story → Test factory: uses · Scenario tests rely on generated certificate data.
- Certificate service → Store stub: can be isolated by · The service is designed to be testable against an abstract store.