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 🙏

© 2025 – Pkg Stats / Ryan Hefner

tee-channels-qvl

v0.0.1

Published

tee-channels-qvl is a lightweight, WebCrypto-based SGX/TDX quote verification library written in TypeScript (ESM). It provides full chain-of-trust validation from the Intel SGX Root CA, through quoting enclave checks, down to quote signature verification.

Readme

tee-channels-qvl

tee-channels-qvl is a lightweight, WebCrypto-based SGX/TDX quote verification library written in TypeScript (ESM). It provides full chain-of-trust validation from the Intel SGX Root CA, through quoting enclave checks, down to quote signature verification.

Features

  • TDX v4/v5 and SGX v3 quote parsing and validation
  • Certificate chain validation to Intel SGX Root CA (ECDSA)
  • CRL-based revocation checks (DER CRL parsing helper included)
  • QE report signature and QE binding verification
  • Quote signature verification (ECDSA P‑256)
  • TCB check (match quoted TCBs against Intel TCB Info)
  • Small API surface; zero native dependencies

Requirements

  • Node.js 20+ (WebCrypto crypto.subtle)
  • ESM environment ("type": "module")

Quickstart

import { verifyTdx } from "tee-channels-qvl"

const ok = await verifyTdx(quote, {
  date: Date.now(),     // verification time (ms)
  crls: [],             // optional: array of DER CRLs as Uint8Array
})
import { verifySgx } from "tee-channels-qvl"

const ok = await verifySgx(quoteBytes, {
  date: Date.now(),
  crls: [],
})

If cert_data is missing in the quote, you can provide the leaf, intermediate, and root PEMs via extraCertdata.

You can also provide alternative pinned root certificates. We embed the Intel SGX Root CA and use it as a default otherwise.

import { verifyTdx, QV_X509Certificate } from "tee-channels-qvl"

const rootPem = "-----BEGIN CERTIFICATE-----..." // Intel SGX Root CA PEM
const intermediatePem = "-----BEGIN CERTIFICATE-----..."
const leafPem = "-----BEGIN CERTIFICATE-----..."

await verifyTdx(quoteBytes, {
  date: Date.now(),
  extraCertdata: [leafPem, intermediatePem, rootPem],
  // Optional: pin the expected root certificate object
  pinnedRootCerts: [new QV_X509Certificate(rootPem)],
  crls: [],
})

API

  • verifyTdx(quote: Uint8Array, config?: VerifyConfig): Promise<boolean>
  • verifyTdxBase64(quote: string, config?: VerifyConfig): Promise<boolean>
  • verifySgx(quote: Uint8Array, config?: VerifyConfig): Promise<boolean>
  • verifySgxBase64(quote: string, config?: VerifyConfig): Promise<boolean>

Verification performs:

  • PCK chain build and validation (leaf → intermediate → root)
  • Chain validity window checks against config.date (or now)
  • Optional CRL membership checks via config.crls
  • Root pinning against Intel SGX Root CA by default (override via pinnedRootCerts)
  • QE report signature verification
  • QE binding check between attestation_public_key and QE report data
  • Quote signature verification by attestation_public_key
  • (Optional) TCB evaluation when you provide Intel tcbInfo.json

Errors are thrown for invalid conditions (e.g. "invalid root", "invalid cert chain", "expired cert chain, or not yet valid", "revoked certificate in cert chain", "invalid qe report signature", "invalid qe report binding", "invalid signature over quote", "only TDX/SGX is supported", "only ECDSA att_key_type is supported", "only PCK cert_data is supported", "missing certdata", "Unsupported quote version").

Configuration

export interface VerifyConfig {
  crls: Uint8Array[]                 // DER CRLs for revocation checks (optional; [] if none)
  pinnedRootCerts?: QV_X509Certificate[]
  date?: number                      // ms since epoch; defaults to now
  extraCertdata?: string[]           // PEM blocks when quote lacks embedded cert_data
}

Defaults: pinnedRootCerts pins Intel SGX Root CA. Provide your own to narrow trust.

Parsers

  • parseTdxQuote(quote: Uint8Array) / parseTdxQuoteBase64(quote: string)
  • parseSgxQuote(quote: Uint8Array) / parseSgxQuoteBase64(quote: string)

These return { header, body, signature } views with typed fields:

  • TDX: v4 or v5 supported (TEE type 129)
  • SGX: v3 supported (TEE type 0)

Formatters

Human‑readable JSON views for logging:

  • formatTDXHeader(header)
  • formatTDXQuoteBodyV4(body)
  • formatTdxSignature(signature)

Limitations

  • Only ECDSA attestation key (P‑256) is supported (for now)
  • Only DCAP cert_data type 5 is supported
  • QE report must be present for QE signature/binding checks

License

MIT (C) 2025