@motebit/verifier 1.2.3 → 1.2.5
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 +12 -5
- package/package.json +5 -4
package/README.md
CHANGED
|
@@ -7,11 +7,18 @@ npm i @motebit/verifier
|
|
|
7
7
|
```
|
|
8
8
|
|
|
9
9
|
```ts
|
|
10
|
-
import {
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
10
|
+
import { verifyArtifact } from "@motebit/verifier";
|
|
11
|
+
|
|
12
|
+
// In-memory / browser: pass the receipt JSON string. (Node convenience:
|
|
13
|
+
// `verifyFile("./receipt.json")` reads the file for you.)
|
|
14
|
+
const result = await verifyArtifact(receiptJson);
|
|
15
|
+
if (result.type === "receipt" && result.valid) {
|
|
16
|
+
// `valid` is integrity (signed + intact) — NOT identity. The binding rung
|
|
17
|
+
// is `result.sovereign`, on this package's result type (not the bare
|
|
18
|
+
// `@motebit/crypto` result). Render the rung, never `valid`, as identity:
|
|
19
|
+
console.log(
|
|
20
|
+
result.sovereign ? "sovereign — author proven offline" : "integrity-only — signer not bound",
|
|
21
|
+
);
|
|
15
22
|
}
|
|
16
23
|
```
|
|
17
24
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@motebit/verifier",
|
|
3
|
-
"version": "1.2.
|
|
3
|
+
"version": "1.2.5",
|
|
4
4
|
"description": "Apache-2.0 library for verifying signed Motebit artifacts (identity files, execution receipts, credentials, presentations) — file-reading and human-formatting helpers on top of @motebit/crypto. The canonical `motebit-verify` CLI now lives at @motebit/verify; this package is the Apache-2.0 library it sits on.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.js",
|
|
@@ -9,7 +9,8 @@
|
|
|
9
9
|
".": {
|
|
10
10
|
"types": "./dist/index.d.ts",
|
|
11
11
|
"default": "./dist/index.js"
|
|
12
|
-
}
|
|
12
|
+
},
|
|
13
|
+
"./package.json": "./package.json"
|
|
13
14
|
},
|
|
14
15
|
"files": [
|
|
15
16
|
"dist/**/*.js",
|
|
@@ -53,8 +54,8 @@
|
|
|
53
54
|
]
|
|
54
55
|
},
|
|
55
56
|
"dependencies": {
|
|
56
|
-
"@motebit/crypto": "3.
|
|
57
|
-
"@motebit/protocol": "3.
|
|
57
|
+
"@motebit/crypto": "3.1.0",
|
|
58
|
+
"@motebit/protocol": "3.1.0"
|
|
58
59
|
},
|
|
59
60
|
"devDependencies": {
|
|
60
61
|
"@noble/ed25519": "~3.1.0",
|