@parmanasystems/crypto 1.56.0 → 1.59.0
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.
- package/README.md +392 -51
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -1,84 +1,425 @@
|
|
|
1
1
|
# @parmanasystems/crypto
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
Cryptographic signing and verification infrastructure for deterministic governance artifacts and execution attestations.
|
|
4
4
|
|
|
5
5
|
[](https://www.npmjs.com/package/@parmanasystems/crypto)
|
|
6
6
|
|
|
7
|
-
|
|
7
|
+
---
|
|
8
8
|
|
|
9
|
-
|
|
9
|
+
# Overview
|
|
10
10
|
|
|
11
|
-
|
|
12
|
-
- Signing canonical payloads (returns base64)
|
|
13
|
-
- Verifying Ed25519 signatures
|
|
14
|
-
- Signing and verifying bundle manifests
|
|
11
|
+
`@parmanasystems/crypto` provides the cryptographic trust infrastructure for the Parmana Systems governance ecosystem.
|
|
15
12
|
|
|
16
|
-
|
|
13
|
+
It is responsible for:
|
|
17
14
|
|
|
18
|
-
|
|
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
|
|
19
22
|
|
|
20
|
-
|
|
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.
|
|
26
|
+
|
|
27
|
+
---
|
|
28
|
+
|
|
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:
|
|
65
|
+
|
|
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
|
|
21
98
|
npm install @parmanasystems/crypto
|
|
22
|
-
|
|
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:
|
|
197
|
+
|
|
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.
|
|
23
336
|
|
|
24
|
-
|
|
337
|
+
import {
|
|
338
|
+
persistKeys
|
|
339
|
+
} from "@parmanasystems/crypto";
|
|
25
340
|
|
|
26
|
-
|
|
341
|
+
await persistKeys(
|
|
342
|
+
privateKey,
|
|
343
|
+
publicKey,
|
|
344
|
+
"./dev-keys"
|
|
345
|
+
);
|
|
27
346
|
|
|
28
|
-
|
|
29
|
-
import { loadPrivateKey, loadPublicKey } from "@parmanasystems/crypto";
|
|
347
|
+
Generated files:
|
|
30
348
|
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
```
|
|
349
|
+
bundle_signing_key
|
|
350
|
+
bundle_signing_key.pub
|
|
351
|
+
Algorithms
|
|
35
352
|
|
|
36
|
-
|
|
353
|
+
The package uses:
|
|
37
354
|
|
|
38
|
-
|
|
39
|
-
import { signManifest } from "@parmanasystems/crypto";
|
|
355
|
+
Ed25519
|
|
40
356
|
|
|
41
|
-
|
|
42
|
-
const signature = await signManifest("./policies/claims-approval/v1/bundle.manifest.json");
|
|
43
|
-
// Returns base64-encoded Ed25519 signature
|
|
44
|
-
```
|
|
357
|
+
via Node.js native crypto APIs.
|
|
45
358
|
|
|
46
|
-
|
|
359
|
+
Formats:
|
|
47
360
|
|
|
48
|
-
|
|
49
|
-
|
|
361
|
+
Component Format
|
|
362
|
+
private keys PKCS8 DER
|
|
363
|
+
public keys SPKI DER
|
|
364
|
+
signatures base64
|
|
50
365
|
|
|
51
|
-
|
|
52
|
-
const ok = await verifySignature(manifestPath, signature);
|
|
366
|
+
No external cryptographic dependencies are required.
|
|
53
367
|
|
|
54
|
-
|
|
55
|
-
const ok = verifyPayloadSignature(payload, signature, publicKey);
|
|
56
|
-
// Returns boolean
|
|
57
|
-
```
|
|
368
|
+
AWS KMS Support
|
|
58
369
|
|
|
59
|
-
|
|
370
|
+
For HSM-backed signing use:
|
|
60
371
|
|
|
61
|
-
|
|
62
|
-
import { persistKeys } from "@parmanasystems/crypto";
|
|
372
|
+
AwsKmsSigner
|
|
63
373
|
|
|
64
|
-
|
|
65
|
-
// Writes bundle_signing_key and bundle_signing_key.pub
|
|
66
|
-
```
|
|
374
|
+
from:
|
|
67
375
|
|
|
68
|
-
|
|
376
|
+
@parmanasystems/execution
|
|
69
377
|
|
|
70
|
-
|
|
378
|
+
This enables:
|
|
71
379
|
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
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
|
|
75
408
|
|
|
76
|
-
|
|
409
|
+
The crypto layer guarantees:
|
|
77
410
|
|
|
78
|
-
|
|
411
|
+
deterministic signatures
|
|
412
|
+
immutable provenance binding
|
|
413
|
+
portable verification
|
|
414
|
+
independent trust validation
|
|
415
|
+
governance authenticity
|
|
416
|
+
runtime trust integrity
|
|
79
417
|
|
|
80
|
-
The
|
|
418
|
+
The package is designed so that:
|
|
81
419
|
|
|
82
|
-
|
|
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
|
|
83
424
|
|
|
84
|
-
Apache-2.0
|
|
425
|
+
Apache-2.0
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@parmanasystems/crypto",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.59.0",
|
|
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.
|
|
21
|
+
"@parmanasystems/bundle": "^1.59.0"
|
|
22
22
|
},
|
|
23
23
|
"description": "Signing and verification primitives for deterministic governance infrastructure.",
|
|
24
24
|
"license": "Apache-2.0",
|