# ntriver-org/pkeymaster architecture

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

- Interactive diagram: https://gitdiagram.com/ntriver-org/pkeymaster
- Repository: https://github.com/ntriver-org/pkeymaster

## Overview

PKeyMaster is a PowerShell toolkit for Microsoft product-key validation and related licensing tasks. Users launch it from PowerShell or the downloaded command file, then use features for validation, activation and retrieval, key discovery, and configuration-data export. The tree contains a large PKeyConfig collection and a scripts directory, but no source excerpts; component boundaries and links below therefore reflect README-documented capabilities, not inspected implementation calls.

Main entry points: [`PKeyMaster`](https://github.com/ntriver-org/pkeymaster/tree/main/PKeyMaster) (PKeyMaster), [`PKeyMaster/BIN/Scripts`](https://github.com/ntriver-org/pkeymaster/tree/main/PKeyMaster/BIN/Scripts) (Key validation), [`PKeyMaster/BIN/PKeyConfigs`](https://github.com/ntriver-org/pkeymaster/tree/main/PKeyMaster/BIN/PKeyConfigs) (PKeyConfig map)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_validation["Validation"]
  node_toolkit["PKeyMaster"]
  node_key_validation["Key validation"]
  node_config_map[("PKeyConfig map")]
end

subgraph group_licensing["Licensing operations"]
  node_certification["Key certification"]
  node_activation["Key activation"]
  node_redeem["Redeem status"]
  node_mak["MAK count"]
  node_iid["IID generation"]
  node_cid["CID retrieval"]
  node_phone_activation["Phone activation"]
end

subgraph group_retrieval["Key retrieval"]
  node_trusted_store["Trusted store"]
  node_registry["Registry keys"]
  node_msdm["MSDM keys"]
end

subgraph group_data_tools["Data and scanning"]
  node_config_reader["Config reader"]
  node_key_scanner["Key scanner"]
  node_dpid_scanner["Digital ID scanner"]
  node_batch["Batch processing"]
  node_logs["Logs and CSV"]
end

node_user(("User"))
node_slcertify["SLCertifyProduct API"]
node_slactivate["SLActivateProduct API"]
node_olsc["OLSC API"]
node_pidgenx["PidGenX.dll"]
node_batch_api["Batch API"]
node_visual_api["Visual API"]
node_files["Text and binary files"]
node_result["Validation results"]

node_user -->|"runs"| node_toolkit
node_toolkit -->|"validates keys"| node_key_validation
node_key_validation -->|"searches configs"| node_config_map
node_toolkit -->|"checks certification"| node_certification
node_certification -->|"uses API"| node_slcertify
node_toolkit -->|"activates keys"| node_activation
node_activation -->|"uses API"| node_slactivate
node_toolkit -->|"checks redeem status"| node_redeem
node_redeem -->|"uses API"| node_olsc
node_toolkit -->|"retrieves MAK count"| node_mak
node_toolkit -->|"generates IID"| node_iid
node_iid -->|"uses library"| node_pidgenx
node_toolkit -->|"retrieves CID"| node_cid
node_cid -->|"tries first"| node_batch_api
node_cid -->|"falls back"| node_visual_api
node_toolkit -->|"supports phone activation"| node_phone_activation
node_toolkit -->|"retrieves keys"| node_trusted_store
node_toolkit -->|"retrieves keys"| node_registry
node_toolkit -->|"retrieves keys"| node_msdm
node_toolkit -->|"reads and exports"| node_config_reader
node_config_reader -->|"reads configs"| node_config_map
node_toolkit -->|"scans keys"| node_key_scanner
node_key_scanner -->|"searches"| node_files
node_toolkit -->|"scans digital IDs"| node_dpid_scanner
node_dpid_scanner -->|"searches"| node_files
node_toolkit -->|"processes batches"| node_batch
node_batch -->|"validates keys"| node_key_validation
node_batch -->|"processes IIDs"| node_iid
node_toolkit -->|"logs and exports"| node_logs
node_key_validation -->|"produces results"| node_result

click node_toolkit "https://github.com/ntriver-org/pkeymaster/tree/main/PKeyMaster"
click node_key_validation "https://github.com/ntriver-org/pkeymaster/tree/main/PKeyMaster/BIN/Scripts"
click node_config_map "https://github.com/ntriver-org/pkeymaster/tree/main/PKeyMaster/BIN/PKeyConfigs"
click node_certification "https://github.com/ntriver-org/pkeymaster/tree/main/PKeyMaster/BIN/Scripts"
click node_activation "https://github.com/ntriver-org/pkeymaster/tree/main/PKeyMaster/BIN/Scripts"
click node_redeem "https://github.com/ntriver-org/pkeymaster/tree/main/PKeyMaster/BIN/Scripts"
click node_mak "https://github.com/ntriver-org/pkeymaster/tree/main/PKeyMaster/BIN/Scripts"
click node_iid "https://github.com/ntriver-org/pkeymaster/tree/main/PKeyMaster/BIN/Scripts"
click node_cid "https://github.com/ntriver-org/pkeymaster/tree/main/PKeyMaster/BIN/Scripts"
click node_phone_activation "https://github.com/ntriver-org/pkeymaster/tree/main/PKeyMaster/BIN/Scripts"
click node_trusted_store "https://github.com/ntriver-org/pkeymaster/tree/main/PKeyMaster/BIN/Scripts"
click node_registry "https://github.com/ntriver-org/pkeymaster/tree/main/PKeyMaster/BIN/Scripts"
click node_msdm "https://github.com/ntriver-org/pkeymaster/tree/main/PKeyMaster/BIN/Scripts"
click node_config_reader "https://github.com/ntriver-org/pkeymaster/tree/main/PKeyMaster/BIN/Scripts"
click node_key_scanner "https://github.com/ntriver-org/pkeymaster/tree/main/PKeyMaster/BIN/Scripts"
click node_dpid_scanner "https://github.com/ntriver-org/pkeymaster/tree/main/PKeyMaster/BIN/Scripts"
click node_batch "https://github.com/ntriver-org/pkeymaster/tree/main/PKeyMaster/BIN/Scripts"
click node_logs "https://github.com/ntriver-org/pkeymaster/tree/main/PKeyMaster/BIN/Scripts"

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_toolkit,node_key_validation,node_config_map,node_user toneBlue
class node_certification,node_activation,node_redeem,node_mak,node_iid,node_cid,node_phone_activation toneAmber
class node_trusted_store,node_registry,node_msdm,node_slcertify,node_slactivate,node_olsc,node_batch_api,node_visual_api toneMint
class node_config_reader,node_key_scanner,node_dpid_scanner,node_batch,node_logs toneRose
class node_pidgenx,node_files,node_result toneIndigo
```

## Components

### Validation

- [PKeyMaster](https://github.com/ntriver-org/pkeymaster/tree/main/PKeyMaster): `PKeyMaster`
- [Key validation](https://github.com/ntriver-org/pkeymaster/tree/main/PKeyMaster/BIN/Scripts): `PKeyMaster/BIN/Scripts`
- [PKeyConfig map](https://github.com/ntriver-org/pkeymaster/tree/main/PKeyMaster/BIN/PKeyConfigs): `PKeyMaster/BIN/PKeyConfigs`

### Licensing operations

- [Key certification](https://github.com/ntriver-org/pkeymaster/tree/main/PKeyMaster/BIN/Scripts): `PKeyMaster/BIN/Scripts`
- [Key activation](https://github.com/ntriver-org/pkeymaster/tree/main/PKeyMaster/BIN/Scripts): `PKeyMaster/BIN/Scripts`
- [Redeem status](https://github.com/ntriver-org/pkeymaster/tree/main/PKeyMaster/BIN/Scripts): `PKeyMaster/BIN/Scripts`
- [MAK count](https://github.com/ntriver-org/pkeymaster/tree/main/PKeyMaster/BIN/Scripts): `PKeyMaster/BIN/Scripts`
- [IID generation](https://github.com/ntriver-org/pkeymaster/tree/main/PKeyMaster/BIN/Scripts): `PKeyMaster/BIN/Scripts`
- [CID retrieval](https://github.com/ntriver-org/pkeymaster/tree/main/PKeyMaster/BIN/Scripts): `PKeyMaster/BIN/Scripts`
- [Phone activation](https://github.com/ntriver-org/pkeymaster/tree/main/PKeyMaster/BIN/Scripts): `PKeyMaster/BIN/Scripts`

### Key retrieval

- [Trusted store](https://github.com/ntriver-org/pkeymaster/tree/main/PKeyMaster/BIN/Scripts): `PKeyMaster/BIN/Scripts`
- [Registry keys](https://github.com/ntriver-org/pkeymaster/tree/main/PKeyMaster/BIN/Scripts): `PKeyMaster/BIN/Scripts`
- [MSDM keys](https://github.com/ntriver-org/pkeymaster/tree/main/PKeyMaster/BIN/Scripts): `PKeyMaster/BIN/Scripts`

### Data and scanning

- [Config reader](https://github.com/ntriver-org/pkeymaster/tree/main/PKeyMaster/BIN/Scripts): `PKeyMaster/BIN/Scripts`
- [Key scanner](https://github.com/ntriver-org/pkeymaster/tree/main/PKeyMaster/BIN/Scripts): `PKeyMaster/BIN/Scripts`
- [Digital ID scanner](https://github.com/ntriver-org/pkeymaster/tree/main/PKeyMaster/BIN/Scripts): `PKeyMaster/BIN/Scripts`
- [Batch processing](https://github.com/ntriver-org/pkeymaster/tree/main/PKeyMaster/BIN/Scripts): `PKeyMaster/BIN/Scripts`
- [Logs and CSV](https://github.com/ntriver-org/pkeymaster/tree/main/PKeyMaster/BIN/Scripts): `PKeyMaster/BIN/Scripts`

### Other components

- **User**
- **SLCertifyProduct API**
- **SLActivateProduct API**
- **OLSC API**
- **PidGenX.dll**
- **Batch API**
- **Visual API**
- **Text and binary files**
- **Validation results**

## Connections

- User → PKeyMaster: runs (evidence: `README.md`)
- PKeyMaster → Key validation: validates keys (evidence: `README.md`)
- Key validation → PKeyConfig map: searches configs (evidence: `README.md`)
- PKeyMaster → Key certification: checks certification (evidence: `README.md`)
- Key certification → SLCertifyProduct API: uses API (evidence: `README.md`)
- PKeyMaster → Key activation: activates keys (evidence: `README.md`)
- Key activation → SLActivateProduct API: uses API (evidence: `README.md`)
- PKeyMaster → Redeem status: checks redeem status (evidence: `README.md`)
- Redeem status → OLSC API: uses API (evidence: `README.md`)
- PKeyMaster → MAK count: retrieves MAK count (evidence: `README.md`)
- PKeyMaster → IID generation: generates IID (evidence: `README.md`)
- IID generation → PidGenX.dll: uses library (evidence: `README.md`)
- PKeyMaster → CID retrieval: retrieves CID (evidence: `README.md`)
- CID retrieval → Batch API: tries first (evidence: `README.md`)
- CID retrieval → Visual API: falls back (evidence: `README.md`)
- PKeyMaster → Phone activation: supports phone activation (evidence: `README.md`)
- PKeyMaster → Trusted store: retrieves keys (evidence: `README.md`)
- PKeyMaster → Registry keys: retrieves keys (evidence: `README.md`)
- PKeyMaster → MSDM keys: retrieves keys (evidence: `README.md`)
- PKeyMaster → Config reader: reads and exports (evidence: `README.md`)
- Config reader → PKeyConfig map: reads configs (evidence: `README.md`)
- PKeyMaster → Key scanner: scans keys (evidence: `README.md`)
- Key scanner → Text and binary files: searches (evidence: `README.md`)
- PKeyMaster → Digital ID scanner: scans digital IDs (evidence: `README.md`)
- Digital ID scanner → Text and binary files: searches (evidence: `README.md`)
- PKeyMaster → Batch processing: processes batches (evidence: `README.md`)
- Batch processing → Key validation: validates keys (evidence: `README.md`)
- Batch processing → IID generation: processes IIDs (evidence: `README.md`)
- PKeyMaster → Logs and CSV: logs and exports (evidence: `README.md`)
- Key validation → Validation results: produces results (evidence: `README.md`)
