+26
| # Changelog | ||
| All notable changes to this project are documented in this file. | ||
| The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/), | ||
| and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). | ||
| ## [0.3.0] - 2026-07-20 | ||
| ### Added | ||
| - **`Tpm.getEkPublic()` / `tpm.getEkPublic()`** — resolve the endorsement key public area | ||
| (RSA `0x81010001` → ECC `0x81010002` → transient CreatePrimary fallback) without a | ||
| caller-supplied handle. Returns the same `ReadPublicResult` shape as `readPublic` | ||
| (`publicKeyDer`, `name`). Reuses the internal `resolve_ek()` path already used by | ||
| ActivateCredential on the non-PCP path; does not change `activateCredential` behavior. | ||
| - Example: `examples/get-ek-public.mjs` (read-only check that resolved EK matches | ||
| `readPublic('0x81010001')` when the RSA EK is persistent). | ||
| Validated on Linux (fortress) and Windows test laptop (Intel PTT), privileged and unprivileged. | ||
| ## [0.2.0] - 2026-07-19 | ||
| ### Notes | ||
| - Baseline for CHANGELOG tracking; see git history for earlier releases. |
| #!/usr/bin/env node | ||
| /** | ||
| * Read-only: resolve EK via Tpm.getEkPublic() and confirm it matches ReadPublic(0x81010001) | ||
| * when the RSA EK is persistent (no handle supplied by the caller). | ||
| * | ||
| * Usage: | ||
| * node examples/get-ek-public.mjs | ||
| * node node_modules/node-tpm2/examples/get-ek-public.mjs | ||
| */ | ||
| import fs from 'node:fs'; | ||
| import path from 'node:path'; | ||
| import { fileURLToPath } from 'node:url'; | ||
| import { Tpm } from '../index.js'; | ||
| const RSA_EK_HANDLE = '0x81010001'; | ||
| const ECC_EK_HANDLE = '0x81010002'; | ||
| const logDir = path.join(path.dirname(fileURLToPath(import.meta.url)), '..', 'logs'); | ||
| fs.mkdirSync(logDir, { recursive: true }); | ||
| const logPath = path.join( | ||
| logDir, | ||
| `get-ek-public-${new Date().toISOString().replace(/[:.]/g, '').slice(0, 15)}.log`, | ||
| ); | ||
| function log(line) { | ||
| fs.appendFileSync(logPath, `${line}\n`); | ||
| } | ||
| async function main() { | ||
| try { | ||
| const available = await Tpm.isAvailable(); | ||
| log(`isAvailable=${available}`); | ||
| if (!available) { | ||
| console.log(`FAIL - TPM not available (see ${logPath})`); | ||
| process.exit(1); | ||
| } | ||
| const resolved = await Tpm.getEkPublic(); | ||
| log(`getEkPublic publicKeyDer=${resolved.publicKeyDer.length}B name=${resolved.name.length}B`); | ||
| log(`getEkPublic name hex=${resolved.name.toString('hex')}`); | ||
| let rsa; | ||
| try { | ||
| rsa = await Tpm.readPublic(RSA_EK_HANDLE); | ||
| log(`readPublic(${RSA_EK_HANDLE}) name=${rsa.name.toString('hex')}`); | ||
| } catch (err) { | ||
| log(`readPublic(${RSA_EK_HANDLE}) failed: ${err?.message ?? err}`); | ||
| console.log(`FAIL - no RSA EK at ${RSA_EK_HANDLE} to compare (see ${logPath})`); | ||
| process.exit(1); | ||
| } | ||
| let eccPresent = false; | ||
| try { | ||
| const ecc = await Tpm.readPublic(ECC_EK_HANDLE); | ||
| eccPresent = true; | ||
| log(`readPublic(${ECC_EK_HANDLE}) present name=${ecc.name.toString('hex')}`); | ||
| } catch (err) { | ||
| log(`readPublic(${ECC_EK_HANDLE}) absent: ${err?.message ?? err}`); | ||
| } | ||
| const nameMatch = resolved.name.equals(rsa.name); | ||
| const derMatch = resolved.publicKeyDer.equals(rsa.publicKeyDer); | ||
| log(`nameMatch=${nameMatch} derMatch=${derMatch} eccPresent=${eccPresent}`); | ||
| if (!nameMatch || !derMatch) { | ||
| console.log(`FAIL - getEkPublic did not match ${RSA_EK_HANDLE} (see ${logPath})`); | ||
| process.exit(1); | ||
| } | ||
| console.log( | ||
| `PASS getEkPublic ≡ readPublic(${RSA_EK_HANDLE}) (RSA present, ECC ${eccPresent ? 'present' : 'absent'})`, | ||
| ); | ||
| process.exit(0); | ||
| } catch (err) { | ||
| log(`error: ${err?.stack ?? err?.message ?? err}`); | ||
| console.log(`FAIL - see ${logPath}`); | ||
| process.exit(1); | ||
| } | ||
| } | ||
| main(); |
+18
-0
@@ -303,2 +303,11 @@ let native = null; | ||
| /** | ||
| * Resolve the endorsement key (RSA → ECC → transient) and return its public area. | ||
| * Same shape as readPublic; caller need not supply a handle. | ||
| */ | ||
| getEkPublic: wrapNative(async () => { | ||
| requireNative('getEkPublic'); | ||
| return native.getEkPublic(); | ||
| }), | ||
| async [Symbol.asyncDispose]() { | ||
@@ -379,2 +388,11 @@ // Transient handles are flushed inside each native operation. | ||
| /** | ||
| * Resolve the endorsement key (RSA → ECC → transient) and return its public area. | ||
| * Same shape as readPublic; no handle argument required. | ||
| */ | ||
| getEkPublic: wrapNative(async () => { | ||
| requireNative('getEkPublic'); | ||
| return native.getEkPublic(); | ||
| }), | ||
| /** Flat native binding: EK certificate NV read. */ | ||
@@ -381,0 +399,0 @@ readEkCertificate: wrapNative(async () => { |
@@ -297,2 +297,8 @@ # node-tpm2 API Reference | ||
| ### `Tpm.getEkPublic(): Promise<ReadPublicResult>` | ||
| **Implemented.** Flat form of `tpm.getEkPublic`. Resolves the endorsement key without a handle argument (RSA `0x81010001` → ECC `0x81010002` → transient CreatePrimary fallback). Same return shape as `readPublic`. | ||
| --- | ||
| ### `Tpm.readEkCertificate(): Promise<Buffer | null>` | ||
@@ -385,6 +391,16 @@ | ||
| **Not for:** Loading wrapped blobs (use `keys.load` instead). | ||
| **Not for:** Loading wrapped blobs (use `keys.load` instead). Prefer `tpm.getEkPublic()` when you want the platform EK without choosing a handle. | ||
| --- | ||
| ### `tpm.getEkPublic(): Promise<ReadPublicResult>` | ||
| **Implemented.** Same return shape as `readPublic`. Resolves the endorsement key using the same path as ActivateCredential (non-PCP): try persistent RSA EK (`0x81010001`), then persistent ECC EK (`0x81010002`), else CreatePrimary under endorsement (transient; flushed before return). | ||
| **Use for:** Attestation / MakeCredential setup when the caller should not hardcode EK handles. | ||
| **Not for:** Reading arbitrary persistent objects (use `readPublic` with an explicit handle). Windows PCP ActivateCredential still uses NCrypt; this API always reads the EK via TBS. | ||
| --- | ||
| ### `tpm.pcr.read(selection, bank?): Promise<Record<number, string>>` | ||
@@ -841,3 +857,3 @@ | ||
| const ekCert = await tpm.attest.ekCertificate(); // null if OEM didn't provision NV | ||
| const ek = await tpm.readPublic('0x81010001'); // RSA EK handle | ||
| const ek = await tpm.getEkPublic(); // RSA → ECC → transient; no handle needed | ||
@@ -968,2 +984,3 @@ // Verifier runs MakeCredential(ekPublic, akName, secret) → credentialBlob + secret | ||
| | ReadPublic | `tpm.readPublic(h)` | `Tpm.readPublic(h)` | `ReadPublicResult` | | ||
| | Get EK public | `tpm.getEkPublic()` | `Tpm.getEkPublic()` | `ReadPublicResult` | | ||
@@ -1038,2 +1055,3 @@ --- | ||
| | `Tpm.readPublic` | function | Implemented | | ||
| | `Tpm.getEkPublic` | function | Implemented | | ||
| | `Tpm.readEkCertificate` | function | Implemented | | ||
@@ -1056,2 +1074,3 @@ | `Tpm.readAkPublic` | function | Implemented | | ||
| | `TpmHandle.readPublic` | method | Implemented | | ||
| | `TpmHandle.getEkPublic` | method | Implemented | | ||
| | `TpmHandle.pcr.read` | method | Implemented | | ||
@@ -1058,0 +1077,0 @@ | `TpmHandle.pcr.extend` | method | Implemented | |
+3
-3
@@ -12,9 +12,9 @@ # API roadmap | ||
| ## Current state (0.0.8) | ||
| ## Current state (0.2.0) | ||
| **Shipped and validated on real Windows 11 hardware (Intel TPM, non-virtual):** attestation (user + machine provision, cross-user quote, SYSTEM provision), `random`, `keys` (sign + RSA decrypt), `pcr.read` / `pcr.extend` (admin on Windows), `nv` (read/write/define/undefine/readPublic), `seal` / `unseal`. | ||
| **Shipped and validated on real Windows 11 + Intel TPM and Linux (STM fTPM / Intel PTT):** attestation (user + machine provision, cross-user quote, SYSTEM provision), quote response `sigScheme`/`hashAlg`, `readAkPublic`, `random`, `keys` (sign + RSA decrypt), `pcr.read` / `pcr.extend` (admin on Windows), `nv` (read/write/define/undefine/readPublic), `seal` / `unseal`. | ||
| | Namespace | Methods | | ||
| |-----------|---------| | ||
| | Root | `Tpm.isAvailable()`, `Tpm.open()`, `Tpm.info()`, `tpm.readPublic()` | | ||
| | Root | `Tpm.isAvailable()`, `Tpm.open()`, `Tpm.info()`, `tpm.readPublic()`, `Tpm.readAkPublic()` | | ||
| | `tpm.random` | `bytes(n)` | | ||
@@ -21,0 +21,0 @@ | `tpm.pcr` | `read`, `extend` | |
+10
-0
@@ -179,2 +179,7 @@ export declare class TpmError extends Error { | ||
| readPublic(handle: string): Promise<ReadPublicResult>; | ||
| /** | ||
| * Resolve the endorsement key (RSA 0x81010001 → ECC 0x81010002 → transient) | ||
| * and return its public area. Same shape as `readPublic`; caller need not know handles. | ||
| */ | ||
| getEkPublic(): Promise<ReadPublicResult>; | ||
| [Symbol.asyncDispose](): Promise<void>; | ||
@@ -192,2 +197,7 @@ } | ||
| readPublic(handle: string): Promise<ReadPublicResult>; | ||
| /** | ||
| * Resolve the endorsement key (RSA → ECC → transient) and return its public area. | ||
| * Same shape as `readPublic`; no handle argument required. | ||
| */ | ||
| getEkPublic(): Promise<ReadPublicResult>; | ||
| readEkCertificate(): Promise<Buffer | null>; | ||
@@ -194,0 +204,0 @@ /** SPKI DER from a saved AK blob (read-only decode; no TPM I/O). */ |
+157
-156
@@ -80,6 +80,6 @@ // prettier-ignore | ||
| const bindingPackageVersion = require('node-tpm2-android-arm64/package.json').version | ||
| if (bindingPackageVersion !== '0.2.0') { | ||
| if (bindingPackageVersion !== '0.3.0') { | ||
| if (typeof process !== 'undefined' && process.emitWarning) { | ||
| process.emitWarning( | ||
| `[node-tpm2] optional binding version ${bindingPackageVersion} !== 0.2.0; run npm install or npm run build`, | ||
| `[node-tpm2] optional binding version ${bindingPackageVersion} !== 0.3.0; run npm install or npm run build`, | ||
| { type: 'node-tpm2', code: 'NATIVE_BINDING_VERSION' }, | ||
@@ -89,6 +89,6 @@ ) | ||
| } | ||
| if (bindingPackageVersion !== '0.2.0') { | ||
| if (bindingPackageVersion !== '0.3.0') { | ||
| if (typeof process !== 'undefined' && process.emitWarning) { | ||
| process.emitWarning( | ||
| `[node-tpm2] optional binding version ${bindingPackageVersion} !== 0.2.0; run npm install or npm run build`, | ||
| `[node-tpm2] optional binding version ${bindingPackageVersion} !== 0.3.0; run npm install or npm run build`, | ||
| { type: 'node-tpm2', code: 'NATIVE_BINDING_VERSION' }, | ||
@@ -98,4 +98,4 @@ ) | ||
| } | ||
| if (bindingPackageVersion !== '0.2.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') { | ||
| throw new Error(`Native binding package version mismatch, expected 0.2.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`) | ||
| if (bindingPackageVersion !== '0.3.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') { | ||
| throw new Error(`Native binding package version mismatch, expected 0.3.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`) | ||
| } | ||
@@ -115,6 +115,6 @@ return binding | ||
| const bindingPackageVersion = require('node-tpm2-android-arm-eabi/package.json').version | ||
| if (bindingPackageVersion !== '0.2.0') { | ||
| if (bindingPackageVersion !== '0.3.0') { | ||
| if (typeof process !== 'undefined' && process.emitWarning) { | ||
| process.emitWarning( | ||
| `[node-tpm2] optional binding version ${bindingPackageVersion} !== 0.2.0; run npm install or npm run build`, | ||
| `[node-tpm2] optional binding version ${bindingPackageVersion} !== 0.3.0; run npm install or npm run build`, | ||
| { type: 'node-tpm2', code: 'NATIVE_BINDING_VERSION' }, | ||
@@ -124,6 +124,6 @@ ) | ||
| } | ||
| if (bindingPackageVersion !== '0.2.0') { | ||
| if (bindingPackageVersion !== '0.3.0') { | ||
| if (typeof process !== 'undefined' && process.emitWarning) { | ||
| process.emitWarning( | ||
| `[node-tpm2] optional binding version ${bindingPackageVersion} !== 0.2.0; run npm install or npm run build`, | ||
| `[node-tpm2] optional binding version ${bindingPackageVersion} !== 0.3.0; run npm install or npm run build`, | ||
| { type: 'node-tpm2', code: 'NATIVE_BINDING_VERSION' }, | ||
@@ -133,4 +133,4 @@ ) | ||
| } | ||
| if (bindingPackageVersion !== '0.2.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') { | ||
| throw new Error(`Native binding package version mismatch, expected 0.2.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`) | ||
| if (bindingPackageVersion !== '0.3.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') { | ||
| throw new Error(`Native binding package version mismatch, expected 0.3.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`) | ||
| } | ||
@@ -155,6 +155,6 @@ return binding | ||
| const bindingPackageVersion = require('node-tpm2-win32-x64-gnu/package.json').version | ||
| if (bindingPackageVersion !== '0.2.0') { | ||
| if (bindingPackageVersion !== '0.3.0') { | ||
| if (typeof process !== 'undefined' && process.emitWarning) { | ||
| process.emitWarning( | ||
| `[node-tpm2] optional binding version ${bindingPackageVersion} !== 0.2.0; run npm install or npm run build`, | ||
| `[node-tpm2] optional binding version ${bindingPackageVersion} !== 0.3.0; run npm install or npm run build`, | ||
| { type: 'node-tpm2', code: 'NATIVE_BINDING_VERSION' }, | ||
@@ -164,6 +164,6 @@ ) | ||
| } | ||
| if (bindingPackageVersion !== '0.2.0') { | ||
| if (bindingPackageVersion !== '0.3.0') { | ||
| if (typeof process !== 'undefined' && process.emitWarning) { | ||
| process.emitWarning( | ||
| `[node-tpm2] optional binding version ${bindingPackageVersion} !== 0.2.0; run npm install or npm run build`, | ||
| `[node-tpm2] optional binding version ${bindingPackageVersion} !== 0.3.0; run npm install or npm run build`, | ||
| { type: 'node-tpm2', code: 'NATIVE_BINDING_VERSION' }, | ||
@@ -173,4 +173,4 @@ ) | ||
| } | ||
| if (bindingPackageVersion !== '0.2.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') { | ||
| throw new Error(`Native binding package version mismatch, expected 0.2.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`) | ||
| if (bindingPackageVersion !== '0.3.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') { | ||
| throw new Error(`Native binding package version mismatch, expected 0.3.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`) | ||
| } | ||
@@ -190,6 +190,6 @@ return binding | ||
| const bindingPackageVersion = require('node-tpm2-windows-x64-msvc/package.json').version | ||
| if (bindingPackageVersion !== '0.2.0') { | ||
| if (bindingPackageVersion !== '0.3.0') { | ||
| if (typeof process !== 'undefined' && process.emitWarning) { | ||
| process.emitWarning( | ||
| `[node-tpm2] optional binding version ${bindingPackageVersion} !== 0.2.0; run npm install or npm run build`, | ||
| `[node-tpm2] optional binding version ${bindingPackageVersion} !== 0.3.0; run npm install or npm run build`, | ||
| { type: 'node-tpm2', code: 'NATIVE_BINDING_VERSION' }, | ||
@@ -199,6 +199,6 @@ ) | ||
| } | ||
| if (bindingPackageVersion !== '0.2.0') { | ||
| if (bindingPackageVersion !== '0.3.0') { | ||
| if (typeof process !== 'undefined' && process.emitWarning) { | ||
| process.emitWarning( | ||
| `[node-tpm2] optional binding version ${bindingPackageVersion} !== 0.2.0; run npm install or npm run build`, | ||
| `[node-tpm2] optional binding version ${bindingPackageVersion} !== 0.3.0; run npm install or npm run build`, | ||
| { type: 'node-tpm2', code: 'NATIVE_BINDING_VERSION' }, | ||
@@ -208,4 +208,4 @@ ) | ||
| } | ||
| if (bindingPackageVersion !== '0.2.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') { | ||
| throw new Error(`Native binding package version mismatch, expected 0.2.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`) | ||
| if (bindingPackageVersion !== '0.3.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') { | ||
| throw new Error(`Native binding package version mismatch, expected 0.3.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`) | ||
| } | ||
@@ -226,6 +226,6 @@ return binding | ||
| const bindingPackageVersion = require('node-tpm2-win32-ia32-msvc/package.json').version | ||
| if (bindingPackageVersion !== '0.2.0') { | ||
| if (bindingPackageVersion !== '0.3.0') { | ||
| if (typeof process !== 'undefined' && process.emitWarning) { | ||
| process.emitWarning( | ||
| `[node-tpm2] optional binding version ${bindingPackageVersion} !== 0.2.0; run npm install or npm run build`, | ||
| `[node-tpm2] optional binding version ${bindingPackageVersion} !== 0.3.0; run npm install or npm run build`, | ||
| { type: 'node-tpm2', code: 'NATIVE_BINDING_VERSION' }, | ||
@@ -235,6 +235,6 @@ ) | ||
| } | ||
| if (bindingPackageVersion !== '0.2.0') { | ||
| if (bindingPackageVersion !== '0.3.0') { | ||
| if (typeof process !== 'undefined' && process.emitWarning) { | ||
| process.emitWarning( | ||
| `[node-tpm2] optional binding version ${bindingPackageVersion} !== 0.2.0; run npm install or npm run build`, | ||
| `[node-tpm2] optional binding version ${bindingPackageVersion} !== 0.3.0; run npm install or npm run build`, | ||
| { type: 'node-tpm2', code: 'NATIVE_BINDING_VERSION' }, | ||
@@ -244,4 +244,4 @@ ) | ||
| } | ||
| if (bindingPackageVersion !== '0.2.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') { | ||
| throw new Error(`Native binding package version mismatch, expected 0.2.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`) | ||
| if (bindingPackageVersion !== '0.3.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') { | ||
| throw new Error(`Native binding package version mismatch, expected 0.3.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`) | ||
| } | ||
@@ -261,6 +261,6 @@ return binding | ||
| const bindingPackageVersion = require('node-tpm2-windows-arm64-msvc/package.json').version | ||
| if (bindingPackageVersion !== '0.2.0') { | ||
| if (bindingPackageVersion !== '0.3.0') { | ||
| if (typeof process !== 'undefined' && process.emitWarning) { | ||
| process.emitWarning( | ||
| `[node-tpm2] optional binding version ${bindingPackageVersion} !== 0.2.0; run npm install or npm run build`, | ||
| `[node-tpm2] optional binding version ${bindingPackageVersion} !== 0.3.0; run npm install or npm run build`, | ||
| { type: 'node-tpm2', code: 'NATIVE_BINDING_VERSION' }, | ||
@@ -270,6 +270,6 @@ ) | ||
| } | ||
| if (bindingPackageVersion !== '0.2.0') { | ||
| if (bindingPackageVersion !== '0.3.0') { | ||
| if (typeof process !== 'undefined' && process.emitWarning) { | ||
| process.emitWarning( | ||
| `[node-tpm2] optional binding version ${bindingPackageVersion} !== 0.2.0; run npm install or npm run build`, | ||
| `[node-tpm2] optional binding version ${bindingPackageVersion} !== 0.3.0; run npm install or npm run build`, | ||
| { type: 'node-tpm2', code: 'NATIVE_BINDING_VERSION' }, | ||
@@ -279,4 +279,4 @@ ) | ||
| } | ||
| if (bindingPackageVersion !== '0.2.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') { | ||
| throw new Error(`Native binding package version mismatch, expected 0.2.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`) | ||
| if (bindingPackageVersion !== '0.3.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') { | ||
| throw new Error(`Native binding package version mismatch, expected 0.3.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`) | ||
| } | ||
@@ -299,6 +299,6 @@ return binding | ||
| const bindingPackageVersion = require('node-tpm2-darwin-universal/package.json').version | ||
| if (bindingPackageVersion !== '0.2.0') { | ||
| if (bindingPackageVersion !== '0.3.0') { | ||
| if (typeof process !== 'undefined' && process.emitWarning) { | ||
| process.emitWarning( | ||
| `[node-tpm2] optional binding version ${bindingPackageVersion} !== 0.2.0; run npm install or npm run build`, | ||
| `[node-tpm2] optional binding version ${bindingPackageVersion} !== 0.3.0; run npm install or npm run build`, | ||
| { type: 'node-tpm2', code: 'NATIVE_BINDING_VERSION' }, | ||
@@ -308,6 +308,6 @@ ) | ||
| } | ||
| if (bindingPackageVersion !== '0.2.0') { | ||
| if (bindingPackageVersion !== '0.3.0') { | ||
| if (typeof process !== 'undefined' && process.emitWarning) { | ||
| process.emitWarning( | ||
| `[node-tpm2] optional binding version ${bindingPackageVersion} !== 0.2.0; run npm install or npm run build`, | ||
| `[node-tpm2] optional binding version ${bindingPackageVersion} !== 0.3.0; run npm install or npm run build`, | ||
| { type: 'node-tpm2', code: 'NATIVE_BINDING_VERSION' }, | ||
@@ -317,4 +317,4 @@ ) | ||
| } | ||
| if (bindingPackageVersion !== '0.2.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') { | ||
| throw new Error(`Native binding package version mismatch, expected 0.2.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`) | ||
| if (bindingPackageVersion !== '0.3.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') { | ||
| throw new Error(`Native binding package version mismatch, expected 0.3.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`) | ||
| } | ||
@@ -334,6 +334,6 @@ return binding | ||
| const bindingPackageVersion = require('node-tpm2-darwin-x64/package.json').version | ||
| if (bindingPackageVersion !== '0.2.0') { | ||
| if (bindingPackageVersion !== '0.3.0') { | ||
| if (typeof process !== 'undefined' && process.emitWarning) { | ||
| process.emitWarning( | ||
| `[node-tpm2] optional binding version ${bindingPackageVersion} !== 0.2.0; run npm install or npm run build`, | ||
| `[node-tpm2] optional binding version ${bindingPackageVersion} !== 0.3.0; run npm install or npm run build`, | ||
| { type: 'node-tpm2', code: 'NATIVE_BINDING_VERSION' }, | ||
@@ -343,6 +343,6 @@ ) | ||
| } | ||
| if (bindingPackageVersion !== '0.2.0') { | ||
| if (bindingPackageVersion !== '0.3.0') { | ||
| if (typeof process !== 'undefined' && process.emitWarning) { | ||
| process.emitWarning( | ||
| `[node-tpm2] optional binding version ${bindingPackageVersion} !== 0.2.0; run npm install or npm run build`, | ||
| `[node-tpm2] optional binding version ${bindingPackageVersion} !== 0.3.0; run npm install or npm run build`, | ||
| { type: 'node-tpm2', code: 'NATIVE_BINDING_VERSION' }, | ||
@@ -352,4 +352,4 @@ ) | ||
| } | ||
| if (bindingPackageVersion !== '0.2.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') { | ||
| throw new Error(`Native binding package version mismatch, expected 0.2.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`) | ||
| if (bindingPackageVersion !== '0.3.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') { | ||
| throw new Error(`Native binding package version mismatch, expected 0.3.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`) | ||
| } | ||
@@ -369,6 +369,6 @@ return binding | ||
| const bindingPackageVersion = require('node-tpm2-darwin-arm64/package.json').version | ||
| if (bindingPackageVersion !== '0.2.0') { | ||
| if (bindingPackageVersion !== '0.3.0') { | ||
| if (typeof process !== 'undefined' && process.emitWarning) { | ||
| process.emitWarning( | ||
| `[node-tpm2] optional binding version ${bindingPackageVersion} !== 0.2.0; run npm install or npm run build`, | ||
| `[node-tpm2] optional binding version ${bindingPackageVersion} !== 0.3.0; run npm install or npm run build`, | ||
| { type: 'node-tpm2', code: 'NATIVE_BINDING_VERSION' }, | ||
@@ -378,6 +378,6 @@ ) | ||
| } | ||
| if (bindingPackageVersion !== '0.2.0') { | ||
| if (bindingPackageVersion !== '0.3.0') { | ||
| if (typeof process !== 'undefined' && process.emitWarning) { | ||
| process.emitWarning( | ||
| `[node-tpm2] optional binding version ${bindingPackageVersion} !== 0.2.0; run npm install or npm run build`, | ||
| `[node-tpm2] optional binding version ${bindingPackageVersion} !== 0.3.0; run npm install or npm run build`, | ||
| { type: 'node-tpm2', code: 'NATIVE_BINDING_VERSION' }, | ||
@@ -387,4 +387,4 @@ ) | ||
| } | ||
| if (bindingPackageVersion !== '0.2.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') { | ||
| throw new Error(`Native binding package version mismatch, expected 0.2.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`) | ||
| if (bindingPackageVersion !== '0.3.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') { | ||
| throw new Error(`Native binding package version mismatch, expected 0.3.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`) | ||
| } | ||
@@ -408,6 +408,6 @@ return binding | ||
| const bindingPackageVersion = require('node-tpm2-freebsd-x64/package.json').version | ||
| if (bindingPackageVersion !== '0.2.0') { | ||
| if (bindingPackageVersion !== '0.3.0') { | ||
| if (typeof process !== 'undefined' && process.emitWarning) { | ||
| process.emitWarning( | ||
| `[node-tpm2] optional binding version ${bindingPackageVersion} !== 0.2.0; run npm install or npm run build`, | ||
| `[node-tpm2] optional binding version ${bindingPackageVersion} !== 0.3.0; run npm install or npm run build`, | ||
| { type: 'node-tpm2', code: 'NATIVE_BINDING_VERSION' }, | ||
@@ -417,6 +417,6 @@ ) | ||
| } | ||
| if (bindingPackageVersion !== '0.2.0') { | ||
| if (bindingPackageVersion !== '0.3.0') { | ||
| if (typeof process !== 'undefined' && process.emitWarning) { | ||
| process.emitWarning( | ||
| `[node-tpm2] optional binding version ${bindingPackageVersion} !== 0.2.0; run npm install or npm run build`, | ||
| `[node-tpm2] optional binding version ${bindingPackageVersion} !== 0.3.0; run npm install or npm run build`, | ||
| { type: 'node-tpm2', code: 'NATIVE_BINDING_VERSION' }, | ||
@@ -426,4 +426,4 @@ ) | ||
| } | ||
| if (bindingPackageVersion !== '0.2.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') { | ||
| throw new Error(`Native binding package version mismatch, expected 0.2.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`) | ||
| if (bindingPackageVersion !== '0.3.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') { | ||
| throw new Error(`Native binding package version mismatch, expected 0.3.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`) | ||
| } | ||
@@ -443,6 +443,6 @@ return binding | ||
| const bindingPackageVersion = require('node-tpm2-freebsd-arm64/package.json').version | ||
| if (bindingPackageVersion !== '0.2.0') { | ||
| if (bindingPackageVersion !== '0.3.0') { | ||
| if (typeof process !== 'undefined' && process.emitWarning) { | ||
| process.emitWarning( | ||
| `[node-tpm2] optional binding version ${bindingPackageVersion} !== 0.2.0; run npm install or npm run build`, | ||
| `[node-tpm2] optional binding version ${bindingPackageVersion} !== 0.3.0; run npm install or npm run build`, | ||
| { type: 'node-tpm2', code: 'NATIVE_BINDING_VERSION' }, | ||
@@ -452,6 +452,6 @@ ) | ||
| } | ||
| if (bindingPackageVersion !== '0.2.0') { | ||
| if (bindingPackageVersion !== '0.3.0') { | ||
| if (typeof process !== 'undefined' && process.emitWarning) { | ||
| process.emitWarning( | ||
| `[node-tpm2] optional binding version ${bindingPackageVersion} !== 0.2.0; run npm install or npm run build`, | ||
| `[node-tpm2] optional binding version ${bindingPackageVersion} !== 0.3.0; run npm install or npm run build`, | ||
| { type: 'node-tpm2', code: 'NATIVE_BINDING_VERSION' }, | ||
@@ -461,4 +461,4 @@ ) | ||
| } | ||
| if (bindingPackageVersion !== '0.2.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') { | ||
| throw new Error(`Native binding package version mismatch, expected 0.2.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`) | ||
| if (bindingPackageVersion !== '0.3.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') { | ||
| throw new Error(`Native binding package version mismatch, expected 0.3.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`) | ||
| } | ||
@@ -483,6 +483,6 @@ return binding | ||
| const bindingPackageVersion = require('node-tpm2-linux-x64-musl/package.json').version | ||
| if (bindingPackageVersion !== '0.2.0') { | ||
| if (bindingPackageVersion !== '0.3.0') { | ||
| if (typeof process !== 'undefined' && process.emitWarning) { | ||
| process.emitWarning( | ||
| `[node-tpm2] optional binding version ${bindingPackageVersion} !== 0.2.0; run npm install or npm run build`, | ||
| `[node-tpm2] optional binding version ${bindingPackageVersion} !== 0.3.0; run npm install or npm run build`, | ||
| { type: 'node-tpm2', code: 'NATIVE_BINDING_VERSION' }, | ||
@@ -492,6 +492,6 @@ ) | ||
| } | ||
| if (bindingPackageVersion !== '0.2.0') { | ||
| if (bindingPackageVersion !== '0.3.0') { | ||
| if (typeof process !== 'undefined' && process.emitWarning) { | ||
| process.emitWarning( | ||
| `[node-tpm2] optional binding version ${bindingPackageVersion} !== 0.2.0; run npm install or npm run build`, | ||
| `[node-tpm2] optional binding version ${bindingPackageVersion} !== 0.3.0; run npm install or npm run build`, | ||
| { type: 'node-tpm2', code: 'NATIVE_BINDING_VERSION' }, | ||
@@ -501,4 +501,4 @@ ) | ||
| } | ||
| if (bindingPackageVersion !== '0.2.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') { | ||
| throw new Error(`Native binding package version mismatch, expected 0.2.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`) | ||
| if (bindingPackageVersion !== '0.3.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') { | ||
| throw new Error(`Native binding package version mismatch, expected 0.3.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`) | ||
| } | ||
@@ -518,6 +518,6 @@ return binding | ||
| const bindingPackageVersion = require('node-tpm2-linux-x64-gnu/package.json').version | ||
| if (bindingPackageVersion !== '0.2.0') { | ||
| if (bindingPackageVersion !== '0.3.0') { | ||
| if (typeof process !== 'undefined' && process.emitWarning) { | ||
| process.emitWarning( | ||
| `[node-tpm2] optional binding version ${bindingPackageVersion} !== 0.2.0; run npm install or npm run build`, | ||
| `[node-tpm2] optional binding version ${bindingPackageVersion} !== 0.3.0; run npm install or npm run build`, | ||
| { type: 'node-tpm2', code: 'NATIVE_BINDING_VERSION' }, | ||
@@ -527,6 +527,6 @@ ) | ||
| } | ||
| if (bindingPackageVersion !== '0.2.0') { | ||
| if (bindingPackageVersion !== '0.3.0') { | ||
| if (typeof process !== 'undefined' && process.emitWarning) { | ||
| process.emitWarning( | ||
| `[node-tpm2] optional binding version ${bindingPackageVersion} !== 0.2.0; run npm install or npm run build`, | ||
| `[node-tpm2] optional binding version ${bindingPackageVersion} !== 0.3.0; run npm install or npm run build`, | ||
| { type: 'node-tpm2', code: 'NATIVE_BINDING_VERSION' }, | ||
@@ -536,4 +536,4 @@ ) | ||
| } | ||
| if (bindingPackageVersion !== '0.2.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') { | ||
| throw new Error(`Native binding package version mismatch, expected 0.2.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`) | ||
| if (bindingPackageVersion !== '0.3.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') { | ||
| throw new Error(`Native binding package version mismatch, expected 0.3.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`) | ||
| } | ||
@@ -555,6 +555,6 @@ return binding | ||
| const bindingPackageVersion = require('node-tpm2-linux-arm64-musl/package.json').version | ||
| if (bindingPackageVersion !== '0.2.0') { | ||
| if (bindingPackageVersion !== '0.3.0') { | ||
| if (typeof process !== 'undefined' && process.emitWarning) { | ||
| process.emitWarning( | ||
| `[node-tpm2] optional binding version ${bindingPackageVersion} !== 0.2.0; run npm install or npm run build`, | ||
| `[node-tpm2] optional binding version ${bindingPackageVersion} !== 0.3.0; run npm install or npm run build`, | ||
| { type: 'node-tpm2', code: 'NATIVE_BINDING_VERSION' }, | ||
@@ -564,6 +564,6 @@ ) | ||
| } | ||
| if (bindingPackageVersion !== '0.2.0') { | ||
| if (bindingPackageVersion !== '0.3.0') { | ||
| if (typeof process !== 'undefined' && process.emitWarning) { | ||
| process.emitWarning( | ||
| `[node-tpm2] optional binding version ${bindingPackageVersion} !== 0.2.0; run npm install or npm run build`, | ||
| `[node-tpm2] optional binding version ${bindingPackageVersion} !== 0.3.0; run npm install or npm run build`, | ||
| { type: 'node-tpm2', code: 'NATIVE_BINDING_VERSION' }, | ||
@@ -573,4 +573,4 @@ ) | ||
| } | ||
| if (bindingPackageVersion !== '0.2.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') { | ||
| throw new Error(`Native binding package version mismatch, expected 0.2.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`) | ||
| if (bindingPackageVersion !== '0.3.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') { | ||
| throw new Error(`Native binding package version mismatch, expected 0.3.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`) | ||
| } | ||
@@ -590,6 +590,6 @@ return binding | ||
| const bindingPackageVersion = require('node-tpm2-linux-arm64-gnu/package.json').version | ||
| if (bindingPackageVersion !== '0.2.0') { | ||
| if (bindingPackageVersion !== '0.3.0') { | ||
| if (typeof process !== 'undefined' && process.emitWarning) { | ||
| process.emitWarning( | ||
| `[node-tpm2] optional binding version ${bindingPackageVersion} !== 0.2.0; run npm install or npm run build`, | ||
| `[node-tpm2] optional binding version ${bindingPackageVersion} !== 0.3.0; run npm install or npm run build`, | ||
| { type: 'node-tpm2', code: 'NATIVE_BINDING_VERSION' }, | ||
@@ -599,6 +599,6 @@ ) | ||
| } | ||
| if (bindingPackageVersion !== '0.2.0') { | ||
| if (bindingPackageVersion !== '0.3.0') { | ||
| if (typeof process !== 'undefined' && process.emitWarning) { | ||
| process.emitWarning( | ||
| `[node-tpm2] optional binding version ${bindingPackageVersion} !== 0.2.0; run npm install or npm run build`, | ||
| `[node-tpm2] optional binding version ${bindingPackageVersion} !== 0.3.0; run npm install or npm run build`, | ||
| { type: 'node-tpm2', code: 'NATIVE_BINDING_VERSION' }, | ||
@@ -608,4 +608,4 @@ ) | ||
| } | ||
| if (bindingPackageVersion !== '0.2.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') { | ||
| throw new Error(`Native binding package version mismatch, expected 0.2.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`) | ||
| if (bindingPackageVersion !== '0.3.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') { | ||
| throw new Error(`Native binding package version mismatch, expected 0.3.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`) | ||
| } | ||
@@ -627,6 +627,6 @@ return binding | ||
| const bindingPackageVersion = require('node-tpm2-linux-arm-musleabihf/package.json').version | ||
| if (bindingPackageVersion !== '0.2.0') { | ||
| if (bindingPackageVersion !== '0.3.0') { | ||
| if (typeof process !== 'undefined' && process.emitWarning) { | ||
| process.emitWarning( | ||
| `[node-tpm2] optional binding version ${bindingPackageVersion} !== 0.2.0; run npm install or npm run build`, | ||
| `[node-tpm2] optional binding version ${bindingPackageVersion} !== 0.3.0; run npm install or npm run build`, | ||
| { type: 'node-tpm2', code: 'NATIVE_BINDING_VERSION' }, | ||
@@ -636,6 +636,6 @@ ) | ||
| } | ||
| if (bindingPackageVersion !== '0.2.0') { | ||
| if (bindingPackageVersion !== '0.3.0') { | ||
| if (typeof process !== 'undefined' && process.emitWarning) { | ||
| process.emitWarning( | ||
| `[node-tpm2] optional binding version ${bindingPackageVersion} !== 0.2.0; run npm install or npm run build`, | ||
| `[node-tpm2] optional binding version ${bindingPackageVersion} !== 0.3.0; run npm install or npm run build`, | ||
| { type: 'node-tpm2', code: 'NATIVE_BINDING_VERSION' }, | ||
@@ -645,4 +645,4 @@ ) | ||
| } | ||
| if (bindingPackageVersion !== '0.2.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') { | ||
| throw new Error(`Native binding package version mismatch, expected 0.2.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`) | ||
| if (bindingPackageVersion !== '0.3.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') { | ||
| throw new Error(`Native binding package version mismatch, expected 0.3.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`) | ||
| } | ||
@@ -662,6 +662,6 @@ return binding | ||
| const bindingPackageVersion = require('node-tpm2-linux-arm-gnueabihf/package.json').version | ||
| if (bindingPackageVersion !== '0.2.0') { | ||
| if (bindingPackageVersion !== '0.3.0') { | ||
| if (typeof process !== 'undefined' && process.emitWarning) { | ||
| process.emitWarning( | ||
| `[node-tpm2] optional binding version ${bindingPackageVersion} !== 0.2.0; run npm install or npm run build`, | ||
| `[node-tpm2] optional binding version ${bindingPackageVersion} !== 0.3.0; run npm install or npm run build`, | ||
| { type: 'node-tpm2', code: 'NATIVE_BINDING_VERSION' }, | ||
@@ -671,6 +671,6 @@ ) | ||
| } | ||
| if (bindingPackageVersion !== '0.2.0') { | ||
| if (bindingPackageVersion !== '0.3.0') { | ||
| if (typeof process !== 'undefined' && process.emitWarning) { | ||
| process.emitWarning( | ||
| `[node-tpm2] optional binding version ${bindingPackageVersion} !== 0.2.0; run npm install or npm run build`, | ||
| `[node-tpm2] optional binding version ${bindingPackageVersion} !== 0.3.0; run npm install or npm run build`, | ||
| { type: 'node-tpm2', code: 'NATIVE_BINDING_VERSION' }, | ||
@@ -680,4 +680,4 @@ ) | ||
| } | ||
| if (bindingPackageVersion !== '0.2.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') { | ||
| throw new Error(`Native binding package version mismatch, expected 0.2.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`) | ||
| if (bindingPackageVersion !== '0.3.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') { | ||
| throw new Error(`Native binding package version mismatch, expected 0.3.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`) | ||
| } | ||
@@ -699,6 +699,6 @@ return binding | ||
| const bindingPackageVersion = require('node-tpm2-linux-loong64-musl/package.json').version | ||
| if (bindingPackageVersion !== '0.2.0') { | ||
| if (bindingPackageVersion !== '0.3.0') { | ||
| if (typeof process !== 'undefined' && process.emitWarning) { | ||
| process.emitWarning( | ||
| `[node-tpm2] optional binding version ${bindingPackageVersion} !== 0.2.0; run npm install or npm run build`, | ||
| `[node-tpm2] optional binding version ${bindingPackageVersion} !== 0.3.0; run npm install or npm run build`, | ||
| { type: 'node-tpm2', code: 'NATIVE_BINDING_VERSION' }, | ||
@@ -708,6 +708,6 @@ ) | ||
| } | ||
| if (bindingPackageVersion !== '0.2.0') { | ||
| if (bindingPackageVersion !== '0.3.0') { | ||
| if (typeof process !== 'undefined' && process.emitWarning) { | ||
| process.emitWarning( | ||
| `[node-tpm2] optional binding version ${bindingPackageVersion} !== 0.2.0; run npm install or npm run build`, | ||
| `[node-tpm2] optional binding version ${bindingPackageVersion} !== 0.3.0; run npm install or npm run build`, | ||
| { type: 'node-tpm2', code: 'NATIVE_BINDING_VERSION' }, | ||
@@ -717,4 +717,4 @@ ) | ||
| } | ||
| if (bindingPackageVersion !== '0.2.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') { | ||
| throw new Error(`Native binding package version mismatch, expected 0.2.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`) | ||
| if (bindingPackageVersion !== '0.3.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') { | ||
| throw new Error(`Native binding package version mismatch, expected 0.3.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`) | ||
| } | ||
@@ -734,6 +734,6 @@ return binding | ||
| const bindingPackageVersion = require('node-tpm2-linux-loong64-gnu/package.json').version | ||
| if (bindingPackageVersion !== '0.2.0') { | ||
| if (bindingPackageVersion !== '0.3.0') { | ||
| if (typeof process !== 'undefined' && process.emitWarning) { | ||
| process.emitWarning( | ||
| `[node-tpm2] optional binding version ${bindingPackageVersion} !== 0.2.0; run npm install or npm run build`, | ||
| `[node-tpm2] optional binding version ${bindingPackageVersion} !== 0.3.0; run npm install or npm run build`, | ||
| { type: 'node-tpm2', code: 'NATIVE_BINDING_VERSION' }, | ||
@@ -743,6 +743,6 @@ ) | ||
| } | ||
| if (bindingPackageVersion !== '0.2.0') { | ||
| if (bindingPackageVersion !== '0.3.0') { | ||
| if (typeof process !== 'undefined' && process.emitWarning) { | ||
| process.emitWarning( | ||
| `[node-tpm2] optional binding version ${bindingPackageVersion} !== 0.2.0; run npm install or npm run build`, | ||
| `[node-tpm2] optional binding version ${bindingPackageVersion} !== 0.3.0; run npm install or npm run build`, | ||
| { type: 'node-tpm2', code: 'NATIVE_BINDING_VERSION' }, | ||
@@ -752,4 +752,4 @@ ) | ||
| } | ||
| if (bindingPackageVersion !== '0.2.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') { | ||
| throw new Error(`Native binding package version mismatch, expected 0.2.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`) | ||
| if (bindingPackageVersion !== '0.3.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') { | ||
| throw new Error(`Native binding package version mismatch, expected 0.3.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`) | ||
| } | ||
@@ -771,6 +771,6 @@ return binding | ||
| const bindingPackageVersion = require('node-tpm2-linux-riscv64-musl/package.json').version | ||
| if (bindingPackageVersion !== '0.2.0') { | ||
| if (bindingPackageVersion !== '0.3.0') { | ||
| if (typeof process !== 'undefined' && process.emitWarning) { | ||
| process.emitWarning( | ||
| `[node-tpm2] optional binding version ${bindingPackageVersion} !== 0.2.0; run npm install or npm run build`, | ||
| `[node-tpm2] optional binding version ${bindingPackageVersion} !== 0.3.0; run npm install or npm run build`, | ||
| { type: 'node-tpm2', code: 'NATIVE_BINDING_VERSION' }, | ||
@@ -780,6 +780,6 @@ ) | ||
| } | ||
| if (bindingPackageVersion !== '0.2.0') { | ||
| if (bindingPackageVersion !== '0.3.0') { | ||
| if (typeof process !== 'undefined' && process.emitWarning) { | ||
| process.emitWarning( | ||
| `[node-tpm2] optional binding version ${bindingPackageVersion} !== 0.2.0; run npm install or npm run build`, | ||
| `[node-tpm2] optional binding version ${bindingPackageVersion} !== 0.3.0; run npm install or npm run build`, | ||
| { type: 'node-tpm2', code: 'NATIVE_BINDING_VERSION' }, | ||
@@ -789,4 +789,4 @@ ) | ||
| } | ||
| if (bindingPackageVersion !== '0.2.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') { | ||
| throw new Error(`Native binding package version mismatch, expected 0.2.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`) | ||
| if (bindingPackageVersion !== '0.3.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') { | ||
| throw new Error(`Native binding package version mismatch, expected 0.3.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`) | ||
| } | ||
@@ -806,6 +806,6 @@ return binding | ||
| const bindingPackageVersion = require('node-tpm2-linux-riscv64-gnu/package.json').version | ||
| if (bindingPackageVersion !== '0.2.0') { | ||
| if (bindingPackageVersion !== '0.3.0') { | ||
| if (typeof process !== 'undefined' && process.emitWarning) { | ||
| process.emitWarning( | ||
| `[node-tpm2] optional binding version ${bindingPackageVersion} !== 0.2.0; run npm install or npm run build`, | ||
| `[node-tpm2] optional binding version ${bindingPackageVersion} !== 0.3.0; run npm install or npm run build`, | ||
| { type: 'node-tpm2', code: 'NATIVE_BINDING_VERSION' }, | ||
@@ -815,6 +815,6 @@ ) | ||
| } | ||
| if (bindingPackageVersion !== '0.2.0') { | ||
| if (bindingPackageVersion !== '0.3.0') { | ||
| if (typeof process !== 'undefined' && process.emitWarning) { | ||
| process.emitWarning( | ||
| `[node-tpm2] optional binding version ${bindingPackageVersion} !== 0.2.0; run npm install or npm run build`, | ||
| `[node-tpm2] optional binding version ${bindingPackageVersion} !== 0.3.0; run npm install or npm run build`, | ||
| { type: 'node-tpm2', code: 'NATIVE_BINDING_VERSION' }, | ||
@@ -824,4 +824,4 @@ ) | ||
| } | ||
| if (bindingPackageVersion !== '0.2.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') { | ||
| throw new Error(`Native binding package version mismatch, expected 0.2.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`) | ||
| if (bindingPackageVersion !== '0.3.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') { | ||
| throw new Error(`Native binding package version mismatch, expected 0.3.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`) | ||
| } | ||
@@ -842,6 +842,6 @@ return binding | ||
| const bindingPackageVersion = require('node-tpm2-linux-ppc64-gnu/package.json').version | ||
| if (bindingPackageVersion !== '0.2.0') { | ||
| if (bindingPackageVersion !== '0.3.0') { | ||
| if (typeof process !== 'undefined' && process.emitWarning) { | ||
| process.emitWarning( | ||
| `[node-tpm2] optional binding version ${bindingPackageVersion} !== 0.2.0; run npm install or npm run build`, | ||
| `[node-tpm2] optional binding version ${bindingPackageVersion} !== 0.3.0; run npm install or npm run build`, | ||
| { type: 'node-tpm2', code: 'NATIVE_BINDING_VERSION' }, | ||
@@ -851,6 +851,6 @@ ) | ||
| } | ||
| if (bindingPackageVersion !== '0.2.0') { | ||
| if (bindingPackageVersion !== '0.3.0') { | ||
| if (typeof process !== 'undefined' && process.emitWarning) { | ||
| process.emitWarning( | ||
| `[node-tpm2] optional binding version ${bindingPackageVersion} !== 0.2.0; run npm install or npm run build`, | ||
| `[node-tpm2] optional binding version ${bindingPackageVersion} !== 0.3.0; run npm install or npm run build`, | ||
| { type: 'node-tpm2', code: 'NATIVE_BINDING_VERSION' }, | ||
@@ -860,4 +860,4 @@ ) | ||
| } | ||
| if (bindingPackageVersion !== '0.2.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') { | ||
| throw new Error(`Native binding package version mismatch, expected 0.2.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`) | ||
| if (bindingPackageVersion !== '0.3.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') { | ||
| throw new Error(`Native binding package version mismatch, expected 0.3.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`) | ||
| } | ||
@@ -877,6 +877,6 @@ return binding | ||
| const bindingPackageVersion = require('node-tpm2-linux-s390x-gnu/package.json').version | ||
| if (bindingPackageVersion !== '0.2.0') { | ||
| if (bindingPackageVersion !== '0.3.0') { | ||
| if (typeof process !== 'undefined' && process.emitWarning) { | ||
| process.emitWarning( | ||
| `[node-tpm2] optional binding version ${bindingPackageVersion} !== 0.2.0; run npm install or npm run build`, | ||
| `[node-tpm2] optional binding version ${bindingPackageVersion} !== 0.3.0; run npm install or npm run build`, | ||
| { type: 'node-tpm2', code: 'NATIVE_BINDING_VERSION' }, | ||
@@ -886,6 +886,6 @@ ) | ||
| } | ||
| if (bindingPackageVersion !== '0.2.0') { | ||
| if (bindingPackageVersion !== '0.3.0') { | ||
| if (typeof process !== 'undefined' && process.emitWarning) { | ||
| process.emitWarning( | ||
| `[node-tpm2] optional binding version ${bindingPackageVersion} !== 0.2.0; run npm install or npm run build`, | ||
| `[node-tpm2] optional binding version ${bindingPackageVersion} !== 0.3.0; run npm install or npm run build`, | ||
| { type: 'node-tpm2', code: 'NATIVE_BINDING_VERSION' }, | ||
@@ -895,4 +895,4 @@ ) | ||
| } | ||
| if (bindingPackageVersion !== '0.2.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') { | ||
| throw new Error(`Native binding package version mismatch, expected 0.2.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`) | ||
| if (bindingPackageVersion !== '0.3.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') { | ||
| throw new Error(`Native binding package version mismatch, expected 0.3.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`) | ||
| } | ||
@@ -916,6 +916,6 @@ return binding | ||
| const bindingPackageVersion = require('node-tpm2-openharmony-arm64/package.json').version | ||
| if (bindingPackageVersion !== '0.2.0') { | ||
| if (bindingPackageVersion !== '0.3.0') { | ||
| if (typeof process !== 'undefined' && process.emitWarning) { | ||
| process.emitWarning( | ||
| `[node-tpm2] optional binding version ${bindingPackageVersion} !== 0.2.0; run npm install or npm run build`, | ||
| `[node-tpm2] optional binding version ${bindingPackageVersion} !== 0.3.0; run npm install or npm run build`, | ||
| { type: 'node-tpm2', code: 'NATIVE_BINDING_VERSION' }, | ||
@@ -925,6 +925,6 @@ ) | ||
| } | ||
| if (bindingPackageVersion !== '0.2.0') { | ||
| if (bindingPackageVersion !== '0.3.0') { | ||
| if (typeof process !== 'undefined' && process.emitWarning) { | ||
| process.emitWarning( | ||
| `[node-tpm2] optional binding version ${bindingPackageVersion} !== 0.2.0; run npm install or npm run build`, | ||
| `[node-tpm2] optional binding version ${bindingPackageVersion} !== 0.3.0; run npm install or npm run build`, | ||
| { type: 'node-tpm2', code: 'NATIVE_BINDING_VERSION' }, | ||
@@ -934,4 +934,4 @@ ) | ||
| } | ||
| if (bindingPackageVersion !== '0.2.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') { | ||
| throw new Error(`Native binding package version mismatch, expected 0.2.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`) | ||
| if (bindingPackageVersion !== '0.3.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') { | ||
| throw new Error(`Native binding package version mismatch, expected 0.3.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`) | ||
| } | ||
@@ -951,6 +951,6 @@ return binding | ||
| const bindingPackageVersion = require('node-tpm2-openharmony-x64/package.json').version | ||
| if (bindingPackageVersion !== '0.2.0') { | ||
| if (bindingPackageVersion !== '0.3.0') { | ||
| if (typeof process !== 'undefined' && process.emitWarning) { | ||
| process.emitWarning( | ||
| `[node-tpm2] optional binding version ${bindingPackageVersion} !== 0.2.0; run npm install or npm run build`, | ||
| `[node-tpm2] optional binding version ${bindingPackageVersion} !== 0.3.0; run npm install or npm run build`, | ||
| { type: 'node-tpm2', code: 'NATIVE_BINDING_VERSION' }, | ||
@@ -960,6 +960,6 @@ ) | ||
| } | ||
| if (bindingPackageVersion !== '0.2.0') { | ||
| if (bindingPackageVersion !== '0.3.0') { | ||
| if (typeof process !== 'undefined' && process.emitWarning) { | ||
| process.emitWarning( | ||
| `[node-tpm2] optional binding version ${bindingPackageVersion} !== 0.2.0; run npm install or npm run build`, | ||
| `[node-tpm2] optional binding version ${bindingPackageVersion} !== 0.3.0; run npm install or npm run build`, | ||
| { type: 'node-tpm2', code: 'NATIVE_BINDING_VERSION' }, | ||
@@ -969,4 +969,4 @@ ) | ||
| } | ||
| if (bindingPackageVersion !== '0.2.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') { | ||
| throw new Error(`Native binding package version mismatch, expected 0.2.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`) | ||
| if (bindingPackageVersion !== '0.3.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') { | ||
| throw new Error(`Native binding package version mismatch, expected 0.3.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`) | ||
| } | ||
@@ -986,6 +986,6 @@ return binding | ||
| const bindingPackageVersion = require('node-tpm2-openharmony-arm/package.json').version | ||
| if (bindingPackageVersion !== '0.2.0') { | ||
| if (bindingPackageVersion !== '0.3.0') { | ||
| if (typeof process !== 'undefined' && process.emitWarning) { | ||
| process.emitWarning( | ||
| `[node-tpm2] optional binding version ${bindingPackageVersion} !== 0.2.0; run npm install or npm run build`, | ||
| `[node-tpm2] optional binding version ${bindingPackageVersion} !== 0.3.0; run npm install or npm run build`, | ||
| { type: 'node-tpm2', code: 'NATIVE_BINDING_VERSION' }, | ||
@@ -995,6 +995,6 @@ ) | ||
| } | ||
| if (bindingPackageVersion !== '0.2.0') { | ||
| if (bindingPackageVersion !== '0.3.0') { | ||
| if (typeof process !== 'undefined' && process.emitWarning) { | ||
| process.emitWarning( | ||
| `[node-tpm2] optional binding version ${bindingPackageVersion} !== 0.2.0; run npm install or npm run build`, | ||
| `[node-tpm2] optional binding version ${bindingPackageVersion} !== 0.3.0; run npm install or npm run build`, | ||
| { type: 'node-tpm2', code: 'NATIVE_BINDING_VERSION' }, | ||
@@ -1004,4 +1004,4 @@ ) | ||
| } | ||
| if (bindingPackageVersion !== '0.2.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') { | ||
| throw new Error(`Native binding package version mismatch, expected 0.2.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`) | ||
| if (bindingPackageVersion !== '0.3.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') { | ||
| throw new Error(`Native binding package version mismatch, expected 0.3.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`) | ||
| } | ||
@@ -1088,2 +1088,3 @@ return binding | ||
| module.exports.decryptKeyBlob = nativeBinding.decryptKeyBlob | ||
| module.exports.getEkPublic = nativeBinding.getEkPublic | ||
| module.exports.getFixedProperties = nativeBinding.getFixedProperties | ||
@@ -1090,0 +1091,0 @@ module.exports.isAvailable = nativeBinding.isAvailable |
+6
-0
@@ -34,2 +34,8 @@ /* auto-generated by NAPI-RS */ | ||
| /** | ||
| * Resolve the endorsement key (RSA → ECC → transient) and return its public area. | ||
| * Same result shape as [`read_public`]. | ||
| */ | ||
| export declare function getEkPublic(): Promise<ReadPublicJs> | ||
| export declare function getFixedProperties(): Promise<FixedPropertiesJs> | ||
@@ -36,0 +42,0 @@ |
+13
-11
| { | ||
| "name": "node-tpm2", | ||
| "version": "0.2.0", | ||
| "version": "0.3.0", | ||
| "description": "TPM 2.0 attestation for Node.js — prebuilt native bindings, PCR quotes, and fleet-ready Windows PCP keys. No tpm2-tools.", | ||
@@ -48,2 +48,3 @@ "type": "module", | ||
| "SECURITY.md", | ||
| "CHANGELOG.md", | ||
| "examples/smoke-test.mjs", | ||
@@ -53,3 +54,4 @@ "examples/nv-smoke.mjs", | ||
| "examples/keys-seal-smoke.mjs", | ||
| "examples/tpm-crypto-verify.mjs" | ||
| "examples/tpm-crypto-verify.mjs", | ||
| "examples/get-ek-public.mjs" | ||
| ], | ||
@@ -99,12 +101,12 @@ "engines": { | ||
| "optionalDependencies": { | ||
| "node-tpm2-windows-x64-msvc": "0.2.0", | ||
| "node-tpm2-windows-arm64-msvc": "0.2.0", | ||
| "node-tpm2-linux-x64-gnu": "0.2.0", | ||
| "node-tpm2-linux-arm64-gnu": "0.2.0", | ||
| "node-tpm2-linux-x64-musl": "0.2.0", | ||
| "node-tpm2-linux-arm64-musl": "0.2.0", | ||
| "node-tpm2-darwin-arm64": "0.2.0", | ||
| "node-tpm2-win32-x64-msvc": "0.2.0", | ||
| "node-tpm2-win32-arm64-msvc": "0.2.0" | ||
| "node-tpm2-windows-x64-msvc": "0.3.0", | ||
| "node-tpm2-windows-arm64-msvc": "0.3.0", | ||
| "node-tpm2-linux-x64-gnu": "0.3.0", | ||
| "node-tpm2-linux-arm64-gnu": "0.3.0", | ||
| "node-tpm2-linux-x64-musl": "0.3.0", | ||
| "node-tpm2-linux-arm64-musl": "0.3.0", | ||
| "node-tpm2-darwin-arm64": "0.3.0", | ||
| "node-tpm2-win32-x64-msvc": "0.3.0", | ||
| "node-tpm2-win32-arm64-msvc": "0.3.0" | ||
| } | ||
| } |
+1
-1
@@ -23,3 +23,3 @@ # node-tpm2 | ||
| **Stable** (`0.0.8`). Full public API implemented and validated on real Windows 11 + Intel TPM and Linux (STM fTPM). [API reference](./docs/api-reference.md) · [Roadmap](./docs/roadmap.md). | ||
| **Stable** (`0.2.0`). Full public API implemented and validated on real Windows 11 + Intel TPM and Linux (STM fTPM). [API reference](./docs/api-reference.md) · [Roadmap](./docs/roadmap.md). | ||
@@ -26,0 +26,0 @@ --- |
Filesystem access
Supply chain riskAccesses the file system, and could potentially read sensitive data.
191781
3.38%20
11.11%2366
4.51%67
1.52%