Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -138,9 +138,12 @@ console.log(ok); // true
If you want to prove where the data came from, seal the payload before putting it into the trail:

```ts
import { seal } from "json-seal";
import { generateKeyPair, signPayload } from "json-seal";
import { createBlock } from "json-trail";

const { privateKey, publicKey } = await generateKeyPair();

const sealed = await seal({ foo: 123 }, privateKey, publicKey);
const sealed = await signPayload({ foo: 123 }, privateKey, publicKey);

const block = await createBlock(
new TextEncoder().encode(JSON.stringify(sealed))
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "json-trail",
"version": "0.1.0",
"version": "0.1.1",
"author": "Chris Myers <cmyers2015@outlook.com> (https://www.npmjs.com/~cmyers-dev)",
"description": "A lightweight, tamper-evident, hash-linked ledger for JSON or binary payloads, with optional WebCrypto signatures.",
"type": "module",
Expand Down