{"id":28380663,"url":"https://github.com/0xsequence/tee-verifier.js","last_synced_at":"2025-06-24T21:31:23.181Z","repository":{"id":289478915,"uuid":"971306147","full_name":"0xsequence/tee-verifier.js","owner":"0xsequence","description":"Tee Verifier TypeScript","archived":false,"fork":false,"pushed_at":"2025-05-23T14:12:53.000Z","size":32,"stargazers_count":3,"open_issues_count":0,"forks_count":0,"subscribers_count":10,"default_branch":"master","last_synced_at":"2025-06-06T03:39:43.509Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/0xsequence.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2025-04-23T10:18:05.000Z","updated_at":"2025-05-23T14:12:56.000Z","dependencies_parsed_at":"2025-04-23T14:33:57.783Z","dependency_job_id":null,"html_url":"https://github.com/0xsequence/tee-verifier.js","commit_stats":null,"previous_names":["0xsequence/tee-verifier.js"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/0xsequence/tee-verifier.js","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/0xsequence%2Ftee-verifier.js","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/0xsequence%2Ftee-verifier.js/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/0xsequence%2Ftee-verifier.js/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/0xsequence%2Ftee-verifier.js/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/0xsequence","download_url":"https://codeload.github.com/0xsequence/tee-verifier.js/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/0xsequence%2Ftee-verifier.js/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":261759094,"owners_count":23205494,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2025-05-30T03:09:02.758Z","updated_at":"2025-06-24T21:31:23.171Z","avatar_url":"https://github.com/0xsequence.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# tee-verifier\n\nTypeScript/JavaScript library for verifying TEE (Trusted Execution Environment) enclave attestations. Currently, only AWS Nitro Enclaves is supported.\n\n## Install\n\n```\nnpm install @0xsequence/tee-verifier\n```\n\n## Usage\n\nIf you're verifying a Sequence enclave that responds with an `X-Attestation-Document` HTTP header, you can simply use `createAttestationVerifyingFetch` like so:\n\n```typescript\nimport { createAttestationVerifyingFetch } from 'tee-verifier'\n\nconst verifyingFetch = createAttestationVerifyingFetch({ /* options */ })\ntry {\n  const res = await verifyingFetch('https://waas.sequence.app/health')\n  console.log('Success!')\n} catch (error) {\n  console.error('Verification unsuccessful:', error)\n}\n```\n\nThe following options are available:\n\n- `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\n- `checkDate` - use a different Date to verify the certificates (current date by default)\n- `expectedPCRs` - if provided, the PCRs from the attestation are compared against these\n- `verifyRootOfTrust` - whether the certificate chain should be verified\n- `verifySignature` - whether the attestation signature should be verified\n- `verifyNonce` - whether the nonce in the attestation should be compared against the nonce sent in the request\n- `verifyContentHash` - whether the hash in the attestation should be compared against the calculated hash of the request/response\n- `logTiming` - whether the debug timing should be logged to the console\n\nOtherwise, you can also verify it manually:\n\n```typescript\nconst document = /* base64-encoded attestation returned by the NSM */\nconst attestation = SignedAttestation.fromDocument(document)\nconst isSignatureValid = await attestation.verifySignature()\nconst isRootOfTrustValid = await attestation.verifyRootOfTrust(new Date())\nconst isRootCertValid = (await attestation.rootCertFingerprint()) === expectedFingerprint\nconst isNonceValid = attestation.nonce === expectedNonce\nconst isUserDataValid = attestation.userData === expectedUserData\nconst isPCR0Valid = attestation.pcrs[0] === expectedPCR0\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2F0xsequence%2Ftee-verifier.js","html_url":"https://awesome.ecosyste.ms/projects/github.com%2F0xsequence%2Ftee-verifier.js","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2F0xsequence%2Ftee-verifier.js/lists"}