Skip to main content
This release is 2 versions behind 0.7.5 — the latest version of @paulmillr/micro-key-producer. Jump to latest

Built and signed on GitHub Actions

Produces secure keys and passwords. Supports SSH, PGP, BLS, OTP, and many others.

This package works with Node.js, Deno, Bun, BrowsersIt is unknown whether this package works with Cloudflare Workers
It is unknown whether this package works with Cloudflare Workers
This package works with Node.js
This package works with Deno
This package works with Bun
This package works with Browsers
JSR Score
70%
Published
a week ago (0.7.3)
class EIP2335Keystore

Class for generation multiple keystores with same password

Examples

Example 1

const ctx = new EIP2335Keystore(password, 'scrypt'); const res = [0, 1, 2, 3].map((i) => ctx.createDerivedEIP2334(seed, keyType, i)); ctx.clean(); console.log(res); // res is array of encrypted keystores with same password

Constructors

new
EIP2335Keystore(
password: string,
kdf: T,
_random?: RandFn,
)

Creates context for EIP2335 Keystore generation

Type Parameters

T extends KDFType

Properties

private
readonly
kdf: T
private
readonly
key: Uint8Array
private
readonly
randomBytes: RandFn
private
readonly
salt: Uint8Array

Methods

clean(): void

Clean internal key material

create(
secret: Uint8Array,
path?: string,
description?: string,
pubkey?: Uint8Array,
): Keystore<T>

Creates keystore in EIP2335 format.

createDerivedEIP2334(
seed: Uint8Array,
keyType: EIP2334KeyType,
index: number,
description?: string,
): Keystore<T>

Creates keystore for derived private key (based on EIP2334 seed and index)

Add Package

deno add jsr:@paulmillr/micro-key-producer

Import symbol

import { EIP2335Keystore } from "@paulmillr/micro-key-producer/bls.js";

---- OR ----

Import directly with a jsr specifier

import { EIP2335Keystore } from "jsr:@paulmillr/micro-key-producer/bls.js";

Add Package

npx jsr add @paulmillr/micro-key-producer

Import symbol

import { EIP2335Keystore } from "@paulmillr/micro-key-producer/bls.js";

Add Package

yarn dlx jsr add @paulmillr/micro-key-producer

Import symbol

import { EIP2335Keystore } from "@paulmillr/micro-key-producer/bls.js";

Add Package

pnpm dlx jsr add @paulmillr/micro-key-producer

Import symbol

import { EIP2335Keystore } from "@paulmillr/micro-key-producer/bls.js";

Add Package

bunx jsr add @paulmillr/micro-key-producer

Import symbol

import { EIP2335Keystore } from "@paulmillr/micro-key-producer/bls.js";