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

@kybernesis/arp-tls

v0.3.0

Published

ARP TLS — self-signed Ed25519 X.509 cert generation + DID-doc pinning + fingerprint validation.

Downloads

281

Readme

@kybernesis/arp-tls

Self-signed Ed25519 X.509 certificate generation plus DID-pinned fingerprint validation for ARP agents.

Why not Let's Encrypt?

Agent names live on Handshake (.agent). Web PKI can't see them. ARP v0 skips CAs entirely — agents generate a long-lived self-signed cert, publish its SHA-256 fingerprint in their DID document, and peers validate against that pin. See docs/ARP-hns-resolution.md §4.

Install

pnpm add @kybernesis/arp-tls

Use

import {
  generateAgentCert,
  computeFingerprint,
  validatePinnedDer,
  toTlsServerOptions,
} from '@kybernesis/arp-tls';
import { createServer, connect } from 'node:tls';

const result = await generateAgentCert({ did: 'did:web:samantha.agent' });
if (!result.ok) throw new Error(result.error.message);
const { certPem, keyPem, fingerprint } = result.value;

// Server side
const server = createServer(toTlsServerOptions(result.value), (socket) => {
  socket.end('hello');
});

// Client side — pin against the fingerprint found in the peer's DID doc.
const socket = connect({
  host: 'samantha.agent',
  port: 443,
  rejectUnauthorized: false,
  servername: 'samantha.agent',
});
socket.on('secureConnect', () => {
  const peer = socket.getPeerX509Certificate()!;
  if (!validatePinnedDer(peer.raw, expectedFingerprintFromDidDoc)) {
    socket.destroy();
    throw new Error('pin mismatch');
  }
});

API

| Function | Notes | | --------------------------------------- | --------------------------------------------- | | generateAgentCert(opts) | Ed25519 self-signed cert, 10-year validity. | | computeFingerprint(pemOrDer) | SHA-256 of DER, lowercase hex. | | validatePinnedCert(pem, expected) | Constant-time compare; accepts sha256: prefix. | | validatePinnedDer(der, expected) | Same as above for Node's peer.raw. | | toTlsServerOptions(cert) | Drop into tls.createServer/https.createServer. | | toTlsClientOptions({host, port}) | rejectUnauthorized: false baseline — you own the pin check. |

Design notes

  • The generator mints a fresh Ed25519 keypair rather than consuming the agent's DID signing key. In v0 the TLS key is independent; Phase 3+ can optionally reuse the DID key once Node's Web Crypto supports importing raw multibase keys directly.
  • @peculiar/x509 is the sole extra dependency; Node's built-in X509Certificate handles parsing.
  • Fingerprint comparison is constant-time to keep timing side channels off the table.