Current collected state Current
Observed since 21 Oct, 11:09 UTC
No superseded metadata states collected. Unchanged observations do not create new revisions.
@0xsequence/tee-verifier
A library for verifying TEE enclave attestation
TypeScript/JavaScript library for verifying TEE (Trusted Execution Environment) enclave attestations. Currently, only AWS Nitro Enclaves is supported.
npm install @0xsequence/tee-verifier
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-processcheckDate - use a different Date to verify the certificates (current date by default)expectedPCRs - if provided, the PCRs from the attestation are compared against theseverifyRootOfTrust - whether the certificate chain should be verifiedverifySignature - whether the attestation signature should be verifiedverifyNonce - whether the nonce in the attestation should be compared against the nonce sent in the requestverifyContentHash - whether the hash in the attestation should be compared against the calculated hash of the request/responselogTiming - whether the debug timing should be logged to the consoleOtherwise, 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
Download counts and popularity will appear here as the collector receives them.
| Package / target | Requirement | Relationship |
|---|---|---|
cbor2Environment{
"local_name": "cbor2",
"alias": false,
"peer_metadata": null
} | ^1.12.0 | runtime |
pkijsEnvironment{
"local_name": "pkijs",
"alias": false,
"peer_metadata": null
} | ^3.2.5 | runtime |
vitestEnvironment{
"local_name": "vitest",
"alias": false,
"peer_metadata": null
} | ^3.1.2 | development |
lefthookEnvironment{
"local_name": "lefthook",
"alias": false,
"peer_metadata": null
} | ^1.11.11 | development |
prettierEnvironment{
"local_name": "prettier",
"alias": false,
"peer_metadata": null
} | ^3.5.3 | development |
typescriptEnvironment{
"local_name": "typescript",
"alias": false,
"peer_metadata": null
} | ^5.7.3 | development |
Source distribution
{
"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
}Shared repository data · GitHub
Observed since 21 Oct, 11:09 UTC
No superseded metadata states collected. Unchanged observations do not create new revisions.
package_version:e522f7b975290551c2939865c30e51a9989b99294fc3bd0111234fe197116fef