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

@noz-ele/x509-http-signatures

v0.1.0

Published

X.509 proof of possession for HTTP requests using RFC 9440, RFC 9421, and EdgCA.

Readme

@noz-ele/x509-http-signatures

日本語 | English

X.509 client-certificate proof of possession for HTTP requests. This ESM-only TypeScript package connects RFC 9440 certificate presentation, RFC 9421 HTTP Message Signatures, RFC 9530 content digests, Cloudflare Workers, and EdgCA.

Features

  • Runtime-neutral certificate presentation with strict size and count limits.
  • RFC 9440 Client-Cert and Client-Cert-Chain parsing.
  • A Cloudflare adapter for request.cf.tlsClientAuth without a Workers-types dependency.
  • Bounded EdgCA chain validation for the clientAuth purpose.
  • Stateless, HMAC-authenticated, short-lived RFC 9421 challenges.
  • Immutable request signing and verification with a fixed security profile.
  • A Node.js CLI that prints curl-ready signature headers.

The fixed signature profile covers these components, in this order:

@method
@target-uri
content-digest

It uses ecdsa-p256-sha256, sha-256 content digests, and the application tag x509-http-signature.

Install

npm install @noz-ele/x509-http-signatures

Node.js 20+, modern browsers, and Cloudflare Workers are supported. All shared cryptography uses Web Crypto. CommonJS require is not supported.

Package entry points

import type {
  ClientCertificatePresentation,
  VerifiedClientCertificate
} from "@noz-ele/x509-http-signatures";

import {
  signRequest,
  type HttpMessageSigner
} from "@noz-ele/x509-http-signatures/client";

import {
  issueSignatureChallenge,
  verifyClientCertificate,
  verifySignedRequest
} from "@noz-ele/x509-http-signatures/server";

import {
  fromRfc9440ClientCertificates
} from "@noz-ele/x509-http-signatures/rfc9440";

import {
  fromCloudflareTlsClientAuth
} from "@noz-ele/x509-http-signatures/cloudflare";

The root entry point is an aggregate surface. Use the purpose-specific entry points when you want a smaller, capability-specific dependency graph.

Server flow

import {
  fromCloudflareTlsClientAuth
} from "@noz-ele/x509-http-signatures/cloudflare";
import {
  issueSignatureChallenge,
  verifyClientCertificate,
  verifySignedRequest
} from "@noz-ele/x509-http-signatures/server";

const presentation = fromCloudflareTlsClientAuth(
  request.cf?.tlsClientAuth
);

const certificate = await verifyClientCertificate({
  presentation,
  trustedRootCertificatesPem: [env.CLIENT_CA_PEM],
  purpose: "clientAuth"
});

const challengeSigningKey = Uint8Array.from(
  atob(env.CHALLENGE_HMAC_KEY_BASE64),
  (character) => character.charCodeAt(0)
);

const challenge = await issueSignatureChallenge({
  certificate,
  audience: "https://api.example.com/admin",
  challengeSigningKey,
  expiresInSeconds: 60
});

// Return this on a 401 response. Keep challenge responses uncacheable.
const headers = new Headers({
  "Accept-Signature": challenge.acceptSignature,
  "Cache-Control": "no-store"
});

// On the following signed request:
const proof = await verifySignedRequest({
  request,
  certificate,
  challengeSigningKey,
  expectedAudience: "https://api.example.com/admin"
});

challengeSigningKey is either a non-extractable HMAC-SHA-256 CryptoKey (with the usage required by the operation, normally both sign and verify) or at least 32 bytes of secret key material. Store it as a Worker secret, never in wrangler.jsonc or source control.

Client flow

import { signRequest } from "@noz-ele/x509-http-signatures/client";
import { signData } from "@noz-ele/edgca/sign";

const signedRequest = await signRequest({
  request,
  acceptSignature,
  signer: {
    sign(data, algorithm) {
      if (algorithm !== "ecdsa-p256-sha256") throw new Error("unsupported");
      return signData({
        privateKey,
        data,
        signatureFormat: "ieee-p1363"
      });
    }
  }
});

The input Request is not consumed or mutated. The returned request contains Content-Digest, Signature-Input, and Signature.

CLI and curl

x509-http-signatures sign-request \
  --method POST \
  --url https://api.example.com/admin \
  --accept-signature-file accept-signature.txt \
  --key client.key.pem \
  --body request.json

The command prints three curl-ready header lines. Send the same method, URL, and body bytes that were supplied to the command.

See the English API reference, non-goals, and the Japanese guide.

Development

npm install
npm run typecheck
npm test
npm pack --dry-run

Maintainers should follow RELEASING.md for the first npm publication and the GitHub trusted-publishing workflow used by later releases.

Security

HTTP Message Signatures are one layer in an application authentication design. Read SECURITY.md and the documented non-goals before deployment.