Skip to content

@TechUI/Prime-Keychain Introduction

TechUI Prime Keychain is the critical encryption component in the TechUI Prime flagship security system and a necessary runtime dependency for Prime.

If @techui/prime is a sophisticated bank vault, then your License Key is the first key, and @techui/prime-keychain holds the second key kept by the bank. Both must be present simultaneously for the core engine to pass two-factor authentication and unlock full functionality.

One-sentence summary: It is the "Public Key Warehouse" of the Prime edition and the physical carrier that activates the heavy licensing mechanism.

Core Positioning

In TechUI's Heavy License mechanism, prime-keychain plays an indispensable role. It is not a UI component library and contains no visible interface elements; it does only one thing: provide the decryption context for the Wasm core.

  • 🔒 Security Cornerstone: It contains obfuscated public key fragments and seed data required for verification algorithms.
  • 🔗 Mandatory Dependency: It is a Peer Dependency of @techui/prime. If this package is not installed, Prime cannot complete initialization verification and will automatically downgrade to Trial Mode.
  • 📦 Version Binding: It is tightly linked to the Prime version, updating alongside the component library to ensure the timeliness of encryption algorithms.

Two-Factor Decryption

TechUI Prime adopts a financial-grade Two-Factor Decryption Mechanism. prime-keychain collaborates with the Client Key in your hand during this process to form a closed loop.

The following is the internal seven-step process during Wasm engine initialization, demonstrating the timing of prime-keychain's role:

  1. Extract Fingerprint: The Wasm engine first reads the Client Key (private credential) you passed in and extracts the Key ID.
  2. Locate Public Key (Critical Step) 🎯: Based on the ID, the engine looks up the matching Npm Key in the memory segment of @techui/prime-keychain.
  3. Layer 1 Decryption: Wasm performs bootstrap decryption on the Npm Key to obtain the "private key seed" for decryption.
  4. Identity Unlock: Uses the "private key seed" to decrypt your Client Key and verify signature legitimacy.
  5. Basic Info Extraction: Retrieves basic metadata of the license (such as company name, region).
  6. Layer 2 Decryption: Combining the above results, decrypts the Config Parameter Key (Config Key) to obtain detailed feature toggles.
  7. Final Validation: Outputs the final Boolean verification result to decide whether to proceed.

In other words: The lock opens only when your Client Key and the public key in prime-keychain match perfectly.

Installation and Integration

Due to its special nature, you usually do not need to explicitly call its API in your code; simply ensure it exists in the project dependencies.

Installation Commands

bash
# npm
npm install @techui/prime-keychain

# yarn
yarn add @techui/prime-keychain

# pnpm
pnpm add @techui/prime-keychain

Project Integration

Please refer to the Prime-Configuring License chapter for integration and configuration.

Released under the MIT License.