@parmanasystems/crypto 1.69.0 → 1.71.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/README.md +49 -390
  2. package/package.json +3 -3
package/README.md CHANGED
@@ -1,425 +1,84 @@
1
1
  # @parmanasystems/crypto
2
2
 
3
- Cryptographic signing and verification infrastructure for deterministic governance artifacts and execution attestations.
3
+ Ed25519 signing and verification primitives for governance artifacts.
4
4
 
5
5
  [![npm](https://img.shields.io/npm/v/@parmanasystems/crypto)](https://www.npmjs.com/package/@parmanasystems/crypto)
6
6
 
7
7
  ---
8
8
 
9
- # Overview
9
+ ## Overview
10
10
 
11
- `@parmanasystems/crypto` provides the cryptographic trust infrastructure for the Parmana Systems governance ecosystem.
11
+ `@parmanasystems/crypto` provides the low-level cryptographic operations used across the Parmana Systems governance pipeline: signing and verifying bundle manifests, loading trust root keys from disk, and packaging bundles with Ed25519 signatures.
12
12
 
13
- It is responsible for:
14
-
15
- - Ed25519 signing
16
- - deterministic signature verification
17
- - governance trust roots
18
- - bundle signature validation
19
- - execution attestation signing
20
- - runtime provenance verification
21
- - cryptographic governance authority
22
-
23
- All governance trust in Parmana derives from deterministic cryptographic verification.
24
-
25
- Governance decisions are trusted because deterministic artifacts are cryptographically signed and independently verifiable.
13
+ Most applications should use `@parmanasystems/core`. Use this package directly only when building tooling that needs the raw signing primitives — for example, a CI step that signs a bundle before deployment.
26
14
 
27
15
  ---
28
16
 
29
- # Mental Model
30
-
31
- ```txt id="3e9qsu"
32
- Governance Artifact
33
-
34
- Canonical Serialization
35
-
36
- SHA-256 Hash
37
-
38
- Ed25519 Signature
39
-
40
- Portable Verification
41
-
42
- The crypto layer establishes deterministic governance trust boundaries.
43
-
44
- What this package does
45
-
46
- The crypto package provides:
47
-
48
- Ed25519 key management
49
- governance signing infrastructure
50
- deterministic signature verification
51
- governance manifest signing
52
- portable trust validation
53
- cryptographic provenance enforcement
54
- canonical payload signing
55
-
56
- This package is the trust foundation for:
57
-
58
- execution attestations
59
- governance bundles
60
- runtime manifests
61
- deterministic provenance
62
- When to use this package
63
-
64
- Use this package when:
17
+ ## Install
65
18
 
66
- signing governance artifacts
67
- verifying execution attestations
68
- implementing deterministic trust roots
69
- verifying governance provenance
70
- managing Ed25519 governance keys
71
- building custom signing workflows
72
- validating governance signatures
73
-
74
- Do NOT use this package when:
75
-
76
- executing governed decisions
77
- generating governance manifests
78
- deploying HTTP runtimes
79
- performing policy evaluation
80
-
81
- In those cases use:
82
-
83
- Package Responsibility
84
- @parmanasystems/execution governed execution
85
- @parmanasystems/bundle canonical artifacts
86
- @parmanasystems/server deployable runtime
87
- @parmanasystems/core unified governance SDK
88
- Features
89
- Ed25519 signing and verification
90
- Deterministic governance signatures
91
- Canonical payload signing
92
- Governance trust-root infrastructure
93
- Bundle manifest signing
94
- Portable cryptographic verification
95
- Runtime provenance validation
96
- Zero external crypto dependencies
97
- Installation
19
+ ```bash
98
20
  npm install @parmanasystems/crypto
99
- Quick Start
100
- import {
101
- loadPrivateKey,
102
- loadPublicKey,
103
- signPayload,
104
- verifyPayloadSignature,
105
- } from "@parmanasystems/crypto";
106
-
107
- const privateKey =
108
- loadPrivateKey();
109
-
110
- const publicKey =
111
- loadPublicKey();
112
-
113
- const payload = {
114
- policy_id:
115
- "claims-approval",
116
-
117
- policy_version:
118
- "v1",
119
- };
120
-
121
- const signature =
122
- signPayload(
123
- payload,
124
- privateKey
125
- );
126
-
127
- const valid =
128
- verifyPayloadSignature(
129
- payload,
130
- signature,
131
- publicKey
132
- );
133
-
134
- console.log(valid);
135
- Core Concepts
136
- Canonical Signing
137
-
138
- Governance signatures are generated over canonical bytes.
139
-
140
- This is critical.
141
-
142
- The same governance payload must always produce identical serialized bytes before signing.
143
-
144
- Example:
145
-
146
- same payload
147
-
148
- same canonical bytes
149
-
150
- same deterministic hash
151
-
152
- Canonicalization guarantees:
153
-
154
- stable signatures
155
- reproducible provenance
156
- independent verification
157
- deterministic trust validation
158
-
159
- Canonical serialization is provided by:
160
-
161
- @parmanasystems/bundle
162
- Trust Roots
163
-
164
- Governance trust derives from cryptographic trust roots.
165
-
166
- Trust roots include:
167
-
168
- Ed25519 private keys
169
- Ed25519 public keys
170
- immutable verification authority
171
-
172
- Public keys establish portable governance verification authority.
173
-
174
- Independent Verification
175
-
176
- Governance signatures are independently verifiable.
177
-
178
- Any verifier can:
179
-
180
- reconstruct canonical bytes
181
- validate signatures
182
- verify provenance
183
- confirm runtime identity
184
-
185
- Verification does not depend on:
186
-
187
- runtime assumptions
188
- deployment infrastructure
189
- trusted servers
190
- mutable state
191
-
192
- Trust derives from deterministic cryptographic verification, not runtime assumptions.
193
-
194
- Deterministic Provenance
195
-
196
- Signatures bind:
21
+ ```
197
22
 
198
- governance lineage
199
- execution identity
200
- runtime provenance
201
- governance artifacts
202
-
203
- This creates portable deterministic provenance.
204
-
205
- Portable Governance Validation
206
-
207
- Governance artifacts remain verifiable:
208
-
209
- across environments
210
- across deployments
211
- across organizations
212
- across runtime implementations
213
-
214
- This enables:
215
-
216
- independent audits
217
- reproducible verification
218
- portable governance trust
219
- Signing Flow
220
- Governance Artifact
221
-
222
- Canonical Serialization
223
-
224
- SHA-256 Hash
225
-
226
- Ed25519 Signature
227
-
228
- Portable Verification
229
- Key Loading
230
- loadPrivateKey
231
-
232
- Loads Ed25519 private keys.
233
-
234
- import {
235
- loadPrivateKey
236
- } from "@parmanasystems/crypto";
237
-
238
- const privateKey =
239
- loadPrivateKey();
240
-
241
- Default path:
242
-
243
- ./dev-keys/bundle_signing_key
244
- loadPublicKey
245
-
246
- Loads Ed25519 public keys.
247
-
248
- import {
249
- loadPublicKey
250
- } from "@parmanasystems/crypto";
251
-
252
- const publicKey =
253
- loadPublicKey();
254
-
255
- Default path:
256
-
257
- ./dev-keys/bundle_signing_key.pub
258
- Signing APIs
259
- signPayload
260
-
261
- Signs canonical governance payloads.
262
-
263
- import {
264
- signPayload
265
- } from "@parmanasystems/crypto";
266
-
267
- const signature =
268
- signPayload(
269
- payload,
270
- privateKey
271
- );
272
-
273
- Returns:
274
-
275
- base64-encoded Ed25519 signature
276
- signManifest
277
-
278
- Signs governance manifests.
279
-
280
- import {
281
- signManifest
282
- } from "@parmanasystems/crypto";
283
-
284
- const signature =
285
- await signManifest(
286
- "./policies/claims-approval/v1/bundle.manifest.json"
287
- );
288
-
289
- Manifest signatures protect:
290
-
291
- governance lineage
292
- artifact integrity
293
- reproducibility provenance
294
- Verification APIs
295
- verifyPayloadSignature
296
-
297
- Verifies governance payload signatures.
298
-
299
- import {
300
- verifyPayloadSignature
301
- } from "@parmanasystems/crypto";
302
-
303
- const valid =
304
- verifyPayloadSignature(
305
- payload,
306
- signature,
307
- publicKey
308
- );
309
-
310
- Returns:
311
-
312
- boolean verification result
313
- verifySignature
314
-
315
- Verifies governance manifest signatures.
316
-
317
- import {
318
- verifySignature
319
- } from "@parmanasystems/crypto";
320
-
321
- const valid =
322
- await verifySignature(
323
- manifestPath,
324
- signature
325
- );
326
-
327
- Verification checks:
328
-
329
- canonical integrity
330
- signature authenticity
331
- provenance validity
332
- Key Persistence
333
- persistKeys
334
-
335
- Persists governance trust-root keys.
336
-
337
- import {
338
- persistKeys
339
- } from "@parmanasystems/crypto";
340
-
341
- await persistKeys(
342
- privateKey,
343
- publicKey,
344
- "./dev-keys"
345
- );
23
+ ---
346
24
 
347
- Generated files:
25
+ ## Usage
348
26
 
349
- bundle_signing_key
350
- bundle_signing_key.pub
351
- Algorithms
27
+ ```typescript
28
+ import { signBundle, loadPublicKey } from "@parmanasystems/crypto";
29
+ import { LocalSigner } from "@parmanasystems/execution";
30
+ import crypto from "crypto";
352
31
 
353
- The package uses:
32
+ const { privateKey } = crypto.generateKeyPairSync("ed25519", {
33
+ privateKeyEncoding: { type: "pkcs8", format: "pem" },
34
+ publicKeyEncoding: { type: "spki", format: "pem" },
35
+ });
354
36
 
355
- Ed25519
37
+ const signer = new LocalSigner(privateKey);
356
38
 
357
- via Node.js native crypto APIs.
39
+ // Sign a built bundle directory — writes bundle.sig next to bundle.manifest.json
40
+ await signBundle({
41
+ bundlePath: "./dist/bundles/loan-approval",
42
+ signer,
43
+ });
44
+ ```
358
45
 
359
- Formats:
46
+ ### Sign a manifest file directly
360
47
 
361
- Component Format
362
- private keys PKCS8 DER
363
- public keys SPKI DER
364
- signatures base64
48
+ ```typescript
49
+ import { signManifest } from "@parmanasystems/crypto";
365
50
 
366
- No external cryptographic dependencies are required.
51
+ // Reads bundle.manifest.json, canonicalizes, signs with trust root key from disk
52
+ const signature = signManifest("./dist/bundles/loan-approval/bundle.manifest.json");
53
+ console.log(signature); // base64-encoded Ed25519 signature
54
+ ```
367
55
 
368
- AWS KMS Support
56
+ ---
369
57
 
370
- For HSM-backed signing use:
58
+ ## Exports
371
59
 
372
- AwsKmsSigner
60
+ | Export | Description |
61
+ |---|---|
62
+ | `signBundle` | Sign a bundle directory — reads `bundle.manifest.json`, writes `bundle.sig` |
63
+ | `signManifest` | Sign a manifest file using the trust root private key from disk |
64
+ | `loadPrivateKey` | Load the trust root Ed25519 private key PEM from `trust/root.key` |
65
+ | `loadPublicKey` | Load the trust root Ed25519 public key PEM from `trust/root.pub` |
373
66
 
374
- from:
67
+ ---
375
68
 
376
- @parmanasystems/execution
69
+ ## Trust root key location
377
70
 
378
- This enables:
71
+ By default `loadPrivateKey` and `loadPublicKey` read from `trust/root.key` and `trust/root.pub` relative to `process.cwd()`. In production, inject key material via a secrets manager rather than files on disk.
379
72
 
380
- managed signing keys
381
- cloud HSM integration
382
- enterprise key governance
383
- Example Signature Object
384
- {
385
- "signature": "base64-signature",
386
- "algorithm": "Ed25519",
387
- "signed_at": "2026-05-13T10:00:00Z",
388
- "key_id": "runtime-signing-key-v1"
389
- }
390
- Recommended Architecture
391
- Governance Artifact
392
-
393
- Canonical Serialization
394
-
395
- Deterministic Signature
396
-
397
- Portable Verification
398
-
399
- Independent Trust Validation
400
- Relationship to Other Parmana Packages
401
- Package Responsibility
402
- @parmanasystems/bundle canonical bytes
403
- @parmanasystems/crypto signatures and trust
404
- @parmanasystems/execution execution attestations
405
- @parmanasystems/verifier proof validation
406
- @parmanasystems/governance governance lifecycle
407
- Security Model
73
+ ---
408
74
 
409
- The crypto layer guarantees:
75
+ ## Documentation
410
76
 
411
- deterministic signatures
412
- immutable provenance binding
413
- portable verification
414
- independent trust validation
415
- governance authenticity
416
- runtime trust integrity
77
+ Full docs: [parmanasystems.mintlify.app](https://parmanasystems.mintlify.app)
78
+ Package page: [parmanasystems.mintlify.app/packages/crypto](https://parmanasystems.mintlify.app/packages/crypto)
417
79
 
418
- The package is designed so that:
80
+ ---
419
81
 
420
- trust derives from deterministic cryptographic verification, not runtime assumptions
421
- Most Important Principle
422
- Governance decisions are trusted because deterministic artifacts are cryptographically signed and independently verifiable.
423
- License
82
+ ## License
424
83
 
425
- Apache-2.0
84
+ Apache-2.0
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@parmanasystems/crypto",
3
- "version": "1.69.0",
3
+ "version": "1.71.2",
4
4
  "private": false,
5
5
  "type": "module",
6
6
  "scripts": {
@@ -18,7 +18,7 @@
18
18
  ],
19
19
  "sideEffects": false,
20
20
  "dependencies": {
21
- "@parmanasystems/bundle": "^1.69.0"
21
+ "@parmanasystems/bundle": "^1.71.2"
22
22
  },
23
23
  "description": "Signing and verification primitives for deterministic governance infrastructure.",
24
24
  "license": "Apache-2.0",
@@ -26,7 +26,7 @@
26
26
  "type": "git",
27
27
  "url": "https://github.com/pavancharak/parmanasystems-core.git"
28
28
  },
29
- "homepage": "https://github.com/pavancharak/parmanasystems-core",
29
+ "homepage": "https://parmanasystems.mintlify.app",
30
30
  "bugs": {
31
31
  "url": "https://github.com/pavancharak/parmanasystems-core/issues"
32
32
  },