Catalog npm
Back to packageRELEASE DETAILS

0.1.0

npm

@0xsequence/tee-verifier

A library for verifying TEE enclave attestation

attestationenclavenitrotee
Published23 Apr 2025
Direct dependencies6
Transitive dependenciesNot calculated

README

Current package documentation

tee-verifier

TypeScript/JavaScript library for verifying TEE (Trusted Execution Environment) enclave attestations. Currently, only AWS Nitro Enclaves is supported.

Install

npm install @0xsequence/tee-verifier

Usage

If you're verifying a Sequence enclave that responds with an X-Attestation-Document HTTP header, you can simply use createAttestationVerifyingFetch like so:

import { createAttestationVerifyingFetch } from 'tee-verifier'

const verifyingFetch = createAttestationVerifyingFetch({ /* options */ })
try {
  const res = await verifyingFetch('https://waas.sequence.app/health')
  console.log('Success!')
} catch (error) {
  console.error('Verification unsuccessful:', error)
}

The following options are available:

  • rootCertFingerprint - use a different root certificate fingerprint. By default, tee-verifier uses the AWS root certificate from https://docs.aws.amazon.com/enclaves/latest/user/verify-root.html#validation-process
  • checkDate - use a different Date to verify the certificates (current date by default)
  • expectedPCRs - if provided, the PCRs from the attestation are compared against these
  • verifyRootOfTrust - whether the certificate chain should be verified
  • verifySignature - whether the attestation signature should be verified
  • verifyNonce - whether the nonce in the attestation should be compared against the nonce sent in the request
  • verifyContentHash - whether the hash in the attestation should be compared against the calculated hash of the request/response
  • logTiming - whether the debug timing should be logged to the console

Otherwise, you can also verify it manually:

const document = /* base64-encoded attestation returned by the NSM */
const attestation = SignedAttestation.fromDocument(document)
const isSignatureValid = await attestation.verifySignature()
const isRootOfTrustValid = await attestation.verifyRootOfTrust(new Date())
const isRootCertValid = (await attestation.rootCertFingerprint()) === expectedFingerprint
const isNonceValid = attestation.nonce === expectedNonce
const isUserDataValid = attestation.userData === expectedUserData
const isPCR0Valid = attestation.pcrs[0] === expectedPCR0

Downloads & popularity

Awaiting observations

No metric observations yet

Download counts and popularity will appear here as the collector receives them.

Declared dependencies 6

Native requirements
6 direct targetsNot calculated transitive count
Package / targetRequirementRelationship
cbor2
Environment
{
  "local_name": "cbor2",
  "alias": false,
  "peer_metadata": null
}
^1.12.0runtime
pkijs
Environment
{
  "local_name": "pkijs",
  "alias": false,
  "peer_metadata": null
}
^3.2.5runtime
vitest
Environment
{
  "local_name": "vitest",
  "alias": false,
  "peer_metadata": null
}
^3.1.2development
lefthook
Environment
{
  "local_name": "lefthook",
  "alias": false,
  "peer_metadata": null
}
^1.11.11development
prettier
Environment
{
  "local_name": "prettier",
  "alias": false,
  "peer_metadata": null
}
^3.5.3development
typescript
Environment
{
  "local_name": "typescript",
  "alias": false,
  "peer_metadata": null
}
^5.7.3development

Distribution files

1 collected
Distribution 1

Source distribution

Source file
Checksums from source
{
  "shasum": "c2b588d27662d0c56a12c9019af5f3ab80222dd5",
  "tarball": "https://registry.npmjs.org/@0xsequence/tee-verifier/-/tee-verifier-0.1.0.tgz",
  "fileCount": 5,
  "integrity": "sha512-uSN5MHfxCfFL6Ig5IRF88G/xK189IYz2zi1DZeTcRykBIGgtSQJMXmCrdQS3tZXYJCOFd1Q+ew5nWoRuB0RhFg==",
  "signatures": [
    {
      "sig": "MEUCIQCconrQcvNJHr4mOlUSio8vxAdKd2sig241bKwSSUzYNAIgMuAT0+81CZeXegNUwKDwU86IHFYVdDhtfChj0AnZSvo=",
      "keyid": "SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"
    }
  ],
  "unpackedSize": 13146
}

Repository

PENDING
0xsequence/tee-verifier.js

Shared repository data · GitHub

License detected in repository
Not collected

Metadata history

Meaningful changes
Current collected state Current

Observed since 21 Oct, 11:09 UTC

No superseded metadata states collected. Unchanged observations do not create new revisions.

Record identity

package_version:e522f7b975290551c2939865c30e51a9989b99294fc3bd0111234fe197116fef

Other collected versions

0.1.26 Jun0.1.123 MayView all collected versions →