node-tpm2 0.0.4-beta.1 → 0.0.4-beta.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -1,12 +1,61 @@
1
1
  # node-tpm2
2
2
 
3
- Native TPM 2.0 for Node. Zero tooling at install time — prebuilt napi-rs binaries, no tpm2-tss, no tpm2-tools.
3
+ **TPM 2.0 attestation for Node.js** — prebuilt native bindings, no `tpm2-tools`, no `tpm2-tss`, no Rust toolchain at install time.
4
4
 
5
- | Platform | Backend | Attestation key |
6
- |----------|---------|-----------------|
7
- | Linux | `/dev/tpmrm0` | ECDSA P-256 wrapped blob |
8
- | Windows | TBS + NCrypt PCP | RSA-2048 persisted PCP key |
9
- | macOS | — | Not supported (returns unavailable) |
5
+ Use the TPM your OS already exposes: **TBS + Platform Crypto Provider** on Windows, **`/dev/tpmrm0`** on Linux. One small API for PCR reads, attestation key provisioning, quotes, and credential activation.
6
+
7
+ ```javascript
8
+ import { Tpm } from 'node-tpm2';
9
+
10
+ const tpm = await Tpm.open();
11
+
12
+ const { akPublicDer, akBlob } = await tpm.attest.provisionAk();
13
+ const quote = await tpm.attest.quote({
14
+ akBlob,
15
+ pcrSelection: [0, 1, 7],
16
+ qualifyingData: Buffer.from('your-challenge-nonce'),
17
+ });
18
+
19
+ // quote.message + quote.signature → send to your verifier
20
+ ```
21
+
22
+ ## Why node-tpm2
23
+
24
+ | | node-tpm2 | Shelling out to tpm2-tools |
25
+ |---|-----------|----------------------------|
26
+ | Install | `npm install` + prebuilt `.node` | OS packages, PATH, version drift |
27
+ | API | Async JavaScript, structured errors | Parse CLI output |
28
+ | Windows fleet | Machine-scoped PCP keys, cross-user quote | PCP/NCrypt scripting pain |
29
+ | AK persistence | Wrapped blob (`akBlob`) — no persistent TPM handles in your app | Handle bookkeeping |
30
+
31
+ **Use it when you need:**
32
+
33
+ - **Device attestation** — prove boot/software state via PCR quotes bound to a challenge nonce
34
+ - **Fleet enrollment** — provision a machine-scoped attestation key at install time (Intune, SCCM, GPO); quote at runtime as the logged-in user
35
+ - **Remote verification** — export AK public key (SPKI DER) and quote blobs to your backend; verify with standard TPM quote rules
36
+ - **EK-backed onboarding** — read the EK certificate, activate credentials during enrollment
37
+
38
+ ## How it works
39
+
40
+ ```
41
+ ┌─────────────────────────────────────────────────────────┐
42
+ │ Your Node app (Tpm.open / flat helpers) │
43
+ └──────────────────────────┬──────────────────────────────┘
44
+
45
+ ┌──────────────────────────▼──────────────────────────────┐
46
+ │ node-tpm2 (napi-rs) — command build, sessions, blobs │
47
+ └──────────────┬─────────────────────────┬────────────────┘
48
+ │ │
49
+ Linux │ │ Windows
50
+ ▼ ▼
51
+ /dev/tpmrm0 TBS + NCrypt PCP
52
+ ECDSA P-256 AK RSA-2048 persisted AK
53
+ TPM2B wrapped blob PCP1 (user) / PCP2 (machine)
54
+ ```
55
+
56
+ - **No persistent TPM handles in your process.** You keep an `akBlob` (portable wrapped key material). Each operation loads transiently, signs, and flushes.
57
+ - **Platform-native AK formats.** Linux uses ECDSA P-256 TPM2B blobs; Windows uses Microsoft PCP (`PCP1` user / `PCP2` machine). Verifiers should accept both.
58
+ - **Structured errors.** Failures throw `TpmError` with stable `code`, optional `suggestion`, `tpmRc` (TPM return code), and `hresult` (Windows NCrypt).
10
59
 
11
60
  ## Install
12
61
 
@@ -14,62 +63,103 @@ Native TPM 2.0 for Node. Zero tooling at install time — prebuilt napi-rs binar
14
63
  npm install node-tpm2
15
64
  ```
16
65
 
17
- Requires Node 20+. Resolves a prebuilt `.node` binary for your OS/arch via optional platform packages.
66
+ Node **20+**. npm installs a prebuilt native binary for your OS/arch via optional platform packages.
18
67
 
19
- ## Quick start
68
+ ## API at a glance
69
+
70
+ **Handle style** (grouped operations):
20
71
 
21
72
  ```javascript
22
- import { Tpm } from 'node-tpm2';
73
+ const tpm = await Tpm.open();
23
74
 
24
- if (!(await Tpm.isAvailable())) throw new Error('no TPM');
75
+ await tpm.info(); // manufacturer, firmware, virtual-TPM hint
76
+ await tpm.pcr.read([0, 1, 7]); // SHA-256 PCR digests
77
+ await tpm.attest.ekCertificate(); // EK cert from NV, or null
25
78
 
26
- const { akBlob } = await Tpm.provisionAk();
27
- const quote = await Tpm.quote({
28
- akBlob,
29
- pcrSelection: [0, 1, 7],
30
- qualifyingData: Buffer.from('challenge-bytes'),
31
- });
79
+ const ak = await tpm.attest.provisionAk(); // returns AkHandle
80
+ await ak.quote({ pcrSelection: [7], qualifyingData: nonce });
81
+ await ak.export(); // persist akBlob
82
+ await ak.activateCredential({ credentialBlob, secret });
83
+
84
+ await using tpm = await Tpm.open(); // Symbol.asyncDispose when done
85
+ ```
86
+
87
+ **Flat style** (same operations, functional entry points):
88
+
89
+ ```javascript
90
+ await Tpm.isAvailable();
91
+ await Tpm.provisionAk({ keyName: 'my-app-ak' });
92
+ await Tpm.quote({ akBlob, pcrSelection: [0], qualifyingData: nonce });
93
+ await Tpm.pcrRead([0, 1, 7]);
94
+ await Tpm.readEkCertificate();
95
+ await Tpm.activateCredential({ akBlob, credentialBlob, secret });
96
+ ```
97
+
98
+ Errors:
99
+
100
+ ```javascript
101
+ try {
102
+ await Tpm.provisionAk({ scope: 'machine', keyName: 'fleet-ak' });
103
+ } catch (err) {
104
+ if (err.code === 'REQUIRES_ELEVATION') {
105
+ // Windows: machine keys need Admin/SYSTEM at provision time only
106
+ }
107
+ }
32
108
  ```
33
109
 
34
- See [docs/getting-started.md](./docs/getting-started.md) for API details and [docs/windows-pcp.md](./docs/windows-pcp.md) for Windows machine-scoped keys (privileged install → unprivileged quote).
110
+ Full reference: [docs/getting-started.md](./docs/getting-started.md) · Windows fleet: [docs/windows-pcp.md](./docs/windows-pcp.md)
111
+
112
+ ## Privileges (honest summary)
113
+
114
+ There is **no separate TPM daemon to install**, but the OS still controls access:
115
+
116
+ | | Linux | Windows |
117
+ |---|-------|---------|
118
+ | **Typical runtime** (quote, PCR read) | User in `tss` group (or equivalent access to `/dev/tpmrm0`) | Standard user — no elevation |
119
+ | **User-scoped AK** (`provisionAk()`) | Same as runtime | Standard user |
120
+ | **Machine-scoped AK** (`scope: 'machine'`) | N/A | **Admin or SYSTEM at enrollment** — then standard users quote with the saved blob |
121
+ | **Credential activation** | TPM policy dependent | Elevated / SYSTEM |
35
122
 
36
- ## Validate install (clean machine)
123
+ **Fleet pattern:** installer runs once elevated (or as SYSTEM) → saves `akBlob` → app quotes unprivileged forever after. See [docs/windows-pcp.md](./docs/windows-pcp.md).
37
124
 
38
- After `npm install`, run the npm smoke test — **not** the Rust probe:
125
+ ## Validate your install
39
126
 
40
127
  ```bash
128
+ npm ls node-tpm2
41
129
  node node_modules/node-tpm2/examples/smoke-test.mjs runtime
42
130
  ```
43
131
 
44
- Windows fleet path (Admin/SYSTEM provision, then standard user quote):
132
+ Windows fleet smoke (elevated provision, then standard-user quote):
45
133
 
46
134
  ```bash
47
135
  node node_modules/node-tpm2/examples/smoke-test.mjs provision-machine --key-name my-app-device-ak --out ak.blob.json
48
136
  node node_modules/node-tpm2/examples/smoke-test.mjs quote --in ak.blob.json
49
137
  ```
50
138
 
51
- ## Development (this repo)
139
+ Use paths under `node_modules/node-tpm2/` after `npm install` (not `examples/` at the project root).
140
+
141
+ ## Platform support
142
+
143
+ | Platform | Status | Attestation key |
144
+ |----------|--------|-----------------|
145
+ | Linux (glibc/musl, x64/arm64) | Supported | ECDSA P-256 TPM2B |
146
+ | Windows (x64/arm64) | Supported | RSA-2048 PCP |
147
+ | macOS | Not supported (`isAvailable()` → false) | — |
148
+
149
+ ## Development
52
150
 
53
151
  ```bash
54
- git clone https://github.com/stacks0x/tpm2.git
55
- cd tpm2
56
- npm install
57
- npm run build
152
+ git clone https://github.com/stacks0x/tpm2.git && cd tpm2
153
+ npm install && npm run build
58
154
  node examples/smoke-test.mjs runtime
59
155
  ```
60
156
 
61
- Rust probe (developers, not the npm artifact):
157
+ Rust probe for low-level validation (repo only, **not** published to npm):
62
158
 
63
159
  ```powershell
64
- cargo build --no-default-features --features probe-bin --bin tbs-probe
65
- .\target\debug\tbs-probe.exe all
66
- .\target\debug\tbs-probe.exe help
160
+ cargo run --no-default-features --features probe-bin --bin tbs-probe -- all
67
161
  ```
68
162
 
69
- Linux: user needs access to `/dev/tpmrm0` (typically the `tss` group).
70
-
71
- Maintainer-only planning docs (release checklists, specs) go in `docs/dev/` — that folder is gitignored and never published.
72
-
73
163
  ## License
74
164
 
75
165
  Apache-2.0
package/api.js CHANGED
@@ -19,13 +19,15 @@ function parseNativeError(err) {
19
19
  if (msg.startsWith('__tpm2__')) {
20
20
  const rest = msg.slice('__tpm2__'.length);
21
21
  const parts = rest.split('|');
22
- const [code, message, suggestion, tpmRcStr] = parts;
22
+ const [code, message, suggestion, tpmRcStr, hresultStr] = parts;
23
23
  const tpmRc = tpmRcStr ? Number.parseInt(tpmRcStr, 10) : undefined;
24
+ const hresult = hresultStr ? Number.parseInt(hresultStr, 10) : undefined;
24
25
  return new TpmError(
25
26
  code,
26
27
  message,
27
28
  suggestion || undefined,
28
29
  Number.isFinite(tpmRc) ? tpmRc : undefined,
30
+ Number.isFinite(hresult) ? hresult : undefined,
29
31
  );
30
32
  }
31
33
  return err;
@@ -54,12 +56,13 @@ function requireNative(method) {
54
56
  }
55
57
 
56
58
  export class TpmError extends Error {
57
- constructor(code, message, suggestion, tpmRc) {
59
+ constructor(code, message, suggestion, tpmRc, hresult) {
58
60
  super(message);
59
61
  this.name = 'TpmError';
60
62
  this.code = code;
61
63
  this.suggestion = suggestion;
62
64
  this.tpmRc = tpmRc;
65
+ this.hresult = hresult;
63
66
  }
64
67
  }
65
68
 
@@ -1,11 +1,6 @@
1
1
  # Getting started
2
2
 
3
- node-tpm2 talks to the TPM 2.0 through OS-native pathsno tpm2-tools, no tpm2-tss, and no Rust toolchain at install time.
4
-
5
- | Platform | Transport | Attestation key (AK) |
6
- |----------|-----------|----------------------|
7
- | Linux | `/dev/tpmrm0` | ECDSA P-256 wrapped TPM2B blob |
8
- | Windows | TBS + NCrypt PCP | RSA-2048 persisted PCP key (`PCP1` / `PCP2` blob) |
3
+ node-tpm2 exposes TPM 2.0 attestation through a small JavaScript API. Install is a normal npm dependency prebuilt native binaries, no `tpm2-tools` or Rust toolchain on the target machine.
9
4
 
10
5
  ## Install
11
6
 
@@ -13,26 +8,33 @@ node-tpm2 talks to the TPM 2.0 through OS-native paths — no tpm2-tools, no tpm
13
8
  npm install node-tpm2
14
9
  ```
15
10
 
16
- Requires Node 20+. npm pulls a prebuilt native binary for your OS/arch from optional platform packages (`node-tpm2-windows-x64-msvc`, `node-tpm2-linux-x64-gnu`, etc.).
11
+ Requires Node 20+. Platform binaries resolve automatically (`node-tpm2-windows-x64-msvc`, `node-tpm2-linux-x64-gnu`, etc.).
17
12
 
18
- ## Quick check
13
+ ## Check the TPM
19
14
 
20
15
  ```javascript
21
16
  import { Tpm } from 'node-tpm2';
22
17
 
23
- console.log('available', await Tpm.isAvailable());
24
- console.log('info', await Tpm.info());
18
+ if (!(await Tpm.isAvailable())) {
19
+ throw new Error('No accessible TPM');
20
+ }
21
+
22
+ const info = await Tpm.info();
23
+ console.log(info.manufacturer, info.firmwareVersion, info.isVirtual);
25
24
  ```
26
25
 
27
- ## Provision and quote (development)
26
+ ## Provision and quote
27
+
28
+ ### User-scoped (development and same-user apps)
28
29
 
29
- Works **without admin** on both Linux and Windows (user-scoped AK on Windows):
30
+ Works as a **standard user** on Windows and Linux (with `/dev/tpmrm0` access):
30
31
 
31
32
  ```javascript
32
33
  import { Tpm } from 'node-tpm2';
33
34
 
34
35
  const { akPublicDer, akBlob } = await Tpm.provisionAk();
35
- console.log('AK SPKI', akPublicDer.length, 'bytes');
36
+ // akPublicDer → register with your verifier
37
+ // akBlob → persist locally (encrypted at rest in your app)
36
38
 
37
39
  const quote = await Tpm.quote({
38
40
  akBlob,
@@ -40,23 +42,36 @@ const quote = await Tpm.quote({
40
42
  qualifyingData: Buffer.from('session-nonce-or-challenge'),
41
43
  bank: 'sha256',
42
44
  });
43
- console.log('quote', quote.message.length, quote.signature.length);
45
+ // quote.message, quote.signature → send to verifier
46
+ ```
47
+
48
+ ### Handle style
49
+
50
+ ```javascript
51
+ const tpm = await Tpm.open();
52
+ const ak = await tpm.attest.provisionAk();
53
+
54
+ const quote = await ak.quote({
55
+ pcrSelection: [0, 1, 7],
56
+ qualifyingData: Buffer.from('challenge'),
57
+ });
58
+
59
+ const saved = ak.export(); // { public, private } buffers for storage
44
60
  ```
45
61
 
46
- ## Windows: machine-scoped AK (cross-user)
62
+ ## Windows: machine-scoped AK (fleet)
47
63
 
48
- For apps where a **privileged installer** creates the key and a **standard user** quotes at runtime, use a machine-scoped key with a stable name. See [windows-pcp.md](./windows-pcp.md).
64
+ When a **privileged installer** creates the key and a **standard user** quotes at runtime:
49
65
 
50
66
  ```javascript
51
- // Run elevated or as SYSTEM (enrollment / install time only)
67
+ // Enrollment Admin or SYSTEM only (once per device)
52
68
  const { akBlob } = await Tpm.provisionAk({
53
69
  keyName: 'my-app-device-ak',
54
70
  scope: 'machine',
55
71
  overwrite: true,
56
72
  });
57
- // Persist akBlob (and upload creation attestation to your verifier)
58
73
 
59
- // Runtime — standard user, no admin
74
+ // Runtime — standard user, no elevation
60
75
  const quote = await Tpm.quote({
61
76
  akBlob,
62
77
  pcrSelection: [0, 1, 7],
@@ -64,14 +79,50 @@ const quote = await Tpm.quote({
64
79
  });
65
80
  ```
66
81
 
82
+ See [windows-pcp.md](./windows-pcp.md) for PCP details, DACL behavior, and SYSTEM enrollment.
83
+
67
84
  ## Linux permissions
68
85
 
69
- Your user needs read/write on `/dev/tpmrm0` (commonly the `tss` group):
86
+ Read/write on `/dev/tpmrm0` (commonly membership in the `tss` group):
70
87
 
71
88
  ```bash
72
89
  sudo usermod -aG tss "$USER"
90
+ # log out and back in
73
91
  ```
74
92
 
75
93
  ## Errors
76
94
 
77
- Native failures surface as `TpmError` with `code`, `message`, optional `suggestion`, and `tpmRc` when the TPM returned an RC.
95
+ Native failures throw `TpmError`:
96
+
97
+ | Field | Meaning |
98
+ |-------|---------|
99
+ | `code` | Stable string (`TPM_UNAVAILABLE`, `REQUIRES_ELEVATION`, `ACCESS_DENIED`, …) |
100
+ | `message` | Human-readable detail |
101
+ | `suggestion` | Optional remediation hint |
102
+ | `tpmRc` | TPM 2.0 return code when applicable |
103
+ | `hresult` | Windows NCrypt HRESULT when applicable |
104
+
105
+ ```javascript
106
+ import { Tpm, TpmError } from 'node-tpm2';
107
+
108
+ try {
109
+ await Tpm.provisionAk({ scope: 'machine', keyName: 'x' });
110
+ } catch (err) {
111
+ if (err instanceof TpmError && err.code === 'REQUIRES_ELEVATION') {
112
+ // Run enrollment elevated or as SYSTEM
113
+ }
114
+ }
115
+ ```
116
+
117
+ ## Validate after install
118
+
119
+ ```bash
120
+ npm ls node-tpm2
121
+ node node_modules/node-tpm2/examples/smoke-test.mjs runtime
122
+ ```
123
+
124
+ Smoke-test is under `node_modules/node-tpm2/examples/` after `npm install`, not `./examples/` at your project root.
125
+
126
+ ## What ships in npm
127
+
128
+ The published package contains the JavaScript API, type definitions, user docs, and the smoke-test example — **not** Rust sources, `tbs-probe`, or spike binaries. Those stay in the git repo for developers.
@@ -43,6 +43,10 @@ Requirements:
43
43
 
44
44
  PCP identity keys are RSA-2048. Quotes use `TPM_ALG_NULL` (key default RSASSA), matching go-attestation. Linux uses explicit ECDSA+SHA256.
45
45
 
46
+ ## Errors at enrollment time
47
+
48
+ Machine provisioning from a standard user returns `TpmError` with `code: 'REQUIRES_ELEVATION'` and an NCrypt `hresult`. Runtime quote failures use the same structured error shape (`tpmRc` for TPM, `hresult` for PCP/NCrypt).
49
+
46
50
  ## Validating with `tbs-probe` (Rust, developers only)
47
51
 
48
52
  The npm module and `tbs-probe` share the same Rust core but are **different artifacts**. Validate Rust with the probe; validate the **npm package** with [examples/smoke-test.mjs](../examples/smoke-test.mjs) on a clean machine.
@@ -127,8 +127,8 @@ async function runProvisionMachine(args) {
127
127
  saveBlob(out, akBlob);
128
128
  console.log(`PASS Tpm.provisionAk(machine) keyName=${keyName} SPKI=${akPublicDer.length}B`);
129
129
  console.log(` wrote ${out}`);
130
- console.log('\nNEXT (standard user):');
131
- console.log(` node examples/smoke-test.mjs quote --in ${out}`);
130
+ console.log('\nNEXT (standard user, from your project directory):');
131
+ console.log(` node node_modules/node-tpm2/examples/smoke-test.mjs quote --in ${out}`);
132
132
  }
133
133
 
134
134
  async function runQuote(args) {
@@ -172,7 +172,9 @@ async function main() {
172
172
 
173
173
  main().catch((err) => {
174
174
  console.error('FAIL:', err.message ?? err);
175
+ if (err.code) console.error(' code:', err.code);
175
176
  if (err.suggestion) console.error(' suggestion:', err.suggestion);
176
177
  if (err.tpmRc != null) console.error(' tpmRc:', err.tpmRc);
178
+ if (err.hresult != null) console.error(' hresult:', err.hresult);
177
179
  process.exit(1);
178
180
  });
package/index.d.ts CHANGED
@@ -1,10 +1,32 @@
1
1
  export declare class TpmError extends Error {
2
- code: string;
2
+ code: TpmErrorCode;
3
3
  suggestion?: string;
4
4
  tpmRc?: number;
5
- constructor(code: string, message: string, suggestion?: string, tpmRc?: number);
5
+ hresult?: number;
6
+ constructor(
7
+ code: TpmErrorCode,
8
+ message: string,
9
+ suggestion?: string,
10
+ tpmRc?: number,
11
+ hresult?: number,
12
+ );
6
13
  }
7
14
 
15
+ /** Stable error codes — match Rust `src/tbs/codes.rs`. Semver after `latest`. */
16
+ export declare type TpmErrorCode =
17
+ | 'TPM_UNAVAILABLE'
18
+ | 'ACCESS_DENIED'
19
+ | 'COMMAND_BLOCKED'
20
+ | 'REQUIRES_ELEVATION'
21
+ | 'NOT_SUPPORTED'
22
+ | 'INVALID_ARGUMENT'
23
+ | 'KEY_NOT_FOUND'
24
+ | 'ALREADY_EXISTS'
25
+ | 'MARSHALLING_ERROR'
26
+ | 'TRANSPORT_ERROR'
27
+ | 'AUTH_FAILED'
28
+ | 'TPM_RC';
29
+
8
30
  export declare type AkBlob = {
9
31
  public: Buffer;
10
32
  private: Buffer;
package/native.cjs CHANGED
@@ -77,8 +77,8 @@ function requireNative() {
77
77
  try {
78
78
  const binding = require('node-tpm2-android-arm64')
79
79
  const bindingPackageVersion = require('node-tpm2-android-arm64/package.json').version
80
- if (bindingPackageVersion !== '0.0.4-beta.1' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
81
- throw new Error(`Native binding package version mismatch, expected 0.0.4-beta.1 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
80
+ if (bindingPackageVersion !== '0.0.4-beta.3' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
81
+ throw new Error(`Native binding package version mismatch, expected 0.0.4-beta.3 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
82
82
  }
83
83
  return binding
84
84
  } catch (e) {
@@ -93,8 +93,8 @@ function requireNative() {
93
93
  try {
94
94
  const binding = require('node-tpm2-android-arm-eabi')
95
95
  const bindingPackageVersion = require('node-tpm2-android-arm-eabi/package.json').version
96
- if (bindingPackageVersion !== '0.0.4-beta.1' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
97
- throw new Error(`Native binding package version mismatch, expected 0.0.4-beta.1 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
96
+ if (bindingPackageVersion !== '0.0.4-beta.3' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
97
+ throw new Error(`Native binding package version mismatch, expected 0.0.4-beta.3 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
98
98
  }
99
99
  return binding
100
100
  } catch (e) {
@@ -114,8 +114,8 @@ function requireNative() {
114
114
  try {
115
115
  const binding = require('node-tpm2-win32-x64-gnu')
116
116
  const bindingPackageVersion = require('node-tpm2-win32-x64-gnu/package.json').version
117
- if (bindingPackageVersion !== '0.0.4-beta.1' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
118
- throw new Error(`Native binding package version mismatch, expected 0.0.4-beta.1 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
117
+ if (bindingPackageVersion !== '0.0.4-beta.3' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
118
+ throw new Error(`Native binding package version mismatch, expected 0.0.4-beta.3 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
119
119
  }
120
120
  return binding
121
121
  } catch (e) {
@@ -130,8 +130,8 @@ function requireNative() {
130
130
  try {
131
131
  const binding = require('node-tpm2-windows-x64-msvc')
132
132
  const bindingPackageVersion = require('node-tpm2-windows-x64-msvc/package.json').version
133
- if (bindingPackageVersion !== '0.0.4-beta.1' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
134
- throw new Error(`Native binding package version mismatch, expected 0.0.4-beta.1 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
133
+ if (bindingPackageVersion !== '0.0.4-beta.3' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
134
+ throw new Error(`Native binding package version mismatch, expected 0.0.4-beta.3 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
135
135
  }
136
136
  return binding
137
137
  } catch (e) {
@@ -147,8 +147,8 @@ function requireNative() {
147
147
  try {
148
148
  const binding = require('node-tpm2-win32-ia32-msvc')
149
149
  const bindingPackageVersion = require('node-tpm2-win32-ia32-msvc/package.json').version
150
- if (bindingPackageVersion !== '0.0.4-beta.1' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
151
- throw new Error(`Native binding package version mismatch, expected 0.0.4-beta.1 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
150
+ if (bindingPackageVersion !== '0.0.4-beta.3' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
151
+ throw new Error(`Native binding package version mismatch, expected 0.0.4-beta.3 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
152
152
  }
153
153
  return binding
154
154
  } catch (e) {
@@ -163,8 +163,8 @@ function requireNative() {
163
163
  try {
164
164
  const binding = require('node-tpm2-windows-arm64-msvc')
165
165
  const bindingPackageVersion = require('node-tpm2-windows-arm64-msvc/package.json').version
166
- if (bindingPackageVersion !== '0.0.4-beta.1' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
167
- throw new Error(`Native binding package version mismatch, expected 0.0.4-beta.1 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
166
+ if (bindingPackageVersion !== '0.0.4-beta.3' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
167
+ throw new Error(`Native binding package version mismatch, expected 0.0.4-beta.3 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
168
168
  }
169
169
  return binding
170
170
  } catch (e) {
@@ -182,8 +182,8 @@ function requireNative() {
182
182
  try {
183
183
  const binding = require('node-tpm2-darwin-universal')
184
184
  const bindingPackageVersion = require('node-tpm2-darwin-universal/package.json').version
185
- if (bindingPackageVersion !== '0.0.4-beta.1' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
186
- throw new Error(`Native binding package version mismatch, expected 0.0.4-beta.1 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
185
+ if (bindingPackageVersion !== '0.0.4-beta.3' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
186
+ throw new Error(`Native binding package version mismatch, expected 0.0.4-beta.3 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
187
187
  }
188
188
  return binding
189
189
  } catch (e) {
@@ -198,8 +198,8 @@ function requireNative() {
198
198
  try {
199
199
  const binding = require('node-tpm2-darwin-x64')
200
200
  const bindingPackageVersion = require('node-tpm2-darwin-x64/package.json').version
201
- if (bindingPackageVersion !== '0.0.4-beta.1' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
202
- throw new Error(`Native binding package version mismatch, expected 0.0.4-beta.1 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
201
+ if (bindingPackageVersion !== '0.0.4-beta.3' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
202
+ throw new Error(`Native binding package version mismatch, expected 0.0.4-beta.3 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
203
203
  }
204
204
  return binding
205
205
  } catch (e) {
@@ -214,8 +214,8 @@ function requireNative() {
214
214
  try {
215
215
  const binding = require('node-tpm2-darwin-arm64')
216
216
  const bindingPackageVersion = require('node-tpm2-darwin-arm64/package.json').version
217
- if (bindingPackageVersion !== '0.0.4-beta.1' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
218
- throw new Error(`Native binding package version mismatch, expected 0.0.4-beta.1 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
217
+ if (bindingPackageVersion !== '0.0.4-beta.3' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
218
+ throw new Error(`Native binding package version mismatch, expected 0.0.4-beta.3 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
219
219
  }
220
220
  return binding
221
221
  } catch (e) {
@@ -234,8 +234,8 @@ function requireNative() {
234
234
  try {
235
235
  const binding = require('node-tpm2-freebsd-x64')
236
236
  const bindingPackageVersion = require('node-tpm2-freebsd-x64/package.json').version
237
- if (bindingPackageVersion !== '0.0.4-beta.1' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
238
- throw new Error(`Native binding package version mismatch, expected 0.0.4-beta.1 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
237
+ if (bindingPackageVersion !== '0.0.4-beta.3' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
238
+ throw new Error(`Native binding package version mismatch, expected 0.0.4-beta.3 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
239
239
  }
240
240
  return binding
241
241
  } catch (e) {
@@ -250,8 +250,8 @@ function requireNative() {
250
250
  try {
251
251
  const binding = require('node-tpm2-freebsd-arm64')
252
252
  const bindingPackageVersion = require('node-tpm2-freebsd-arm64/package.json').version
253
- if (bindingPackageVersion !== '0.0.4-beta.1' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
254
- throw new Error(`Native binding package version mismatch, expected 0.0.4-beta.1 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
253
+ if (bindingPackageVersion !== '0.0.4-beta.3' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
254
+ throw new Error(`Native binding package version mismatch, expected 0.0.4-beta.3 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
255
255
  }
256
256
  return binding
257
257
  } catch (e) {
@@ -271,8 +271,8 @@ function requireNative() {
271
271
  try {
272
272
  const binding = require('node-tpm2-linux-x64-musl')
273
273
  const bindingPackageVersion = require('node-tpm2-linux-x64-musl/package.json').version
274
- if (bindingPackageVersion !== '0.0.4-beta.1' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
275
- throw new Error(`Native binding package version mismatch, expected 0.0.4-beta.1 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
274
+ if (bindingPackageVersion !== '0.0.4-beta.3' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
275
+ throw new Error(`Native binding package version mismatch, expected 0.0.4-beta.3 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
276
276
  }
277
277
  return binding
278
278
  } catch (e) {
@@ -287,8 +287,8 @@ function requireNative() {
287
287
  try {
288
288
  const binding = require('node-tpm2-linux-x64-gnu')
289
289
  const bindingPackageVersion = require('node-tpm2-linux-x64-gnu/package.json').version
290
- if (bindingPackageVersion !== '0.0.4-beta.1' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
291
- throw new Error(`Native binding package version mismatch, expected 0.0.4-beta.1 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
290
+ if (bindingPackageVersion !== '0.0.4-beta.3' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
291
+ throw new Error(`Native binding package version mismatch, expected 0.0.4-beta.3 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
292
292
  }
293
293
  return binding
294
294
  } catch (e) {
@@ -305,8 +305,8 @@ function requireNative() {
305
305
  try {
306
306
  const binding = require('node-tpm2-linux-arm64-musl')
307
307
  const bindingPackageVersion = require('node-tpm2-linux-arm64-musl/package.json').version
308
- if (bindingPackageVersion !== '0.0.4-beta.1' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
309
- throw new Error(`Native binding package version mismatch, expected 0.0.4-beta.1 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
308
+ if (bindingPackageVersion !== '0.0.4-beta.3' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
309
+ throw new Error(`Native binding package version mismatch, expected 0.0.4-beta.3 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
310
310
  }
311
311
  return binding
312
312
  } catch (e) {
@@ -321,8 +321,8 @@ function requireNative() {
321
321
  try {
322
322
  const binding = require('node-tpm2-linux-arm64-gnu')
323
323
  const bindingPackageVersion = require('node-tpm2-linux-arm64-gnu/package.json').version
324
- if (bindingPackageVersion !== '0.0.4-beta.1' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
325
- throw new Error(`Native binding package version mismatch, expected 0.0.4-beta.1 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
324
+ if (bindingPackageVersion !== '0.0.4-beta.3' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
325
+ throw new Error(`Native binding package version mismatch, expected 0.0.4-beta.3 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
326
326
  }
327
327
  return binding
328
328
  } catch (e) {
@@ -339,8 +339,8 @@ function requireNative() {
339
339
  try {
340
340
  const binding = require('node-tpm2-linux-arm-musleabihf')
341
341
  const bindingPackageVersion = require('node-tpm2-linux-arm-musleabihf/package.json').version
342
- if (bindingPackageVersion !== '0.0.4-beta.1' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
343
- throw new Error(`Native binding package version mismatch, expected 0.0.4-beta.1 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
342
+ if (bindingPackageVersion !== '0.0.4-beta.3' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
343
+ throw new Error(`Native binding package version mismatch, expected 0.0.4-beta.3 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
344
344
  }
345
345
  return binding
346
346
  } catch (e) {
@@ -355,8 +355,8 @@ function requireNative() {
355
355
  try {
356
356
  const binding = require('node-tpm2-linux-arm-gnueabihf')
357
357
  const bindingPackageVersion = require('node-tpm2-linux-arm-gnueabihf/package.json').version
358
- if (bindingPackageVersion !== '0.0.4-beta.1' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
359
- throw new Error(`Native binding package version mismatch, expected 0.0.4-beta.1 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
358
+ if (bindingPackageVersion !== '0.0.4-beta.3' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
359
+ throw new Error(`Native binding package version mismatch, expected 0.0.4-beta.3 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
360
360
  }
361
361
  return binding
362
362
  } catch (e) {
@@ -373,8 +373,8 @@ function requireNative() {
373
373
  try {
374
374
  const binding = require('node-tpm2-linux-loong64-musl')
375
375
  const bindingPackageVersion = require('node-tpm2-linux-loong64-musl/package.json').version
376
- if (bindingPackageVersion !== '0.0.4-beta.1' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
377
- throw new Error(`Native binding package version mismatch, expected 0.0.4-beta.1 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
376
+ if (bindingPackageVersion !== '0.0.4-beta.3' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
377
+ throw new Error(`Native binding package version mismatch, expected 0.0.4-beta.3 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
378
378
  }
379
379
  return binding
380
380
  } catch (e) {
@@ -389,8 +389,8 @@ function requireNative() {
389
389
  try {
390
390
  const binding = require('node-tpm2-linux-loong64-gnu')
391
391
  const bindingPackageVersion = require('node-tpm2-linux-loong64-gnu/package.json').version
392
- if (bindingPackageVersion !== '0.0.4-beta.1' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
393
- throw new Error(`Native binding package version mismatch, expected 0.0.4-beta.1 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
392
+ if (bindingPackageVersion !== '0.0.4-beta.3' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
393
+ throw new Error(`Native binding package version mismatch, expected 0.0.4-beta.3 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
394
394
  }
395
395
  return binding
396
396
  } catch (e) {
@@ -407,8 +407,8 @@ function requireNative() {
407
407
  try {
408
408
  const binding = require('node-tpm2-linux-riscv64-musl')
409
409
  const bindingPackageVersion = require('node-tpm2-linux-riscv64-musl/package.json').version
410
- if (bindingPackageVersion !== '0.0.4-beta.1' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
411
- throw new Error(`Native binding package version mismatch, expected 0.0.4-beta.1 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
410
+ if (bindingPackageVersion !== '0.0.4-beta.3' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
411
+ throw new Error(`Native binding package version mismatch, expected 0.0.4-beta.3 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
412
412
  }
413
413
  return binding
414
414
  } catch (e) {
@@ -423,8 +423,8 @@ function requireNative() {
423
423
  try {
424
424
  const binding = require('node-tpm2-linux-riscv64-gnu')
425
425
  const bindingPackageVersion = require('node-tpm2-linux-riscv64-gnu/package.json').version
426
- if (bindingPackageVersion !== '0.0.4-beta.1' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
427
- throw new Error(`Native binding package version mismatch, expected 0.0.4-beta.1 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
426
+ if (bindingPackageVersion !== '0.0.4-beta.3' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
427
+ throw new Error(`Native binding package version mismatch, expected 0.0.4-beta.3 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
428
428
  }
429
429
  return binding
430
430
  } catch (e) {
@@ -440,8 +440,8 @@ function requireNative() {
440
440
  try {
441
441
  const binding = require('node-tpm2-linux-ppc64-gnu')
442
442
  const bindingPackageVersion = require('node-tpm2-linux-ppc64-gnu/package.json').version
443
- if (bindingPackageVersion !== '0.0.4-beta.1' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
444
- throw new Error(`Native binding package version mismatch, expected 0.0.4-beta.1 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
443
+ if (bindingPackageVersion !== '0.0.4-beta.3' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
444
+ throw new Error(`Native binding package version mismatch, expected 0.0.4-beta.3 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
445
445
  }
446
446
  return binding
447
447
  } catch (e) {
@@ -456,8 +456,8 @@ function requireNative() {
456
456
  try {
457
457
  const binding = require('node-tpm2-linux-s390x-gnu')
458
458
  const bindingPackageVersion = require('node-tpm2-linux-s390x-gnu/package.json').version
459
- if (bindingPackageVersion !== '0.0.4-beta.1' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
460
- throw new Error(`Native binding package version mismatch, expected 0.0.4-beta.1 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
459
+ if (bindingPackageVersion !== '0.0.4-beta.3' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
460
+ throw new Error(`Native binding package version mismatch, expected 0.0.4-beta.3 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
461
461
  }
462
462
  return binding
463
463
  } catch (e) {
@@ -476,8 +476,8 @@ function requireNative() {
476
476
  try {
477
477
  const binding = require('node-tpm2-openharmony-arm64')
478
478
  const bindingPackageVersion = require('node-tpm2-openharmony-arm64/package.json').version
479
- if (bindingPackageVersion !== '0.0.4-beta.1' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
480
- throw new Error(`Native binding package version mismatch, expected 0.0.4-beta.1 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
479
+ if (bindingPackageVersion !== '0.0.4-beta.3' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
480
+ throw new Error(`Native binding package version mismatch, expected 0.0.4-beta.3 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
481
481
  }
482
482
  return binding
483
483
  } catch (e) {
@@ -492,8 +492,8 @@ function requireNative() {
492
492
  try {
493
493
  const binding = require('node-tpm2-openharmony-x64')
494
494
  const bindingPackageVersion = require('node-tpm2-openharmony-x64/package.json').version
495
- if (bindingPackageVersion !== '0.0.4-beta.1' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
496
- throw new Error(`Native binding package version mismatch, expected 0.0.4-beta.1 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
495
+ if (bindingPackageVersion !== '0.0.4-beta.3' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
496
+ throw new Error(`Native binding package version mismatch, expected 0.0.4-beta.3 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
497
497
  }
498
498
  return binding
499
499
  } catch (e) {
@@ -508,8 +508,8 @@ function requireNative() {
508
508
  try {
509
509
  const binding = require('node-tpm2-openharmony-arm')
510
510
  const bindingPackageVersion = require('node-tpm2-openharmony-arm/package.json').version
511
- if (bindingPackageVersion !== '0.0.4-beta.1' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
512
- throw new Error(`Native binding package version mismatch, expected 0.0.4-beta.1 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
511
+ if (bindingPackageVersion !== '0.0.4-beta.3' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
512
+ throw new Error(`Native binding package version mismatch, expected 0.0.4-beta.3 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
513
513
  }
514
514
  return binding
515
515
  } catch (e) {
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "node-tpm2",
3
- "version": "0.0.4-beta.1",
4
- "description": "Native TPM 2.0 for Node. Zero tooling, no admin. Windows (TBS) and Linux (/dev/tpmrm0). Pre-release.",
3
+ "version": "0.0.4-beta.3",
4
+ "description": "TPM 2.0 attestation for Node.js prebuilt native bindings, PCR quotes, and fleet-ready Windows PCP keys. No tpm2-tools.",
5
5
  "type": "module",
6
6
  "license": "Apache-2.0",
7
7
  "author": "Matt <support@hardproof.app>",
@@ -19,7 +19,8 @@
19
19
  ".": {
20
20
  "import": "./index.js",
21
21
  "types": "./index.d.ts"
22
- }
22
+ },
23
+ "./package.json": "./package.json"
23
24
  },
24
25
  "napi": {
25
26
  "binaryName": "node-tpm2",
@@ -71,20 +72,21 @@
71
72
  "create-npm-dirs": "napi create-npm-dirs",
72
73
  "patch-windows-npm": "node scripts/patch-windows-npm-packages.mjs",
73
74
  "prepublishOnly": "napi prepublish -t npm --skip-optional-publish",
75
+ "verify:package": "node scripts/verify-package-tarball.mjs",
74
76
  "publish:beta": "node scripts/publish-beta.mjs"
75
77
  },
76
78
  "devDependencies": {
77
79
  "@napi-rs/cli": "^3.7.2"
78
80
  },
79
81
  "optionalDependencies": {
80
- "node-tpm2-windows-x64-msvc": "0.0.4-beta.1",
81
- "node-tpm2-windows-arm64-msvc": "0.0.4-beta.1",
82
- "node-tpm2-linux-x64-gnu": "0.0.4-beta.1",
83
- "node-tpm2-linux-arm64-gnu": "0.0.4-beta.1",
84
- "node-tpm2-linux-x64-musl": "0.0.4-beta.1",
85
- "node-tpm2-linux-arm64-musl": "0.0.4-beta.1",
86
- "node-tpm2-darwin-arm64": "0.0.4-beta.1",
87
- "node-tpm2-win32-x64-msvc": "0.0.4-beta.1",
88
- "node-tpm2-win32-arm64-msvc": "0.0.4-beta.1"
82
+ "node-tpm2-windows-x64-msvc": "0.0.4-beta.3",
83
+ "node-tpm2-windows-arm64-msvc": "0.0.4-beta.3",
84
+ "node-tpm2-linux-x64-gnu": "0.0.4-beta.3",
85
+ "node-tpm2-linux-arm64-gnu": "0.0.4-beta.3",
86
+ "node-tpm2-linux-x64-musl": "0.0.4-beta.3",
87
+ "node-tpm2-linux-arm64-musl": "0.0.4-beta.3",
88
+ "node-tpm2-darwin-arm64": "0.0.4-beta.3",
89
+ "node-tpm2-win32-x64-msvc": "0.0.4-beta.3",
90
+ "node-tpm2-win32-arm64-msvc": "0.0.4-beta.3"
89
91
  }
90
92
  }