Update README.md to provide a comprehensive overview of The Order monorepo, including repository structure, quickstart guide, development workflow, and contribution guidelines.

This commit is contained in:
defiQUG
2025-11-07 22:34:54 -08:00
parent e020318829
commit 4af7580f7a
128 changed files with 4558 additions and 2 deletions

22
packages/crypto/README.md Normal file
View File

@@ -0,0 +1,22 @@
# @the-order/crypto
KMS/HSM client, key management, and signatures for eIDAS/DID.
## Usage
```typescript
import { KMSClient, SignatureService } from '@the-order/crypto';
const kms = new KMSClient(config);
const signatureService = new SignatureService(kms);
const signature = await signatureService.sign(data, options);
```
## Features
- KMS/HSM integration
- Key management
- Digital signatures
- eIDAS/DID support

View File

@@ -0,0 +1,22 @@
{
"name": "@the-order/crypto",
"version": "0.1.0",
"private": true,
"description": "KMS/HSM client, key management, and signatures for eIDAS/DID",
"main": "./src/index.ts",
"types": "./src/index.ts",
"scripts": {
"build": "tsc",
"dev": "tsc --watch",
"lint": "eslint src --ext .ts",
"type-check": "tsc --noEmit"
},
"dependencies": {
"@aws-sdk/client-kms": "^3.490.0"
},
"devDependencies": {
"@types/node": "^20.10.6",
"typescript": "^5.3.3"
}
}

View File

@@ -0,0 +1,7 @@
/**
* The Order Crypto Package
*/
export * from './kms';
export * from './signature';

View File

@@ -0,0 +1,34 @@
/**
* KMS/HSM client for key management
*/
export interface KMSConfig {
provider: 'aws' | 'gcp' | 'azure' | 'hsm';
keyId: string;
region?: string;
}
export class KMSClient {
constructor(private config: KMSConfig) {}
async encrypt(plaintext: Buffer): Promise<Buffer> {
// Implementation for encryption
throw new Error('Not implemented');
}
async decrypt(ciphertext: Buffer): Promise<Buffer> {
// Implementation for decryption
throw new Error('Not implemented');
}
async sign(data: Buffer): Promise<Buffer> {
// Implementation for signing
throw new Error('Not implemented');
}
async verify(data: Buffer, signature: Buffer): Promise<boolean> {
// Implementation for signature verification
throw new Error('Not implemented');
}
}

View File

@@ -0,0 +1,33 @@
/**
* Signature utilities for eIDAS/DID
*/
import { KMSClient } from './kms';
export interface SignatureOptions {
algorithm: 'RS256' | 'ES256' | 'EdDSA';
keyId: string;
}
export class SignatureService {
constructor(private kms: KMSClient) {}
async sign(data: Buffer, options: SignatureOptions): Promise<Buffer> {
return this.kms.sign(data);
}
async verify(
data: Buffer,
signature: Buffer,
options: SignatureOptions
): Promise<boolean> {
return this.kms.verify(data, signature);
}
async signJSON(data: unknown, options: SignatureOptions): Promise<string> {
const jsonString = JSON.stringify(data);
const signature = await this.sign(Buffer.from(jsonString), options);
return signature.toString('base64');
}
}

View File

@@ -0,0 +1,10 @@
{
"extends": "../../tsconfig.base.json",
"compilerOptions": {
"outDir": "./dist",
"rootDir": "./src"
},
"include": ["src/**/*"],
"exclude": ["node_modules", "dist", "**/*.test.ts", "**/*.spec.ts"]
}