npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@pkistudio/keygadgets

v0.1.3

Published

Local-only PKI key generation, import, export, and inspection tools.

Readme

Key Gadgets

Key Gadgets is a local-only browser application and reusable TypeScript API for generating, importing, exporting, and inspecting PKI key material.

Current version: 0.1.3

Private keys, certificates, CSRs, SubjectDN values, and PKCS#12 files stay in browser memory unless the user explicitly exports them. The application does not retrieve remote resources or send telemetry, and its production page sets connect-src 'none'.

Features

  • Generate browser-supported RSA, EC, Ed25519, Ed448, X25519, and X448 key pairs through WebCrypto.
  • Import and export PKCS#8 private keys, SPKI public keys, certificates, and password-protected PKCS#12 files.
  • Recognize key families and common RSA sizes and named EC curves.
  • Create and edit SubjectDN values in Key Gadgets-owned forms.
  • Create PKCS#10 CSRs and self-signed certificates for RSA and EC keys.
  • Match certificates and public keys to private keys.
  • Inspect every DER object in an embedded read-only DerEditor.
  • Send a certificate directly to an independent X.509 Gadgets viewer window.
  • Use the Core, PKCS#12, and browser App APIs independently.

Independence

The only runtime dependencies on other PkiStudio packages are the published, version-pinned @pkistudio/dereditor and @pkistudio/x509gadgets packages. Key Gadgets does not consume source, internal paths, workflows, Git branches, or unpublished APIs from any PkiStudio repository.

DerEditor integration is isolated in src/dereditor-adapter.ts. The embedded viewer receives DER bytes and is always read-only. SubjectDN editing does not use or observe DerEditor DOM internals. A subtree sent to the standalone DerEditor window may be edited independently and is not synchronized back. X.509 Gadgets integration uses only its published App and stylesheet exports; certificate DER is copied directly to its standalone window without network or persistent-storage transfer.

See the dependency policy for the enforced rules.

Install

npm install @pkistudio/keygadgets

Package exports:

  • @pkistudio/keygadgets: Core API
  • @pkistudio/keygadgets/core: Core API alias
  • @pkistudio/keygadgets/pkcs12: PKCS#12 helpers
  • @pkistudio/keygadgets/app: browser application initializer
  • @pkistudio/keygadgets/styles.css: application stylesheet

Core API

import {
  createSubjectDn,
  generateKeyPair,
  createCsr
} from '@pkistudio/keygadgets';

const key = await generateKeyPair('ecdsa-p-256');
const subjectDn = 'CN=example.test, O=Example, C=US';
const subjectBytes = createSubjectDn(subjectDn);

const csr = await createCsr({
  privateKeyDer: key.privateKeyDer!,
  publicKeyDer: key.publicKeyDer!,
  subjectDn,
  subjectBytes,
  hashAlgorithm: 'SHA-256'
});

console.log(csr.bytes.byteLength);

PKCS#12 API

import { readPkcs12, writePkcs12 } from '@pkistudio/keygadgets/pkcs12';

const pfx = await writePkcs12([key], 'password');
const imported = await readPkcs12(pfx, 'password');

PKCS#12 exports use a shrouded PKCS#8 key bag with AES-256-CBC, SHA-256-based integrity protection, and 100,000 iterations. The browser app saves every workspace item containing a private key into one PKCS#12 file and reloads all of them. For supported algorithms, a public key is recovered from the private key when no certificate is present.

Browser app

import { initKeyGadgets } from '@pkistudio/keygadgets/app';
import '@pkistudio/keygadgets/styles.css';

const app = initKeyGadgets({
  mount: '#app',
  theme: 'dark',
  host: {
    saveFile: async ({ bytes, suggestedName }) => {
      console.log('save', suggestedName, bytes.byteLength);
    }
  }
});

await app.generate('ecdsa-p-256', 'Signing key');

Host callbacks keep file storage, prompts, and confirmation behavior outside the reusable package.

Development

npm install
npm test
npm run check
npm run build
npm run test:e2e:install
npm run test:e2e
npm run pack:dry-run

Use npm run dev during development. See the feature specification, API specification, and deployment guide for stable behavior and distribution details.

License

MIT