rootcard 0.0.0-stage → 0.1.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/CHANGELOG.md +15 -0
- package/LICENSE +21 -0
- package/README.md +23 -2
- package/keytool.html +3106 -0
- package/package.json +42 -4
- package/src/account.js +89 -0
- package/src/argon2.js +239 -0
- package/src/blake2b.js +120 -0
- package/src/crypto.js +186 -0
- package/src/encoding.js +145 -0
- package/src/errors.js +38 -0
- package/src/file.js +118 -0
- package/src/id.js +107 -0
- package/src/index.js +33 -0
- package/src/json.js +280 -0
- package/src/keys.js +134 -0
- package/src/labels.js +17 -0
- package/src/log.js +316 -0
- package/src/messages.js +82 -0
- package/src/profile.js +89 -0
- package/src/proof.js +66 -0
- package/src/recovery.js +49 -0
- package/src/testing.js +34 -0
- package/src/vault-index.js +9 -0
- package/src/vault.js +294 -0
- package/src/vaultcheck.js +180 -0
package/CHANGELOG.md
ADDED
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
# Changelog: rootcard (npm)
|
|
2
|
+
|
|
3
|
+
All notable changes to this package are recorded here.
|
|
4
|
+
|
|
5
|
+
## Unreleased
|
|
6
|
+
|
|
7
|
+
## 0.1.0 - 2026-11-04
|
|
8
|
+
|
|
9
|
+
- First release of the JavaScript implementation of format version 1, byte for byte equal to the Rust crate on every
|
|
10
|
+
shared vector. Zero dependencies; WebCrypto for Ed25519, X25519, SHA-256, HKDF and AES-GCM; its own BLAKE2b and
|
|
11
|
+
Argon2id (RFC 9106).
|
|
12
|
+
- `rootcard`: verification (JSON, encodings, keys, recovery keys, identities, logs, vault and profile checks,
|
|
13
|
+
messages, proofs, account files, cards). `rootcard/vault`: password locks, vault encryption, registration, password
|
|
14
|
+
change, new instances and rotation. `rootcard/testing`: the deterministic stream of the vectors.
|
|
15
|
+
- `keytool.html`: the standalone key tool page, works from `file://`.
|
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Hexagon and the rootcard contributors
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
CHANGED
|
@@ -1,3 +1,24 @@
|
|
|
1
|
-
#
|
|
1
|
+
# rootcard (npm)
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
[rootcard](https://github.com/Hexagon/rootcard) in plain ES modules: a portable, self-certifying identity for online
|
|
4
|
+
logins. Zero dependencies, no build step, WebCrypto only; runs in browsers and Node 20 or later. It produces and checks
|
|
5
|
+
exactly the bytes of the Rust crate `rootcard`; both are tested against the shared vectors of the specification.
|
|
6
|
+
|
|
7
|
+
```js
|
|
8
|
+
import { verifyLog, verifyProof } from "rootcard"; // verification: hosts, relying parties, clients
|
|
9
|
+
import { register, unlockVault, changePassword } from "rootcard/vault"; // passwords, Argon2id, vault encryption
|
|
10
|
+
|
|
11
|
+
const state = await verifyLog(events, { realms: ["global"], now: Math.floor(Date.now() / 1000) });
|
|
12
|
+
```
|
|
13
|
+
|
|
14
|
+
- `rootcard` is the verification core: canonical JSON, keys, recovery keys, identities and handles, logs
|
|
15
|
+
(`verifyLog`, `extendLog`, `compareLogs`), vault and profile checks, login and fetch messages, proofs, account files
|
|
16
|
+
and recovery cards.
|
|
17
|
+
- `rootcard/vault` adds password locks (Argon2id implemented in this package, the only primitive not taken from
|
|
18
|
+
WebCrypto), vault encryption and the high-level flows: registration, password change, new instances and rotation.
|
|
19
|
+
A server bundle that does not import it never loads it.
|
|
20
|
+
- `keytool.html` is the standalone key tool page: open it from your own disk (`file://`). It talks only to the hosts you
|
|
21
|
+
enter. It is generated from these modules by `npm run build`.
|
|
22
|
+
|
|
23
|
+
Functions that need randomness take `random(n)`; pass `systemRandom` (WebCrypto `getRandomValues`). Errors are
|
|
24
|
+
`RootcardError` with the stable `code` of SPEC §20.
|