Something went wrong. Try again.
A Multikeys library built in TypeScript for Deno.js
Something went wrong. Try again.
TypeScript 98%
Nix 2%
README.md
@sofiaritz/multikeys #
A Multikey library built in TypeScript for Deno.js
Installation #
Multikeys is available in jsr.io: deno add jsr:@sofiaritz/multikeys
Usage #
This library exposes an API similar to crypto.subtle.importKey
and crypto.subtle.exportKey, except you do not need to specify
the algorithms, key type, and usage.
Check Algorithm Support for more information on which algorithms are currently supported.
For example,
Export a key
import { exportMultikey } from "jsr:@sofiaritz/multikeys";
const key = await crypto.subtle.generateKey(
{ name: "Ed25519" },
true, ["sign", "verify"]
) as CryptoKeyPair;
const encoded = await exportMultikey(key.publicKey);
// z6Mk...
console.info(`public key: ${encoded}`);
Import a key
import { importMultikey } from "jsr:@sofiaritz/multikeys";
const encoded = "z6Mkfgx79Mp33Q26NbhxQhLAvL159Hq99XZkSktAGXouY75V";
const key = await importMultikey(encoded);
// CryptoKey { type: "public", extractable: true, ... }
console.info("imported key:", key)
Algorithm Support #
Currently, the following algorithms are supported:
ed25519-pub(type=public, algorithm=Ed25519)ed25519-priv(type=private, algorithm=Ed25519)
License #
This project is licensed under the AGPL 3.0 or later license.