| #!/usr/bin/env node | ||
| /** | ||
| * ECDSA key create/sign and seal/unseal roundtrip via npm API. | ||
| * Mutating: creates transient TPM objects. Standard user OK (no PCR extend). | ||
| * | ||
| * Usage: | ||
| * node examples/keys-seal-smoke.mjs | ||
| * node node_modules/node-tpm2/examples/keys-seal-smoke.mjs | ||
| */ | ||
| import { createHash, createPublicKey, verify } from 'node:crypto'; | ||
| import { Tpm } from '../index.js'; | ||
| const SECRET = Buffer.from('node-tpm2-seal-test-secret'); | ||
| async function main() { | ||
| const ok = await Tpm.isAvailable(); | ||
| if (!ok) { | ||
| console.error('FAIL: Tpm.isAvailable() returned false'); | ||
| process.exit(1); | ||
| } | ||
| const { publicKeyDer, keyBlob } = await Tpm.createKey({ type: 'ecc', sign: true }); | ||
| const digest = createHash('sha256').update('node-tpm2-keys-sign-test').digest(); | ||
| const signature = await Tpm.signKeyBlob({ keyBlob, digest }); | ||
| if (!signature.length) { | ||
| console.error('FAIL: empty signature'); | ||
| process.exit(1); | ||
| } | ||
| const key = createPublicKey({ key: publicKeyDer, format: 'der', type: 'spki' }); | ||
| const verified = verify('sha256', digest, { key, dsaEncoding: 'ieee-p1363' }, signature); | ||
| if (!verified) { | ||
| console.error('FAIL: signature did not verify'); | ||
| process.exit(1); | ||
| } | ||
| console.log(`PASS createKey + signKeyBlob (sig=${signature.length}B, verified)`); | ||
| const sealed = await Tpm.seal({ data: SECRET }); | ||
| if (!sealed.length) { | ||
| console.error('FAIL: empty seal blob'); | ||
| process.exit(1); | ||
| } | ||
| const plain = await Tpm.unseal(sealed); | ||
| if (!plain.equals(SECRET)) { | ||
| console.error('FAIL: unseal mismatch'); | ||
| process.exit(1); | ||
| } | ||
| console.log(`PASS seal + unseal (${SECRET.length}B roundtrip)`); | ||
| console.log('\nkeys-seal-smoke: OK'); | ||
| } | ||
| main().catch((err) => { | ||
| console.error('FAIL:', err.message ?? err); | ||
| if (err.code) console.error(' code:', err.code); | ||
| if (err.suggestion) console.error(' suggestion:', err.suggestion); | ||
| if (err.tpmRc != null) console.error(' tpmRc:', err.tpmRc); | ||
| if (err.hresult != null) console.error(' hresult:', err.hresult); | ||
| process.exit(1); | ||
| }); |
+1
-1
@@ -12,3 +12,3 @@ # API roadmap | ||
| ## Current state (0.0.6) | ||
| ## Current state (0.0.8) | ||
@@ -15,0 +15,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`. |
+468
-52
@@ -80,5 +80,21 @@ // prettier-ignore | ||
| const bindingPackageVersion = require('node-tpm2-android-arm64/package.json').version | ||
| if (bindingPackageVersion !== '0.0.8' && 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.0.8 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`) | ||
| if (bindingPackageVersion !== '0.0.9-beta.1') { | ||
| if (typeof process !== 'undefined' && process.emitWarning) { | ||
| process.emitWarning( | ||
| `[node-tpm2] optional binding version ${bindingPackageVersion} !== 0.0.9-beta.1; run npm install or npm run build`, | ||
| { type: 'node-tpm2', code: 'NATIVE_BINDING_VERSION' }, | ||
| ) | ||
| } | ||
| } | ||
| if (bindingPackageVersion !== '0.0.9-beta.1') { | ||
| if (typeof process !== 'undefined' && process.emitWarning) { | ||
| process.emitWarning( | ||
| `[node-tpm2] optional binding version ${bindingPackageVersion} !== 0.0.9-beta.1; run npm install or npm run build`, | ||
| { type: 'node-tpm2', code: 'NATIVE_BINDING_VERSION' }, | ||
| ) | ||
| } | ||
| } | ||
| if (bindingPackageVersion !== '0.0.9-beta.1' && 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.0.9-beta.1 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`) | ||
| } | ||
| return binding | ||
@@ -97,5 +113,21 @@ } catch (e) { | ||
| const bindingPackageVersion = require('node-tpm2-android-arm-eabi/package.json').version | ||
| if (bindingPackageVersion !== '0.0.8' && 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.0.8 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`) | ||
| if (bindingPackageVersion !== '0.0.9-beta.1') { | ||
| if (typeof process !== 'undefined' && process.emitWarning) { | ||
| process.emitWarning( | ||
| `[node-tpm2] optional binding version ${bindingPackageVersion} !== 0.0.9-beta.1; run npm install or npm run build`, | ||
| { type: 'node-tpm2', code: 'NATIVE_BINDING_VERSION' }, | ||
| ) | ||
| } | ||
| } | ||
| if (bindingPackageVersion !== '0.0.9-beta.1') { | ||
| if (typeof process !== 'undefined' && process.emitWarning) { | ||
| process.emitWarning( | ||
| `[node-tpm2] optional binding version ${bindingPackageVersion} !== 0.0.9-beta.1; run npm install or npm run build`, | ||
| { type: 'node-tpm2', code: 'NATIVE_BINDING_VERSION' }, | ||
| ) | ||
| } | ||
| } | ||
| if (bindingPackageVersion !== '0.0.9-beta.1' && 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.0.9-beta.1 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`) | ||
| } | ||
| return binding | ||
@@ -119,5 +151,21 @@ } catch (e) { | ||
| const bindingPackageVersion = require('node-tpm2-win32-x64-gnu/package.json').version | ||
| if (bindingPackageVersion !== '0.0.8' && 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.0.8 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`) | ||
| if (bindingPackageVersion !== '0.0.9-beta.1') { | ||
| if (typeof process !== 'undefined' && process.emitWarning) { | ||
| process.emitWarning( | ||
| `[node-tpm2] optional binding version ${bindingPackageVersion} !== 0.0.9-beta.1; run npm install or npm run build`, | ||
| { type: 'node-tpm2', code: 'NATIVE_BINDING_VERSION' }, | ||
| ) | ||
| } | ||
| } | ||
| if (bindingPackageVersion !== '0.0.9-beta.1') { | ||
| if (typeof process !== 'undefined' && process.emitWarning) { | ||
| process.emitWarning( | ||
| `[node-tpm2] optional binding version ${bindingPackageVersion} !== 0.0.9-beta.1; run npm install or npm run build`, | ||
| { type: 'node-tpm2', code: 'NATIVE_BINDING_VERSION' }, | ||
| ) | ||
| } | ||
| } | ||
| if (bindingPackageVersion !== '0.0.9-beta.1' && 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.0.9-beta.1 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`) | ||
| } | ||
| return binding | ||
@@ -136,5 +184,21 @@ } catch (e) { | ||
| const bindingPackageVersion = require('node-tpm2-windows-x64-msvc/package.json').version | ||
| if (bindingPackageVersion !== '0.0.8' && 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.0.8 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`) | ||
| if (bindingPackageVersion !== '0.0.9-beta.1') { | ||
| if (typeof process !== 'undefined' && process.emitWarning) { | ||
| process.emitWarning( | ||
| `[node-tpm2] optional binding version ${bindingPackageVersion} !== 0.0.9-beta.1; run npm install or npm run build`, | ||
| { type: 'node-tpm2', code: 'NATIVE_BINDING_VERSION' }, | ||
| ) | ||
| } | ||
| } | ||
| if (bindingPackageVersion !== '0.0.9-beta.1') { | ||
| if (typeof process !== 'undefined' && process.emitWarning) { | ||
| process.emitWarning( | ||
| `[node-tpm2] optional binding version ${bindingPackageVersion} !== 0.0.9-beta.1; run npm install or npm run build`, | ||
| { type: 'node-tpm2', code: 'NATIVE_BINDING_VERSION' }, | ||
| ) | ||
| } | ||
| } | ||
| if (bindingPackageVersion !== '0.0.9-beta.1' && 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.0.9-beta.1 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`) | ||
| } | ||
| return binding | ||
@@ -154,5 +218,21 @@ } catch (e) { | ||
| const bindingPackageVersion = require('node-tpm2-win32-ia32-msvc/package.json').version | ||
| if (bindingPackageVersion !== '0.0.8' && 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.0.8 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`) | ||
| if (bindingPackageVersion !== '0.0.9-beta.1') { | ||
| if (typeof process !== 'undefined' && process.emitWarning) { | ||
| process.emitWarning( | ||
| `[node-tpm2] optional binding version ${bindingPackageVersion} !== 0.0.9-beta.1; run npm install or npm run build`, | ||
| { type: 'node-tpm2', code: 'NATIVE_BINDING_VERSION' }, | ||
| ) | ||
| } | ||
| } | ||
| if (bindingPackageVersion !== '0.0.9-beta.1') { | ||
| if (typeof process !== 'undefined' && process.emitWarning) { | ||
| process.emitWarning( | ||
| `[node-tpm2] optional binding version ${bindingPackageVersion} !== 0.0.9-beta.1; run npm install or npm run build`, | ||
| { type: 'node-tpm2', code: 'NATIVE_BINDING_VERSION' }, | ||
| ) | ||
| } | ||
| } | ||
| if (bindingPackageVersion !== '0.0.9-beta.1' && 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.0.9-beta.1 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`) | ||
| } | ||
| return binding | ||
@@ -171,5 +251,21 @@ } catch (e) { | ||
| const bindingPackageVersion = require('node-tpm2-windows-arm64-msvc/package.json').version | ||
| if (bindingPackageVersion !== '0.0.8' && 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.0.8 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`) | ||
| if (bindingPackageVersion !== '0.0.9-beta.1') { | ||
| if (typeof process !== 'undefined' && process.emitWarning) { | ||
| process.emitWarning( | ||
| `[node-tpm2] optional binding version ${bindingPackageVersion} !== 0.0.9-beta.1; run npm install or npm run build`, | ||
| { type: 'node-tpm2', code: 'NATIVE_BINDING_VERSION' }, | ||
| ) | ||
| } | ||
| } | ||
| if (bindingPackageVersion !== '0.0.9-beta.1') { | ||
| if (typeof process !== 'undefined' && process.emitWarning) { | ||
| process.emitWarning( | ||
| `[node-tpm2] optional binding version ${bindingPackageVersion} !== 0.0.9-beta.1; run npm install or npm run build`, | ||
| { type: 'node-tpm2', code: 'NATIVE_BINDING_VERSION' }, | ||
| ) | ||
| } | ||
| } | ||
| if (bindingPackageVersion !== '0.0.9-beta.1' && 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.0.9-beta.1 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`) | ||
| } | ||
| return binding | ||
@@ -191,4 +287,20 @@ } catch (e) { | ||
| const bindingPackageVersion = require('node-tpm2-darwin-universal/package.json').version | ||
| if (bindingPackageVersion !== '0.0.8' && 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.0.8 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`) | ||
| if (bindingPackageVersion !== '0.0.9-beta.1') { | ||
| if (typeof process !== 'undefined' && process.emitWarning) { | ||
| process.emitWarning( | ||
| `[node-tpm2] optional binding version ${bindingPackageVersion} !== 0.0.9-beta.1; run npm install or npm run build`, | ||
| { type: 'node-tpm2', code: 'NATIVE_BINDING_VERSION' }, | ||
| ) | ||
| } | ||
| } | ||
| if (bindingPackageVersion !== '0.0.9-beta.1') { | ||
| if (typeof process !== 'undefined' && process.emitWarning) { | ||
| process.emitWarning( | ||
| `[node-tpm2] optional binding version ${bindingPackageVersion} !== 0.0.9-beta.1; run npm install or npm run build`, | ||
| { type: 'node-tpm2', code: 'NATIVE_BINDING_VERSION' }, | ||
| ) | ||
| } | ||
| } | ||
| if (bindingPackageVersion !== '0.0.9-beta.1' && 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.0.9-beta.1 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`) | ||
| } | ||
@@ -208,5 +320,21 @@ return binding | ||
| const bindingPackageVersion = require('node-tpm2-darwin-x64/package.json').version | ||
| if (bindingPackageVersion !== '0.0.8' && 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.0.8 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`) | ||
| if (bindingPackageVersion !== '0.0.9-beta.1') { | ||
| if (typeof process !== 'undefined' && process.emitWarning) { | ||
| process.emitWarning( | ||
| `[node-tpm2] optional binding version ${bindingPackageVersion} !== 0.0.9-beta.1; run npm install or npm run build`, | ||
| { type: 'node-tpm2', code: 'NATIVE_BINDING_VERSION' }, | ||
| ) | ||
| } | ||
| } | ||
| if (bindingPackageVersion !== '0.0.9-beta.1') { | ||
| if (typeof process !== 'undefined' && process.emitWarning) { | ||
| process.emitWarning( | ||
| `[node-tpm2] optional binding version ${bindingPackageVersion} !== 0.0.9-beta.1; run npm install or npm run build`, | ||
| { type: 'node-tpm2', code: 'NATIVE_BINDING_VERSION' }, | ||
| ) | ||
| } | ||
| } | ||
| if (bindingPackageVersion !== '0.0.9-beta.1' && 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.0.9-beta.1 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`) | ||
| } | ||
| return binding | ||
@@ -225,5 +353,21 @@ } catch (e) { | ||
| const bindingPackageVersion = require('node-tpm2-darwin-arm64/package.json').version | ||
| if (bindingPackageVersion !== '0.0.8' && 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.0.8 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`) | ||
| if (bindingPackageVersion !== '0.0.9-beta.1') { | ||
| if (typeof process !== 'undefined' && process.emitWarning) { | ||
| process.emitWarning( | ||
| `[node-tpm2] optional binding version ${bindingPackageVersion} !== 0.0.9-beta.1; run npm install or npm run build`, | ||
| { type: 'node-tpm2', code: 'NATIVE_BINDING_VERSION' }, | ||
| ) | ||
| } | ||
| } | ||
| if (bindingPackageVersion !== '0.0.9-beta.1') { | ||
| if (typeof process !== 'undefined' && process.emitWarning) { | ||
| process.emitWarning( | ||
| `[node-tpm2] optional binding version ${bindingPackageVersion} !== 0.0.9-beta.1; run npm install or npm run build`, | ||
| { type: 'node-tpm2', code: 'NATIVE_BINDING_VERSION' }, | ||
| ) | ||
| } | ||
| } | ||
| if (bindingPackageVersion !== '0.0.9-beta.1' && 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.0.9-beta.1 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`) | ||
| } | ||
| return binding | ||
@@ -246,5 +390,21 @@ } catch (e) { | ||
| const bindingPackageVersion = require('node-tpm2-freebsd-x64/package.json').version | ||
| if (bindingPackageVersion !== '0.0.8' && 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.0.8 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`) | ||
| if (bindingPackageVersion !== '0.0.9-beta.1') { | ||
| if (typeof process !== 'undefined' && process.emitWarning) { | ||
| process.emitWarning( | ||
| `[node-tpm2] optional binding version ${bindingPackageVersion} !== 0.0.9-beta.1; run npm install or npm run build`, | ||
| { type: 'node-tpm2', code: 'NATIVE_BINDING_VERSION' }, | ||
| ) | ||
| } | ||
| } | ||
| if (bindingPackageVersion !== '0.0.9-beta.1') { | ||
| if (typeof process !== 'undefined' && process.emitWarning) { | ||
| process.emitWarning( | ||
| `[node-tpm2] optional binding version ${bindingPackageVersion} !== 0.0.9-beta.1; run npm install or npm run build`, | ||
| { type: 'node-tpm2', code: 'NATIVE_BINDING_VERSION' }, | ||
| ) | ||
| } | ||
| } | ||
| if (bindingPackageVersion !== '0.0.9-beta.1' && 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.0.9-beta.1 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`) | ||
| } | ||
| return binding | ||
@@ -263,5 +423,21 @@ } catch (e) { | ||
| const bindingPackageVersion = require('node-tpm2-freebsd-arm64/package.json').version | ||
| if (bindingPackageVersion !== '0.0.8' && 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.0.8 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`) | ||
| if (bindingPackageVersion !== '0.0.9-beta.1') { | ||
| if (typeof process !== 'undefined' && process.emitWarning) { | ||
| process.emitWarning( | ||
| `[node-tpm2] optional binding version ${bindingPackageVersion} !== 0.0.9-beta.1; run npm install or npm run build`, | ||
| { type: 'node-tpm2', code: 'NATIVE_BINDING_VERSION' }, | ||
| ) | ||
| } | ||
| } | ||
| if (bindingPackageVersion !== '0.0.9-beta.1') { | ||
| if (typeof process !== 'undefined' && process.emitWarning) { | ||
| process.emitWarning( | ||
| `[node-tpm2] optional binding version ${bindingPackageVersion} !== 0.0.9-beta.1; run npm install or npm run build`, | ||
| { type: 'node-tpm2', code: 'NATIVE_BINDING_VERSION' }, | ||
| ) | ||
| } | ||
| } | ||
| if (bindingPackageVersion !== '0.0.9-beta.1' && 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.0.9-beta.1 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`) | ||
| } | ||
| return binding | ||
@@ -285,5 +461,21 @@ } catch (e) { | ||
| const bindingPackageVersion = require('node-tpm2-linux-x64-musl/package.json').version | ||
| if (bindingPackageVersion !== '0.0.8' && 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.0.8 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`) | ||
| if (bindingPackageVersion !== '0.0.9-beta.1') { | ||
| if (typeof process !== 'undefined' && process.emitWarning) { | ||
| process.emitWarning( | ||
| `[node-tpm2] optional binding version ${bindingPackageVersion} !== 0.0.9-beta.1; run npm install or npm run build`, | ||
| { type: 'node-tpm2', code: 'NATIVE_BINDING_VERSION' }, | ||
| ) | ||
| } | ||
| } | ||
| if (bindingPackageVersion !== '0.0.9-beta.1') { | ||
| if (typeof process !== 'undefined' && process.emitWarning) { | ||
| process.emitWarning( | ||
| `[node-tpm2] optional binding version ${bindingPackageVersion} !== 0.0.9-beta.1; run npm install or npm run build`, | ||
| { type: 'node-tpm2', code: 'NATIVE_BINDING_VERSION' }, | ||
| ) | ||
| } | ||
| } | ||
| if (bindingPackageVersion !== '0.0.9-beta.1' && 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.0.9-beta.1 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`) | ||
| } | ||
| return binding | ||
@@ -302,5 +494,21 @@ } catch (e) { | ||
| const bindingPackageVersion = require('node-tpm2-linux-x64-gnu/package.json').version | ||
| if (bindingPackageVersion !== '0.0.8' && 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.0.8 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`) | ||
| if (bindingPackageVersion !== '0.0.9-beta.1') { | ||
| if (typeof process !== 'undefined' && process.emitWarning) { | ||
| process.emitWarning( | ||
| `[node-tpm2] optional binding version ${bindingPackageVersion} !== 0.0.9-beta.1; run npm install or npm run build`, | ||
| { type: 'node-tpm2', code: 'NATIVE_BINDING_VERSION' }, | ||
| ) | ||
| } | ||
| } | ||
| if (bindingPackageVersion !== '0.0.9-beta.1') { | ||
| if (typeof process !== 'undefined' && process.emitWarning) { | ||
| process.emitWarning( | ||
| `[node-tpm2] optional binding version ${bindingPackageVersion} !== 0.0.9-beta.1; run npm install or npm run build`, | ||
| { type: 'node-tpm2', code: 'NATIVE_BINDING_VERSION' }, | ||
| ) | ||
| } | ||
| } | ||
| if (bindingPackageVersion !== '0.0.9-beta.1' && 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.0.9-beta.1 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`) | ||
| } | ||
| return binding | ||
@@ -321,5 +529,21 @@ } catch (e) { | ||
| const bindingPackageVersion = require('node-tpm2-linux-arm64-musl/package.json').version | ||
| if (bindingPackageVersion !== '0.0.8' && 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.0.8 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`) | ||
| if (bindingPackageVersion !== '0.0.9-beta.1') { | ||
| if (typeof process !== 'undefined' && process.emitWarning) { | ||
| process.emitWarning( | ||
| `[node-tpm2] optional binding version ${bindingPackageVersion} !== 0.0.9-beta.1; run npm install or npm run build`, | ||
| { type: 'node-tpm2', code: 'NATIVE_BINDING_VERSION' }, | ||
| ) | ||
| } | ||
| } | ||
| if (bindingPackageVersion !== '0.0.9-beta.1') { | ||
| if (typeof process !== 'undefined' && process.emitWarning) { | ||
| process.emitWarning( | ||
| `[node-tpm2] optional binding version ${bindingPackageVersion} !== 0.0.9-beta.1; run npm install or npm run build`, | ||
| { type: 'node-tpm2', code: 'NATIVE_BINDING_VERSION' }, | ||
| ) | ||
| } | ||
| } | ||
| if (bindingPackageVersion !== '0.0.9-beta.1' && 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.0.9-beta.1 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`) | ||
| } | ||
| return binding | ||
@@ -338,5 +562,21 @@ } catch (e) { | ||
| const bindingPackageVersion = require('node-tpm2-linux-arm64-gnu/package.json').version | ||
| if (bindingPackageVersion !== '0.0.8' && 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.0.8 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`) | ||
| if (bindingPackageVersion !== '0.0.9-beta.1') { | ||
| if (typeof process !== 'undefined' && process.emitWarning) { | ||
| process.emitWarning( | ||
| `[node-tpm2] optional binding version ${bindingPackageVersion} !== 0.0.9-beta.1; run npm install or npm run build`, | ||
| { type: 'node-tpm2', code: 'NATIVE_BINDING_VERSION' }, | ||
| ) | ||
| } | ||
| } | ||
| if (bindingPackageVersion !== '0.0.9-beta.1') { | ||
| if (typeof process !== 'undefined' && process.emitWarning) { | ||
| process.emitWarning( | ||
| `[node-tpm2] optional binding version ${bindingPackageVersion} !== 0.0.9-beta.1; run npm install or npm run build`, | ||
| { type: 'node-tpm2', code: 'NATIVE_BINDING_VERSION' }, | ||
| ) | ||
| } | ||
| } | ||
| if (bindingPackageVersion !== '0.0.9-beta.1' && 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.0.9-beta.1 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`) | ||
| } | ||
| return binding | ||
@@ -357,5 +597,21 @@ } catch (e) { | ||
| const bindingPackageVersion = require('node-tpm2-linux-arm-musleabihf/package.json').version | ||
| if (bindingPackageVersion !== '0.0.8' && 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.0.8 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`) | ||
| if (bindingPackageVersion !== '0.0.9-beta.1') { | ||
| if (typeof process !== 'undefined' && process.emitWarning) { | ||
| process.emitWarning( | ||
| `[node-tpm2] optional binding version ${bindingPackageVersion} !== 0.0.9-beta.1; run npm install or npm run build`, | ||
| { type: 'node-tpm2', code: 'NATIVE_BINDING_VERSION' }, | ||
| ) | ||
| } | ||
| } | ||
| if (bindingPackageVersion !== '0.0.9-beta.1') { | ||
| if (typeof process !== 'undefined' && process.emitWarning) { | ||
| process.emitWarning( | ||
| `[node-tpm2] optional binding version ${bindingPackageVersion} !== 0.0.9-beta.1; run npm install or npm run build`, | ||
| { type: 'node-tpm2', code: 'NATIVE_BINDING_VERSION' }, | ||
| ) | ||
| } | ||
| } | ||
| if (bindingPackageVersion !== '0.0.9-beta.1' && 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.0.9-beta.1 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`) | ||
| } | ||
| return binding | ||
@@ -374,5 +630,21 @@ } catch (e) { | ||
| const bindingPackageVersion = require('node-tpm2-linux-arm-gnueabihf/package.json').version | ||
| if (bindingPackageVersion !== '0.0.8' && 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.0.8 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`) | ||
| if (bindingPackageVersion !== '0.0.9-beta.1') { | ||
| if (typeof process !== 'undefined' && process.emitWarning) { | ||
| process.emitWarning( | ||
| `[node-tpm2] optional binding version ${bindingPackageVersion} !== 0.0.9-beta.1; run npm install or npm run build`, | ||
| { type: 'node-tpm2', code: 'NATIVE_BINDING_VERSION' }, | ||
| ) | ||
| } | ||
| } | ||
| if (bindingPackageVersion !== '0.0.9-beta.1') { | ||
| if (typeof process !== 'undefined' && process.emitWarning) { | ||
| process.emitWarning( | ||
| `[node-tpm2] optional binding version ${bindingPackageVersion} !== 0.0.9-beta.1; run npm install or npm run build`, | ||
| { type: 'node-tpm2', code: 'NATIVE_BINDING_VERSION' }, | ||
| ) | ||
| } | ||
| } | ||
| if (bindingPackageVersion !== '0.0.9-beta.1' && 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.0.9-beta.1 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`) | ||
| } | ||
| return binding | ||
@@ -393,5 +665,21 @@ } catch (e) { | ||
| const bindingPackageVersion = require('node-tpm2-linux-loong64-musl/package.json').version | ||
| if (bindingPackageVersion !== '0.0.8' && 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.0.8 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`) | ||
| if (bindingPackageVersion !== '0.0.9-beta.1') { | ||
| if (typeof process !== 'undefined' && process.emitWarning) { | ||
| process.emitWarning( | ||
| `[node-tpm2] optional binding version ${bindingPackageVersion} !== 0.0.9-beta.1; run npm install or npm run build`, | ||
| { type: 'node-tpm2', code: 'NATIVE_BINDING_VERSION' }, | ||
| ) | ||
| } | ||
| } | ||
| if (bindingPackageVersion !== '0.0.9-beta.1') { | ||
| if (typeof process !== 'undefined' && process.emitWarning) { | ||
| process.emitWarning( | ||
| `[node-tpm2] optional binding version ${bindingPackageVersion} !== 0.0.9-beta.1; run npm install or npm run build`, | ||
| { type: 'node-tpm2', code: 'NATIVE_BINDING_VERSION' }, | ||
| ) | ||
| } | ||
| } | ||
| if (bindingPackageVersion !== '0.0.9-beta.1' && 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.0.9-beta.1 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`) | ||
| } | ||
| return binding | ||
@@ -410,5 +698,21 @@ } catch (e) { | ||
| const bindingPackageVersion = require('node-tpm2-linux-loong64-gnu/package.json').version | ||
| if (bindingPackageVersion !== '0.0.8' && 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.0.8 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`) | ||
| if (bindingPackageVersion !== '0.0.9-beta.1') { | ||
| if (typeof process !== 'undefined' && process.emitWarning) { | ||
| process.emitWarning( | ||
| `[node-tpm2] optional binding version ${bindingPackageVersion} !== 0.0.9-beta.1; run npm install or npm run build`, | ||
| { type: 'node-tpm2', code: 'NATIVE_BINDING_VERSION' }, | ||
| ) | ||
| } | ||
| } | ||
| if (bindingPackageVersion !== '0.0.9-beta.1') { | ||
| if (typeof process !== 'undefined' && process.emitWarning) { | ||
| process.emitWarning( | ||
| `[node-tpm2] optional binding version ${bindingPackageVersion} !== 0.0.9-beta.1; run npm install or npm run build`, | ||
| { type: 'node-tpm2', code: 'NATIVE_BINDING_VERSION' }, | ||
| ) | ||
| } | ||
| } | ||
| if (bindingPackageVersion !== '0.0.9-beta.1' && 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.0.9-beta.1 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`) | ||
| } | ||
| return binding | ||
@@ -429,5 +733,21 @@ } catch (e) { | ||
| const bindingPackageVersion = require('node-tpm2-linux-riscv64-musl/package.json').version | ||
| if (bindingPackageVersion !== '0.0.8' && 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.0.8 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`) | ||
| if (bindingPackageVersion !== '0.0.9-beta.1') { | ||
| if (typeof process !== 'undefined' && process.emitWarning) { | ||
| process.emitWarning( | ||
| `[node-tpm2] optional binding version ${bindingPackageVersion} !== 0.0.9-beta.1; run npm install or npm run build`, | ||
| { type: 'node-tpm2', code: 'NATIVE_BINDING_VERSION' }, | ||
| ) | ||
| } | ||
| } | ||
| if (bindingPackageVersion !== '0.0.9-beta.1') { | ||
| if (typeof process !== 'undefined' && process.emitWarning) { | ||
| process.emitWarning( | ||
| `[node-tpm2] optional binding version ${bindingPackageVersion} !== 0.0.9-beta.1; run npm install or npm run build`, | ||
| { type: 'node-tpm2', code: 'NATIVE_BINDING_VERSION' }, | ||
| ) | ||
| } | ||
| } | ||
| if (bindingPackageVersion !== '0.0.9-beta.1' && 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.0.9-beta.1 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`) | ||
| } | ||
| return binding | ||
@@ -446,5 +766,21 @@ } catch (e) { | ||
| const bindingPackageVersion = require('node-tpm2-linux-riscv64-gnu/package.json').version | ||
| if (bindingPackageVersion !== '0.0.8' && 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.0.8 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`) | ||
| if (bindingPackageVersion !== '0.0.9-beta.1') { | ||
| if (typeof process !== 'undefined' && process.emitWarning) { | ||
| process.emitWarning( | ||
| `[node-tpm2] optional binding version ${bindingPackageVersion} !== 0.0.9-beta.1; run npm install or npm run build`, | ||
| { type: 'node-tpm2', code: 'NATIVE_BINDING_VERSION' }, | ||
| ) | ||
| } | ||
| } | ||
| if (bindingPackageVersion !== '0.0.9-beta.1') { | ||
| if (typeof process !== 'undefined' && process.emitWarning) { | ||
| process.emitWarning( | ||
| `[node-tpm2] optional binding version ${bindingPackageVersion} !== 0.0.9-beta.1; run npm install or npm run build`, | ||
| { type: 'node-tpm2', code: 'NATIVE_BINDING_VERSION' }, | ||
| ) | ||
| } | ||
| } | ||
| if (bindingPackageVersion !== '0.0.9-beta.1' && 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.0.9-beta.1 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`) | ||
| } | ||
| return binding | ||
@@ -464,5 +800,21 @@ } catch (e) { | ||
| const bindingPackageVersion = require('node-tpm2-linux-ppc64-gnu/package.json').version | ||
| if (bindingPackageVersion !== '0.0.8' && 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.0.8 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`) | ||
| if (bindingPackageVersion !== '0.0.9-beta.1') { | ||
| if (typeof process !== 'undefined' && process.emitWarning) { | ||
| process.emitWarning( | ||
| `[node-tpm2] optional binding version ${bindingPackageVersion} !== 0.0.9-beta.1; run npm install or npm run build`, | ||
| { type: 'node-tpm2', code: 'NATIVE_BINDING_VERSION' }, | ||
| ) | ||
| } | ||
| } | ||
| if (bindingPackageVersion !== '0.0.9-beta.1') { | ||
| if (typeof process !== 'undefined' && process.emitWarning) { | ||
| process.emitWarning( | ||
| `[node-tpm2] optional binding version ${bindingPackageVersion} !== 0.0.9-beta.1; run npm install or npm run build`, | ||
| { type: 'node-tpm2', code: 'NATIVE_BINDING_VERSION' }, | ||
| ) | ||
| } | ||
| } | ||
| if (bindingPackageVersion !== '0.0.9-beta.1' && 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.0.9-beta.1 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`) | ||
| } | ||
| return binding | ||
@@ -481,5 +833,21 @@ } catch (e) { | ||
| const bindingPackageVersion = require('node-tpm2-linux-s390x-gnu/package.json').version | ||
| if (bindingPackageVersion !== '0.0.8' && 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.0.8 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`) | ||
| if (bindingPackageVersion !== '0.0.9-beta.1') { | ||
| if (typeof process !== 'undefined' && process.emitWarning) { | ||
| process.emitWarning( | ||
| `[node-tpm2] optional binding version ${bindingPackageVersion} !== 0.0.9-beta.1; run npm install or npm run build`, | ||
| { type: 'node-tpm2', code: 'NATIVE_BINDING_VERSION' }, | ||
| ) | ||
| } | ||
| } | ||
| if (bindingPackageVersion !== '0.0.9-beta.1') { | ||
| if (typeof process !== 'undefined' && process.emitWarning) { | ||
| process.emitWarning( | ||
| `[node-tpm2] optional binding version ${bindingPackageVersion} !== 0.0.9-beta.1; run npm install or npm run build`, | ||
| { type: 'node-tpm2', code: 'NATIVE_BINDING_VERSION' }, | ||
| ) | ||
| } | ||
| } | ||
| if (bindingPackageVersion !== '0.0.9-beta.1' && 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.0.9-beta.1 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`) | ||
| } | ||
| return binding | ||
@@ -502,5 +870,21 @@ } catch (e) { | ||
| const bindingPackageVersion = require('node-tpm2-openharmony-arm64/package.json').version | ||
| if (bindingPackageVersion !== '0.0.8' && 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.0.8 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`) | ||
| if (bindingPackageVersion !== '0.0.9-beta.1') { | ||
| if (typeof process !== 'undefined' && process.emitWarning) { | ||
| process.emitWarning( | ||
| `[node-tpm2] optional binding version ${bindingPackageVersion} !== 0.0.9-beta.1; run npm install or npm run build`, | ||
| { type: 'node-tpm2', code: 'NATIVE_BINDING_VERSION' }, | ||
| ) | ||
| } | ||
| } | ||
| if (bindingPackageVersion !== '0.0.9-beta.1') { | ||
| if (typeof process !== 'undefined' && process.emitWarning) { | ||
| process.emitWarning( | ||
| `[node-tpm2] optional binding version ${bindingPackageVersion} !== 0.0.9-beta.1; run npm install or npm run build`, | ||
| { type: 'node-tpm2', code: 'NATIVE_BINDING_VERSION' }, | ||
| ) | ||
| } | ||
| } | ||
| if (bindingPackageVersion !== '0.0.9-beta.1' && 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.0.9-beta.1 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`) | ||
| } | ||
| return binding | ||
@@ -519,5 +903,21 @@ } catch (e) { | ||
| const bindingPackageVersion = require('node-tpm2-openharmony-x64/package.json').version | ||
| if (bindingPackageVersion !== '0.0.8' && 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.0.8 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`) | ||
| if (bindingPackageVersion !== '0.0.9-beta.1') { | ||
| if (typeof process !== 'undefined' && process.emitWarning) { | ||
| process.emitWarning( | ||
| `[node-tpm2] optional binding version ${bindingPackageVersion} !== 0.0.9-beta.1; run npm install or npm run build`, | ||
| { type: 'node-tpm2', code: 'NATIVE_BINDING_VERSION' }, | ||
| ) | ||
| } | ||
| } | ||
| if (bindingPackageVersion !== '0.0.9-beta.1') { | ||
| if (typeof process !== 'undefined' && process.emitWarning) { | ||
| process.emitWarning( | ||
| `[node-tpm2] optional binding version ${bindingPackageVersion} !== 0.0.9-beta.1; run npm install or npm run build`, | ||
| { type: 'node-tpm2', code: 'NATIVE_BINDING_VERSION' }, | ||
| ) | ||
| } | ||
| } | ||
| if (bindingPackageVersion !== '0.0.9-beta.1' && 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.0.9-beta.1 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`) | ||
| } | ||
| return binding | ||
@@ -536,5 +936,21 @@ } catch (e) { | ||
| const bindingPackageVersion = require('node-tpm2-openharmony-arm/package.json').version | ||
| if (bindingPackageVersion !== '0.0.8' && 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.0.8 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`) | ||
| if (bindingPackageVersion !== '0.0.9-beta.1') { | ||
| if (typeof process !== 'undefined' && process.emitWarning) { | ||
| process.emitWarning( | ||
| `[node-tpm2] optional binding version ${bindingPackageVersion} !== 0.0.9-beta.1; run npm install or npm run build`, | ||
| { type: 'node-tpm2', code: 'NATIVE_BINDING_VERSION' }, | ||
| ) | ||
| } | ||
| } | ||
| if (bindingPackageVersion !== '0.0.9-beta.1') { | ||
| if (typeof process !== 'undefined' && process.emitWarning) { | ||
| process.emitWarning( | ||
| `[node-tpm2] optional binding version ${bindingPackageVersion} !== 0.0.9-beta.1; run npm install or npm run build`, | ||
| { type: 'node-tpm2', code: 'NATIVE_BINDING_VERSION' }, | ||
| ) | ||
| } | ||
| } | ||
| if (bindingPackageVersion !== '0.0.9-beta.1' && 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.0.9-beta.1 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`) | ||
| } | ||
| return binding | ||
@@ -541,0 +957,0 @@ } catch (e) { |
+12
-10
| { | ||
| "name": "node-tpm2", | ||
| "version": "0.0.8", | ||
| "version": "0.0.9-beta.1", | ||
| "description": "TPM 2.0 attestation for Node.js — prebuilt native bindings, PCR quotes, and fleet-ready Windows PCP keys. No tpm2-tools.", | ||
@@ -79,2 +79,4 @@ "type": "module", | ||
| "verify:package": "node scripts/verify-package-tarball.mjs", | ||
| "test:hw:mutating": "bash scripts/run-mutating-hw-tests.sh", | ||
| "test:hw:npm-smoke": "node examples/smoke-test.mjs runtime && node examples/quote-verify.mjs && node examples/keys-seal-smoke.mjs", | ||
| "bump": "node scripts/bump-version.mjs", | ||
@@ -92,12 +94,12 @@ "release:preflight": "node scripts/release.mjs preflight", | ||
| "optionalDependencies": { | ||
| "node-tpm2-windows-x64-msvc": "0.0.8", | ||
| "node-tpm2-windows-arm64-msvc": "0.0.8", | ||
| "node-tpm2-linux-x64-gnu": "0.0.8", | ||
| "node-tpm2-linux-arm64-gnu": "0.0.8", | ||
| "node-tpm2-linux-x64-musl": "0.0.8", | ||
| "node-tpm2-linux-arm64-musl": "0.0.8", | ||
| "node-tpm2-darwin-arm64": "0.0.8", | ||
| "node-tpm2-win32-x64-msvc": "0.0.8", | ||
| "node-tpm2-win32-arm64-msvc": "0.0.8" | ||
| "node-tpm2-windows-x64-msvc": "0.0.9-beta.1", | ||
| "node-tpm2-windows-arm64-msvc": "0.0.9-beta.1", | ||
| "node-tpm2-linux-x64-gnu": "0.0.9-beta.1", | ||
| "node-tpm2-linux-arm64-gnu": "0.0.9-beta.1", | ||
| "node-tpm2-linux-x64-musl": "0.0.9-beta.1", | ||
| "node-tpm2-linux-arm64-musl": "0.0.9-beta.1", | ||
| "node-tpm2-darwin-arm64": "0.0.9-beta.1", | ||
| "node-tpm2-win32-x64-msvc": "0.0.9-beta.1", | ||
| "node-tpm2-win32-arm64-msvc": "0.0.9-beta.1" | ||
| } | ||
| } |
+1
-1
@@ -23,3 +23,3 @@ # node-tpm2 | ||
| **Stable** (`0.0.6`). Full public API implemented and validated on real Windows 11 + Intel TPM. [API reference](./docs/api-reference.md) · [Roadmap](./docs/roadmap.md). | ||
| **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). | ||
@@ -26,0 +26,0 @@ --- |
175592
15.25%17
6.25%2071
29.28%