@premai/reticle 0.3.1 → 0.4.1
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/package.json +1 -1
- package/reticle.d.ts +107 -123
- package/reticle.js +1 -1
- package/reticle_bg.js +544 -587
- package/reticle_bg.wasm +0 -0
- package/reticle_main.js +560 -594
package/reticle_main.js
CHANGED
|
@@ -72,6 +72,57 @@ class AttestResult {
|
|
|
72
72
|
if (Symbol.dispose) AttestResult.prototype[Symbol.dispose] = AttestResult.prototype.free;
|
|
73
73
|
exports.AttestResult = AttestResult;
|
|
74
74
|
|
|
75
|
+
/**
|
|
76
|
+
* A parsed certificate revocation list
|
|
77
|
+
*/
|
|
78
|
+
class CRL {
|
|
79
|
+
static __wrap(ptr) {
|
|
80
|
+
ptr = ptr >>> 0;
|
|
81
|
+
const obj = Object.create(CRL.prototype);
|
|
82
|
+
obj.__wbg_ptr = ptr;
|
|
83
|
+
CRLFinalization.register(obj, obj.__wbg_ptr, obj);
|
|
84
|
+
return obj;
|
|
85
|
+
}
|
|
86
|
+
__destroy_into_raw() {
|
|
87
|
+
const ptr = this.__wbg_ptr;
|
|
88
|
+
this.__wbg_ptr = 0;
|
|
89
|
+
CRLFinalization.unregister(this);
|
|
90
|
+
return ptr;
|
|
91
|
+
}
|
|
92
|
+
free() {
|
|
93
|
+
const ptr = this.__destroy_into_raw();
|
|
94
|
+
wasm.__wbg_crl_free(ptr, 0);
|
|
95
|
+
}
|
|
96
|
+
/**
|
|
97
|
+
* Passes if the certificates are not in the certificate revocation list
|
|
98
|
+
* Throws `AttestationError` on fail
|
|
99
|
+
* @param {VerifiedChain} chain
|
|
100
|
+
*/
|
|
101
|
+
check_chain(chain) {
|
|
102
|
+
_assertClass(chain, VerifiedChain);
|
|
103
|
+
const ret = wasm.crl_check_chain(this.__wbg_ptr, chain.__wbg_ptr);
|
|
104
|
+
if (ret[1]) {
|
|
105
|
+
throw takeFromExternrefTable0(ret[0]);
|
|
106
|
+
}
|
|
107
|
+
}
|
|
108
|
+
/**
|
|
109
|
+
* Parses a certificate revocation list from DER format binary data
|
|
110
|
+
* @param {Uint8Array} list
|
|
111
|
+
* @returns {CRL}
|
|
112
|
+
*/
|
|
113
|
+
static from_der(list) {
|
|
114
|
+
const ptr0 = passArray8ToWasm0(list, wasm.__wbindgen_malloc);
|
|
115
|
+
const len0 = WASM_VECTOR_LEN;
|
|
116
|
+
const ret = wasm.crl_from_der(ptr0, len0);
|
|
117
|
+
if (ret[2]) {
|
|
118
|
+
throw takeFromExternrefTable0(ret[1]);
|
|
119
|
+
}
|
|
120
|
+
return CRL.__wrap(ret[0]);
|
|
121
|
+
}
|
|
122
|
+
}
|
|
123
|
+
if (Symbol.dispose) CRL.prototype[Symbol.dispose] = CRL.prototype.free;
|
|
124
|
+
exports.CRL = CRL;
|
|
125
|
+
|
|
75
126
|
class Client {
|
|
76
127
|
static __wrap(ptr) {
|
|
77
128
|
ptr = ptr >>> 0;
|
|
@@ -95,72 +146,42 @@ class Client {
|
|
|
95
146
|
* - Gathers modules to attest from attestation server
|
|
96
147
|
* - Iterates through each module and performs end-to-end attestation
|
|
97
148
|
* - Returns the list of attested modules
|
|
98
|
-
* @param {QueryParams | null} [query]
|
|
99
149
|
* @returns {Promise<AttestResult>}
|
|
100
150
|
*/
|
|
101
|
-
attest(
|
|
102
|
-
|
|
103
|
-
if (!isLikeNone(query)) {
|
|
104
|
-
_assertClass(query, QueryParams);
|
|
105
|
-
ptr0 = query.__destroy_into_raw();
|
|
106
|
-
}
|
|
107
|
-
const ret = wasm.client_attest(this.__wbg_ptr, ptr0);
|
|
151
|
+
attest() {
|
|
152
|
+
const ret = wasm.client_attest(this.__wbg_ptr);
|
|
108
153
|
return ret;
|
|
109
154
|
}
|
|
110
155
|
/**
|
|
111
156
|
* Completes end-to-end nvidia attestation. Generates nonce and validates claims all in one
|
|
112
|
-
* @param {QueryParams | null} [query]
|
|
113
157
|
* @returns {Promise<ResponseHeaders>}
|
|
114
158
|
*/
|
|
115
|
-
attest_nvidia(
|
|
116
|
-
|
|
117
|
-
if (!isLikeNone(query)) {
|
|
118
|
-
_assertClass(query, QueryParams);
|
|
119
|
-
ptr0 = query.__destroy_into_raw();
|
|
120
|
-
}
|
|
121
|
-
const ret = wasm.client_attest_nvidia(this.__wbg_ptr, ptr0);
|
|
159
|
+
attest_nvidia() {
|
|
160
|
+
const ret = wasm.client_attest_nvidia(this.__wbg_ptr);
|
|
122
161
|
return ret;
|
|
123
162
|
}
|
|
124
163
|
/**
|
|
125
164
|
* Performs end-to-end sev-snp attestation. Generates nonce and validates claims all in one
|
|
126
|
-
* @param {QueryParams | null} [query]
|
|
127
165
|
* @returns {Promise<void>}
|
|
128
166
|
*/
|
|
129
|
-
attest_sev(
|
|
130
|
-
|
|
131
|
-
if (!isLikeNone(query)) {
|
|
132
|
-
_assertClass(query, QueryParams);
|
|
133
|
-
ptr0 = query.__destroy_into_raw();
|
|
134
|
-
}
|
|
135
|
-
const ret = wasm.client_attest_sev(this.__wbg_ptr, ptr0);
|
|
167
|
+
attest_sev() {
|
|
168
|
+
const ret = wasm.client_attest_sev(this.__wbg_ptr);
|
|
136
169
|
return ret;
|
|
137
170
|
}
|
|
138
171
|
/**
|
|
139
172
|
* Performs end-to-end tdx attestation. Generates nonce and validates claims all in one
|
|
140
|
-
* @param {QueryParams | null} [query]
|
|
141
173
|
* @returns {Promise<void>}
|
|
142
174
|
*/
|
|
143
|
-
attest_tdx(
|
|
144
|
-
|
|
145
|
-
if (!isLikeNone(query)) {
|
|
146
|
-
_assertClass(query, QueryParams);
|
|
147
|
-
ptr0 = query.__destroy_into_raw();
|
|
148
|
-
}
|
|
149
|
-
const ret = wasm.client_attest_tdx(this.__wbg_ptr, ptr0);
|
|
175
|
+
attest_tdx() {
|
|
176
|
+
const ret = wasm.client_attest_tdx(this.__wbg_ptr);
|
|
150
177
|
return ret;
|
|
151
178
|
}
|
|
152
179
|
/**
|
|
153
180
|
* Gather available attestable modules from remote attestation endpoint
|
|
154
|
-
* @param {QueryParams | null} [query]
|
|
155
181
|
* @returns {Promise<Modules>}
|
|
156
182
|
*/
|
|
157
|
-
request_modules(
|
|
158
|
-
|
|
159
|
-
if (!isLikeNone(query)) {
|
|
160
|
-
_assertClass(query, QueryParams);
|
|
161
|
-
ptr0 = query.__destroy_into_raw();
|
|
162
|
-
}
|
|
163
|
-
const ret = wasm.client_request_modules(this.__wbg_ptr, ptr0);
|
|
183
|
+
request_modules() {
|
|
184
|
+
const ret = wasm.client_request_modules(this.__wbg_ptr);
|
|
164
185
|
return ret;
|
|
165
186
|
}
|
|
166
187
|
/**
|
|
@@ -171,13 +192,11 @@ class Client {
|
|
|
171
192
|
* or measurement checks on the attestation. If you want to perform end-to-end attestation
|
|
172
193
|
* please refer to [`Self::attest_nvidia`]
|
|
173
194
|
* @param {NvidiaNonce} nonce
|
|
174
|
-
* @param {QueryParams} query
|
|
175
195
|
* @returns {Promise<NvidiaAttestResult>}
|
|
176
196
|
*/
|
|
177
|
-
request_nvidia(nonce
|
|
197
|
+
request_nvidia(nonce) {
|
|
178
198
|
_assertClass(nonce, NvidiaNonce);
|
|
179
|
-
|
|
180
|
-
const ret = wasm.client_request_nvidia(this.__wbg_ptr, nonce.__wbg_ptr, query.__wbg_ptr);
|
|
199
|
+
const ret = wasm.client_request_nvidia(this.__wbg_ptr, nonce.__wbg_ptr);
|
|
181
200
|
return ret;
|
|
182
201
|
}
|
|
183
202
|
/**
|
|
@@ -188,13 +207,11 @@ class Client {
|
|
|
188
207
|
* or measurement checks on the attestation. If you want to perform end-to-end attestation
|
|
189
208
|
* please refer to [`Self::attest_sev`]
|
|
190
209
|
* @param {SevNonce} nonce
|
|
191
|
-
* @param {QueryParams} query
|
|
192
210
|
* @returns {Promise<ParsedAttestation>}
|
|
193
211
|
*/
|
|
194
|
-
request_sev(nonce
|
|
212
|
+
request_sev(nonce) {
|
|
195
213
|
_assertClass(nonce, SevNonce);
|
|
196
|
-
|
|
197
|
-
const ret = wasm.client_request_sev(this.__wbg_ptr, nonce.__wbg_ptr, query.__wbg_ptr);
|
|
214
|
+
const ret = wasm.client_request_sev(this.__wbg_ptr, nonce.__wbg_ptr);
|
|
198
215
|
return ret;
|
|
199
216
|
}
|
|
200
217
|
/**
|
|
@@ -205,15 +222,21 @@ class Client {
|
|
|
205
222
|
* or measurement checks on the attestation. If you want to perform end-to-end attestation
|
|
206
223
|
* please refer to [`Self::attest_tdx`]
|
|
207
224
|
* @param {TdxNonce} nonce
|
|
208
|
-
* @param {QueryParams} query
|
|
209
225
|
* @returns {Promise<TdxQuote>}
|
|
210
226
|
*/
|
|
211
|
-
request_tdx(nonce
|
|
227
|
+
request_tdx(nonce) {
|
|
212
228
|
_assertClass(nonce, TdxNonce);
|
|
213
|
-
|
|
214
|
-
const ret = wasm.client_request_tdx(this.__wbg_ptr, nonce.__wbg_ptr, query.__wbg_ptr);
|
|
229
|
+
const ret = wasm.client_request_tdx(this.__wbg_ptr, nonce.__wbg_ptr);
|
|
215
230
|
return ret;
|
|
216
231
|
}
|
|
232
|
+
/**
|
|
233
|
+
* @param {QueryParams} query_params
|
|
234
|
+
*/
|
|
235
|
+
set_query(query_params) {
|
|
236
|
+
_assertClass(query_params, QueryParams);
|
|
237
|
+
var ptr0 = query_params.__destroy_into_raw();
|
|
238
|
+
wasm.client_set_query(this.__wbg_ptr, ptr0);
|
|
239
|
+
}
|
|
217
240
|
}
|
|
218
241
|
if (Symbol.dispose) Client.prototype[Symbol.dispose] = Client.prototype.free;
|
|
219
242
|
exports.Client = Client;
|
|
@@ -341,6 +364,151 @@ const CpuModule = Object.freeze({
|
|
|
341
364
|
});
|
|
342
365
|
exports.CpuModule = CpuModule;
|
|
343
366
|
|
|
367
|
+
class DecodedClaims {
|
|
368
|
+
static __wrap(ptr) {
|
|
369
|
+
ptr = ptr >>> 0;
|
|
370
|
+
const obj = Object.create(DecodedClaims.prototype);
|
|
371
|
+
obj.__wbg_ptr = ptr;
|
|
372
|
+
DecodedClaimsFinalization.register(obj, obj.__wbg_ptr, obj);
|
|
373
|
+
return obj;
|
|
374
|
+
}
|
|
375
|
+
__destroy_into_raw() {
|
|
376
|
+
const ptr = this.__wbg_ptr;
|
|
377
|
+
this.__wbg_ptr = 0;
|
|
378
|
+
DecodedClaimsFinalization.unregister(this);
|
|
379
|
+
return ptr;
|
|
380
|
+
}
|
|
381
|
+
free() {
|
|
382
|
+
const ptr = this.__destroy_into_raw();
|
|
383
|
+
wasm.__wbg_decodedclaims_free(ptr, 0);
|
|
384
|
+
}
|
|
385
|
+
}
|
|
386
|
+
if (Symbol.dispose) DecodedClaims.prototype[Symbol.dispose] = DecodedClaims.prototype.free;
|
|
387
|
+
exports.DecodedClaims = DecodedClaims;
|
|
388
|
+
|
|
389
|
+
class EATToken {
|
|
390
|
+
static __wrap(ptr) {
|
|
391
|
+
ptr = ptr >>> 0;
|
|
392
|
+
const obj = Object.create(EATToken.prototype);
|
|
393
|
+
obj.__wbg_ptr = ptr;
|
|
394
|
+
EATTokenFinalization.register(obj, obj.__wbg_ptr, obj);
|
|
395
|
+
return obj;
|
|
396
|
+
}
|
|
397
|
+
__destroy_into_raw() {
|
|
398
|
+
const ptr = this.__wbg_ptr;
|
|
399
|
+
this.__wbg_ptr = 0;
|
|
400
|
+
EATTokenFinalization.unregister(this);
|
|
401
|
+
return ptr;
|
|
402
|
+
}
|
|
403
|
+
free() {
|
|
404
|
+
const ptr = this.__destroy_into_raw();
|
|
405
|
+
wasm.__wbg_eattoken_free(ptr, 0);
|
|
406
|
+
}
|
|
407
|
+
/**
|
|
408
|
+
* @param {string} from
|
|
409
|
+
* @returns {EATToken}
|
|
410
|
+
*/
|
|
411
|
+
static parse(from) {
|
|
412
|
+
const ptr0 = passStringToWasm0(from, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
413
|
+
const len0 = WASM_VECTOR_LEN;
|
|
414
|
+
const ret = wasm.eattoken_parse(ptr0, len0);
|
|
415
|
+
if (ret[2]) {
|
|
416
|
+
throw takeFromExternrefTable0(ret[1]);
|
|
417
|
+
}
|
|
418
|
+
return EATToken.__wrap(ret[0]);
|
|
419
|
+
}
|
|
420
|
+
/**
|
|
421
|
+
* @param {KeyChain} keys
|
|
422
|
+
* @param {NvidiaNonce} nonce
|
|
423
|
+
* @returns {DecodedClaims}
|
|
424
|
+
*/
|
|
425
|
+
verify(keys, nonce) {
|
|
426
|
+
const ptr = this.__destroy_into_raw();
|
|
427
|
+
_assertClass(keys, KeyChain);
|
|
428
|
+
_assertClass(nonce, NvidiaNonce);
|
|
429
|
+
const ret = wasm.eattoken_verify(ptr, keys.__wbg_ptr, nonce.__wbg_ptr);
|
|
430
|
+
if (ret[2]) {
|
|
431
|
+
throw takeFromExternrefTable0(ret[1]);
|
|
432
|
+
}
|
|
433
|
+
return DecodedClaims.__wrap(ret[0]);
|
|
434
|
+
}
|
|
435
|
+
}
|
|
436
|
+
if (Symbol.dispose) EATToken.prototype[Symbol.dispose] = EATToken.prototype.free;
|
|
437
|
+
exports.EATToken = EATToken;
|
|
438
|
+
|
|
439
|
+
class ExportPem {
|
|
440
|
+
static __wrap(ptr) {
|
|
441
|
+
ptr = ptr >>> 0;
|
|
442
|
+
const obj = Object.create(ExportPem.prototype);
|
|
443
|
+
obj.__wbg_ptr = ptr;
|
|
444
|
+
ExportPemFinalization.register(obj, obj.__wbg_ptr, obj);
|
|
445
|
+
return obj;
|
|
446
|
+
}
|
|
447
|
+
__destroy_into_raw() {
|
|
448
|
+
const ptr = this.__wbg_ptr;
|
|
449
|
+
this.__wbg_ptr = 0;
|
|
450
|
+
ExportPemFinalization.unregister(this);
|
|
451
|
+
return ptr;
|
|
452
|
+
}
|
|
453
|
+
free() {
|
|
454
|
+
const ptr = this.__destroy_into_raw();
|
|
455
|
+
wasm.__wbg_exportpem_free(ptr, 0);
|
|
456
|
+
}
|
|
457
|
+
/**
|
|
458
|
+
* @returns {Uint8Array}
|
|
459
|
+
*/
|
|
460
|
+
get ark() {
|
|
461
|
+
const ret = wasm.__wbg_get_exportpem_ark(this.__wbg_ptr);
|
|
462
|
+
var v1 = getArrayU8FromWasm0(ret[0], ret[1]).slice();
|
|
463
|
+
wasm.__wbindgen_free(ret[0], ret[1] * 1, 1);
|
|
464
|
+
return v1;
|
|
465
|
+
}
|
|
466
|
+
/**
|
|
467
|
+
* @returns {Uint8Array}
|
|
468
|
+
*/
|
|
469
|
+
get ask() {
|
|
470
|
+
const ret = wasm.__wbg_get_exportpem_ask(this.__wbg_ptr);
|
|
471
|
+
var v1 = getArrayU8FromWasm0(ret[0], ret[1]).slice();
|
|
472
|
+
wasm.__wbindgen_free(ret[0], ret[1] * 1, 1);
|
|
473
|
+
return v1;
|
|
474
|
+
}
|
|
475
|
+
/**
|
|
476
|
+
* @returns {Uint8Array}
|
|
477
|
+
*/
|
|
478
|
+
get vek() {
|
|
479
|
+
const ret = wasm.__wbg_get_exportpem_vek(this.__wbg_ptr);
|
|
480
|
+
var v1 = getArrayU8FromWasm0(ret[0], ret[1]).slice();
|
|
481
|
+
wasm.__wbindgen_free(ret[0], ret[1] * 1, 1);
|
|
482
|
+
return v1;
|
|
483
|
+
}
|
|
484
|
+
/**
|
|
485
|
+
* @param {Uint8Array} arg0
|
|
486
|
+
*/
|
|
487
|
+
set ark(arg0) {
|
|
488
|
+
const ptr0 = passArray8ToWasm0(arg0, wasm.__wbindgen_malloc);
|
|
489
|
+
const len0 = WASM_VECTOR_LEN;
|
|
490
|
+
wasm.__wbg_set_exportpem_ark(this.__wbg_ptr, ptr0, len0);
|
|
491
|
+
}
|
|
492
|
+
/**
|
|
493
|
+
* @param {Uint8Array} arg0
|
|
494
|
+
*/
|
|
495
|
+
set ask(arg0) {
|
|
496
|
+
const ptr0 = passArray8ToWasm0(arg0, wasm.__wbindgen_malloc);
|
|
497
|
+
const len0 = WASM_VECTOR_LEN;
|
|
498
|
+
wasm.__wbg_set_exportpem_ask(this.__wbg_ptr, ptr0, len0);
|
|
499
|
+
}
|
|
500
|
+
/**
|
|
501
|
+
* @param {Uint8Array} arg0
|
|
502
|
+
*/
|
|
503
|
+
set vek(arg0) {
|
|
504
|
+
const ptr0 = passArray8ToWasm0(arg0, wasm.__wbindgen_malloc);
|
|
505
|
+
const len0 = WASM_VECTOR_LEN;
|
|
506
|
+
wasm.__wbg_set_exportpem_vek(this.__wbg_ptr, ptr0, len0);
|
|
507
|
+
}
|
|
508
|
+
}
|
|
509
|
+
if (Symbol.dispose) ExportPem.prototype[Symbol.dispose] = ExportPem.prototype.free;
|
|
510
|
+
exports.ExportPem = ExportPem;
|
|
511
|
+
|
|
344
512
|
class GatewayError {
|
|
345
513
|
static __wrap(ptr) {
|
|
346
514
|
ptr = ptr >>> 0;
|
|
@@ -394,6 +562,76 @@ const GpuModule = Object.freeze({
|
|
|
394
562
|
});
|
|
395
563
|
exports.GpuModule = GpuModule;
|
|
396
564
|
|
|
565
|
+
class Kds {
|
|
566
|
+
__destroy_into_raw() {
|
|
567
|
+
const ptr = this.__wbg_ptr;
|
|
568
|
+
this.__wbg_ptr = 0;
|
|
569
|
+
KdsFinalization.unregister(this);
|
|
570
|
+
return ptr;
|
|
571
|
+
}
|
|
572
|
+
free() {
|
|
573
|
+
const ptr = this.__destroy_into_raw();
|
|
574
|
+
wasm.__wbg_kds_free(ptr, 0);
|
|
575
|
+
}
|
|
576
|
+
/**
|
|
577
|
+
* @param {ParsedAttestation} attestation
|
|
578
|
+
* @returns {Promise<VerifiedChain>}
|
|
579
|
+
*/
|
|
580
|
+
fetch_certificates(attestation) {
|
|
581
|
+
_assertClass(attestation, ParsedAttestation);
|
|
582
|
+
const ret = wasm.kds_fetch_certificates(this.__wbg_ptr, attestation.__wbg_ptr);
|
|
583
|
+
return ret;
|
|
584
|
+
}
|
|
585
|
+
/**
|
|
586
|
+
* Fetches the certificate revocation list from AMD's KDS
|
|
587
|
+
* @param {ParsedAttestation} attestation
|
|
588
|
+
* @returns {Promise<CRL>}
|
|
589
|
+
*/
|
|
590
|
+
fetch_crl(attestation) {
|
|
591
|
+
_assertClass(attestation, ParsedAttestation);
|
|
592
|
+
const ret = wasm.kds_fetch_crl(this.__wbg_ptr, attestation.__wbg_ptr);
|
|
593
|
+
return ret;
|
|
594
|
+
}
|
|
595
|
+
/**
|
|
596
|
+
* @param {string} cache_url
|
|
597
|
+
*/
|
|
598
|
+
constructor(cache_url) {
|
|
599
|
+
const ptr0 = passStringToWasm0(cache_url, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
600
|
+
const len0 = WASM_VECTOR_LEN;
|
|
601
|
+
const ret = wasm.kds_new(ptr0, len0);
|
|
602
|
+
if (ret[2]) {
|
|
603
|
+
throw takeFromExternrefTable0(ret[1]);
|
|
604
|
+
}
|
|
605
|
+
this.__wbg_ptr = ret[0] >>> 0;
|
|
606
|
+
KdsFinalization.register(this, this.__wbg_ptr, this);
|
|
607
|
+
return this;
|
|
608
|
+
}
|
|
609
|
+
}
|
|
610
|
+
if (Symbol.dispose) Kds.prototype[Symbol.dispose] = Kds.prototype.free;
|
|
611
|
+
exports.Kds = Kds;
|
|
612
|
+
|
|
613
|
+
class KeyChain {
|
|
614
|
+
static __wrap(ptr) {
|
|
615
|
+
ptr = ptr >>> 0;
|
|
616
|
+
const obj = Object.create(KeyChain.prototype);
|
|
617
|
+
obj.__wbg_ptr = ptr;
|
|
618
|
+
KeyChainFinalization.register(obj, obj.__wbg_ptr, obj);
|
|
619
|
+
return obj;
|
|
620
|
+
}
|
|
621
|
+
__destroy_into_raw() {
|
|
622
|
+
const ptr = this.__wbg_ptr;
|
|
623
|
+
this.__wbg_ptr = 0;
|
|
624
|
+
KeyChainFinalization.unregister(this);
|
|
625
|
+
return ptr;
|
|
626
|
+
}
|
|
627
|
+
free() {
|
|
628
|
+
const ptr = this.__destroy_into_raw();
|
|
629
|
+
wasm.__wbg_keychain_free(ptr, 0);
|
|
630
|
+
}
|
|
631
|
+
}
|
|
632
|
+
if (Symbol.dispose) KeyChain.prototype[Symbol.dispose] = KeyChain.prototype.free;
|
|
633
|
+
exports.KeyChain = KeyChain;
|
|
634
|
+
|
|
397
635
|
class Modules {
|
|
398
636
|
static __wrap(ptr) {
|
|
399
637
|
ptr = ptr >>> 0;
|
|
@@ -459,210 +697,30 @@ class NvidiaAttestResult {
|
|
|
459
697
|
if (Symbol.dispose) NvidiaAttestResult.prototype[Symbol.dispose] = NvidiaAttestResult.prototype.free;
|
|
460
698
|
exports.NvidiaAttestResult = NvidiaAttestResult;
|
|
461
699
|
|
|
462
|
-
class
|
|
463
|
-
__destroy_into_raw() {
|
|
464
|
-
const ptr = this.__wbg_ptr;
|
|
465
|
-
this.__wbg_ptr = 0;
|
|
466
|
-
PcsFinalization.unregister(this);
|
|
467
|
-
return ptr;
|
|
468
|
-
}
|
|
469
|
-
free() {
|
|
470
|
-
const ptr = this.__destroy_into_raw();
|
|
471
|
-
wasm.__wbg_pcs_free(ptr, 0);
|
|
472
|
-
}
|
|
473
|
-
/**
|
|
474
|
-
* @param {TdxQuote} quote
|
|
475
|
-
* @returns {Promise<Collateral>}
|
|
476
|
-
*/
|
|
477
|
-
fetch_collateral(quote) {
|
|
478
|
-
_assertClass(quote, TdxQuote);
|
|
479
|
-
const ret = wasm.pcs_fetch_collateral(this.__wbg_ptr, quote.__wbg_ptr);
|
|
480
|
-
return ret;
|
|
481
|
-
}
|
|
482
|
-
/**
|
|
483
|
-
* @param {string} base_url
|
|
484
|
-
*/
|
|
485
|
-
constructor(base_url) {
|
|
486
|
-
const ptr0 = passStringToWasm0(base_url, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
487
|
-
const len0 = WASM_VECTOR_LEN;
|
|
488
|
-
const ret = wasm.pcs_new(ptr0, len0);
|
|
489
|
-
if (ret[2]) {
|
|
490
|
-
throw takeFromExternrefTable0(ret[1]);
|
|
491
|
-
}
|
|
492
|
-
this.__wbg_ptr = ret[0] >>> 0;
|
|
493
|
-
PcsFinalization.register(this, this.__wbg_ptr, this);
|
|
494
|
-
return this;
|
|
495
|
-
}
|
|
496
|
-
}
|
|
497
|
-
if (Symbol.dispose) Pcs.prototype[Symbol.dispose] = Pcs.prototype.free;
|
|
498
|
-
exports.Pcs = Pcs;
|
|
499
|
-
|
|
500
|
-
/**
|
|
501
|
-
* Generic per-request query parameters.
|
|
502
|
-
*
|
|
503
|
-
* The `nonce` key is reserved and will be rejected.
|
|
504
|
-
*/
|
|
505
|
-
class QueryParams {
|
|
506
|
-
static __wrap(ptr) {
|
|
507
|
-
ptr = ptr >>> 0;
|
|
508
|
-
const obj = Object.create(QueryParams.prototype);
|
|
509
|
-
obj.__wbg_ptr = ptr;
|
|
510
|
-
QueryParamsFinalization.register(obj, obj.__wbg_ptr, obj);
|
|
511
|
-
return obj;
|
|
512
|
-
}
|
|
513
|
-
__destroy_into_raw() {
|
|
514
|
-
const ptr = this.__wbg_ptr;
|
|
515
|
-
this.__wbg_ptr = 0;
|
|
516
|
-
QueryParamsFinalization.unregister(this);
|
|
517
|
-
return ptr;
|
|
518
|
-
}
|
|
519
|
-
free() {
|
|
520
|
-
const ptr = this.__destroy_into_raw();
|
|
521
|
-
wasm.__wbg_queryparams_free(ptr, 0);
|
|
522
|
-
}
|
|
523
|
-
constructor() {
|
|
524
|
-
const ret = wasm.queryparams_new();
|
|
525
|
-
this.__wbg_ptr = ret >>> 0;
|
|
526
|
-
QueryParamsFinalization.register(this, this.__wbg_ptr, this);
|
|
527
|
-
return this;
|
|
528
|
-
}
|
|
529
|
-
/**
|
|
530
|
-
* Appends a query parameter.
|
|
531
|
-
*
|
|
532
|
-
* Reserved keywords for specific queries will get overwritten
|
|
533
|
-
* @param {string} key
|
|
534
|
-
* @param {string} value
|
|
535
|
-
* @returns {QueryParams}
|
|
536
|
-
*/
|
|
537
|
-
with(key, value) {
|
|
538
|
-
const ptr = this.__destroy_into_raw();
|
|
539
|
-
const ptr0 = passStringToWasm0(key, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
540
|
-
const len0 = WASM_VECTOR_LEN;
|
|
541
|
-
const ptr1 = passStringToWasm0(value, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
542
|
-
const len1 = WASM_VECTOR_LEN;
|
|
543
|
-
const ret = wasm.queryparams_with(ptr, ptr0, len0, ptr1, len1);
|
|
544
|
-
return QueryParams.__wrap(ret);
|
|
545
|
-
}
|
|
546
|
-
}
|
|
547
|
-
if (Symbol.dispose) QueryParams.prototype[Symbol.dispose] = QueryParams.prototype.free;
|
|
548
|
-
exports.QueryParams = QueryParams;
|
|
549
|
-
|
|
550
|
-
class QuoteVerifier {
|
|
551
|
-
__destroy_into_raw() {
|
|
552
|
-
const ptr = this.__wbg_ptr;
|
|
553
|
-
this.__wbg_ptr = 0;
|
|
554
|
-
QuoteVerifierFinalization.unregister(this);
|
|
555
|
-
return ptr;
|
|
556
|
-
}
|
|
557
|
-
free() {
|
|
558
|
-
const ptr = this.__destroy_into_raw();
|
|
559
|
-
wasm.__wbg_quoteverifier_free(ptr, 0);
|
|
560
|
-
}
|
|
561
|
-
/**
|
|
562
|
-
* @param {Collateral} collateral
|
|
563
|
-
* @param {TdxQuote} quote
|
|
564
|
-
*/
|
|
565
|
-
constructor(collateral, quote) {
|
|
566
|
-
_assertClass(collateral, Collateral);
|
|
567
|
-
var ptr0 = collateral.__destroy_into_raw();
|
|
568
|
-
_assertClass(quote, TdxQuote);
|
|
569
|
-
var ptr1 = quote.__destroy_into_raw();
|
|
570
|
-
const ret = wasm.quoteverifier_new(ptr0, ptr1);
|
|
571
|
-
this.__wbg_ptr = ret >>> 0;
|
|
572
|
-
QuoteVerifierFinalization.register(this, this.__wbg_ptr, this);
|
|
573
|
-
return this;
|
|
574
|
-
}
|
|
575
|
-
/**
|
|
576
|
-
* @param {TdxNonce} nonce
|
|
577
|
-
*/
|
|
578
|
-
verify(nonce) {
|
|
579
|
-
_assertClass(nonce, TdxNonce);
|
|
580
|
-
const ret = wasm.quoteverifier_verify(this.__wbg_ptr, nonce.__wbg_ptr);
|
|
581
|
-
if (ret[1]) {
|
|
582
|
-
throw takeFromExternrefTable0(ret[0]);
|
|
583
|
-
}
|
|
584
|
-
}
|
|
585
|
-
}
|
|
586
|
-
if (Symbol.dispose) QuoteVerifier.prototype[Symbol.dispose] = QuoteVerifier.prototype.free;
|
|
587
|
-
exports.QuoteVerifier = QuoteVerifier;
|
|
588
|
-
|
|
589
|
-
class ResponseHeaders {
|
|
700
|
+
class NvidiaNonce {
|
|
590
701
|
static __wrap(ptr) {
|
|
591
702
|
ptr = ptr >>> 0;
|
|
592
|
-
const obj = Object.create(
|
|
703
|
+
const obj = Object.create(NvidiaNonce.prototype);
|
|
593
704
|
obj.__wbg_ptr = ptr;
|
|
594
|
-
|
|
705
|
+
NvidiaNonceFinalization.register(obj, obj.__wbg_ptr, obj);
|
|
595
706
|
return obj;
|
|
596
707
|
}
|
|
597
708
|
__destroy_into_raw() {
|
|
598
709
|
const ptr = this.__wbg_ptr;
|
|
599
710
|
this.__wbg_ptr = 0;
|
|
600
|
-
|
|
711
|
+
NvidiaNonceFinalization.unregister(this);
|
|
601
712
|
return ptr;
|
|
602
713
|
}
|
|
603
714
|
free() {
|
|
604
715
|
const ptr = this.__destroy_into_raw();
|
|
605
|
-
wasm.
|
|
606
|
-
}
|
|
607
|
-
/**
|
|
608
|
-
* @param {string} name
|
|
609
|
-
* @returns {string | undefined}
|
|
610
|
-
*/
|
|
611
|
-
get(name) {
|
|
612
|
-
const ptr0 = passStringToWasm0(name, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
613
|
-
const len0 = WASM_VECTOR_LEN;
|
|
614
|
-
const ret = wasm.responseheaders_get(this.__wbg_ptr, ptr0, len0);
|
|
615
|
-
let v2;
|
|
616
|
-
if (ret[0] !== 0) {
|
|
617
|
-
v2 = getStringFromWasm0(ret[0], ret[1]).slice();
|
|
618
|
-
wasm.__wbindgen_free(ret[0], ret[1] * 1, 1);
|
|
619
|
-
}
|
|
620
|
-
return v2;
|
|
716
|
+
wasm.__wbg_nvidianonce_free(ptr, 0);
|
|
621
717
|
}
|
|
622
718
|
/**
|
|
623
|
-
* @returns {
|
|
719
|
+
* @returns {NvidiaNonce}
|
|
624
720
|
*/
|
|
625
|
-
|
|
626
|
-
const ret = wasm.
|
|
627
|
-
|
|
628
|
-
wasm.__wbindgen_free(ret[0], ret[1] * 4, 4);
|
|
629
|
-
return v1;
|
|
630
|
-
}
|
|
631
|
-
}
|
|
632
|
-
if (Symbol.dispose) ResponseHeaders.prototype[Symbol.dispose] = ResponseHeaders.prototype.free;
|
|
633
|
-
exports.ResponseHeaders = ResponseHeaders;
|
|
634
|
-
|
|
635
|
-
class TcbLevels {
|
|
636
|
-
__destroy_into_raw() {
|
|
637
|
-
const ptr = this.__wbg_ptr;
|
|
638
|
-
this.__wbg_ptr = 0;
|
|
639
|
-
TcbLevelsFinalization.unregister(this);
|
|
640
|
-
return ptr;
|
|
641
|
-
}
|
|
642
|
-
free() {
|
|
643
|
-
const ptr = this.__destroy_into_raw();
|
|
644
|
-
wasm.__wbg_tcblevels_free(ptr, 0);
|
|
645
|
-
}
|
|
646
|
-
}
|
|
647
|
-
if (Symbol.dispose) TcbLevels.prototype[Symbol.dispose] = TcbLevels.prototype.free;
|
|
648
|
-
exports.TcbLevels = TcbLevels;
|
|
649
|
-
|
|
650
|
-
class TdxNonce {
|
|
651
|
-
__destroy_into_raw() {
|
|
652
|
-
const ptr = this.__wbg_ptr;
|
|
653
|
-
this.__wbg_ptr = 0;
|
|
654
|
-
TdxNonceFinalization.unregister(this);
|
|
655
|
-
return ptr;
|
|
656
|
-
}
|
|
657
|
-
free() {
|
|
658
|
-
const ptr = this.__destroy_into_raw();
|
|
659
|
-
wasm.__wbg_tdxnonce_free(ptr, 0);
|
|
660
|
-
}
|
|
661
|
-
constructor() {
|
|
662
|
-
const ret = wasm.tdxnonce_generate();
|
|
663
|
-
this.__wbg_ptr = ret >>> 0;
|
|
664
|
-
TdxNonceFinalization.register(this, this.__wbg_ptr, this);
|
|
665
|
-
return this;
|
|
721
|
+
static generate() {
|
|
722
|
+
const ret = wasm.nvidianonce_generate();
|
|
723
|
+
return NvidiaNonce.__wrap(ret);
|
|
666
724
|
}
|
|
667
725
|
/**
|
|
668
726
|
* @returns {string}
|
|
@@ -671,7 +729,7 @@ class TdxNonce {
|
|
|
671
729
|
let deferred1_0;
|
|
672
730
|
let deferred1_1;
|
|
673
731
|
try {
|
|
674
|
-
const ret = wasm.
|
|
732
|
+
const ret = wasm.nvidianonce_to_hex(this.__wbg_ptr);
|
|
675
733
|
deferred1_0 = ret[0];
|
|
676
734
|
deferred1_1 = ret[1];
|
|
677
735
|
return getStringFromWasm0(ret[0], ret[1]);
|
|
@@ -680,430 +738,248 @@ class TdxNonce {
|
|
|
680
738
|
}
|
|
681
739
|
}
|
|
682
740
|
}
|
|
683
|
-
if (Symbol.dispose)
|
|
684
|
-
exports.
|
|
741
|
+
if (Symbol.dispose) NvidiaNonce.prototype[Symbol.dispose] = NvidiaNonce.prototype.free;
|
|
742
|
+
exports.NvidiaNonce = NvidiaNonce;
|
|
685
743
|
|
|
686
|
-
|
|
744
|
+
/**
|
|
745
|
+
* Represents a parsed attestation report with some already
|
|
746
|
+
* parsed commonly accessed fields
|
|
747
|
+
*/
|
|
748
|
+
class ParsedAttestation {
|
|
687
749
|
static __wrap(ptr) {
|
|
688
750
|
ptr = ptr >>> 0;
|
|
689
|
-
const obj = Object.create(
|
|
751
|
+
const obj = Object.create(ParsedAttestation.prototype);
|
|
690
752
|
obj.__wbg_ptr = ptr;
|
|
691
|
-
|
|
753
|
+
ParsedAttestationFinalization.register(obj, obj.__wbg_ptr, obj);
|
|
692
754
|
return obj;
|
|
693
755
|
}
|
|
694
756
|
__destroy_into_raw() {
|
|
695
757
|
const ptr = this.__wbg_ptr;
|
|
696
758
|
this.__wbg_ptr = 0;
|
|
697
|
-
|
|
759
|
+
ParsedAttestationFinalization.unregister(this);
|
|
698
760
|
return ptr;
|
|
699
761
|
}
|
|
700
762
|
free() {
|
|
701
763
|
const ptr = this.__destroy_into_raw();
|
|
702
|
-
wasm.
|
|
764
|
+
wasm.__wbg_parsedattestation_free(ptr, 0);
|
|
703
765
|
}
|
|
704
766
|
/**
|
|
705
|
-
*
|
|
706
|
-
* @param {Uint8Array} quote
|
|
707
|
-
* @returns {TdxQuote}
|
|
767
|
+
* @returns {number}
|
|
708
768
|
*/
|
|
709
|
-
|
|
710
|
-
const
|
|
711
|
-
|
|
712
|
-
const ret = wasm.tdxquote_from_bytes(ptr0, len0);
|
|
713
|
-
if (ret[2]) {
|
|
714
|
-
throw takeFromExternrefTable0(ret[1]);
|
|
715
|
-
}
|
|
716
|
-
return TdxQuote.__wrap(ret[0]);
|
|
717
|
-
}
|
|
718
|
-
}
|
|
719
|
-
if (Symbol.dispose) TdxQuote.prototype[Symbol.dispose] = TdxQuote.prototype.free;
|
|
720
|
-
exports.TdxQuote = TdxQuote;
|
|
721
|
-
|
|
722
|
-
class DecodedClaims {
|
|
723
|
-
static __wrap(ptr) {
|
|
724
|
-
ptr = ptr >>> 0;
|
|
725
|
-
const obj = Object.create(DecodedClaims.prototype);
|
|
726
|
-
obj.__wbg_ptr = ptr;
|
|
727
|
-
DecodedClaimsFinalization.register(obj, obj.__wbg_ptr, obj);
|
|
728
|
-
return obj;
|
|
729
|
-
}
|
|
730
|
-
__destroy_into_raw() {
|
|
731
|
-
const ptr = this.__wbg_ptr;
|
|
732
|
-
this.__wbg_ptr = 0;
|
|
733
|
-
DecodedClaimsFinalization.unregister(this);
|
|
734
|
-
return ptr;
|
|
735
|
-
}
|
|
736
|
-
free() {
|
|
737
|
-
const ptr = this.__destroy_into_raw();
|
|
738
|
-
wasm.__wbg_nvidia__decodedclaims_free(ptr, 0);
|
|
739
|
-
}
|
|
740
|
-
}
|
|
741
|
-
if (Symbol.dispose) DecodedClaims.prototype[Symbol.dispose] = DecodedClaims.prototype.free;
|
|
742
|
-
|
|
743
|
-
class EATToken {
|
|
744
|
-
static __wrap(ptr) {
|
|
745
|
-
ptr = ptr >>> 0;
|
|
746
|
-
const obj = Object.create(EATToken.prototype);
|
|
747
|
-
obj.__wbg_ptr = ptr;
|
|
748
|
-
EATTokenFinalization.register(obj, obj.__wbg_ptr, obj);
|
|
749
|
-
return obj;
|
|
750
|
-
}
|
|
751
|
-
__destroy_into_raw() {
|
|
752
|
-
const ptr = this.__wbg_ptr;
|
|
753
|
-
this.__wbg_ptr = 0;
|
|
754
|
-
EATTokenFinalization.unregister(this);
|
|
755
|
-
return ptr;
|
|
756
|
-
}
|
|
757
|
-
free() {
|
|
758
|
-
const ptr = this.__destroy_into_raw();
|
|
759
|
-
wasm.__wbg_nvidia__eattoken_free(ptr, 0);
|
|
769
|
+
cpu_fam_id() {
|
|
770
|
+
const ret = wasm.parsedattestation_cpu_fam_id(this.__wbg_ptr);
|
|
771
|
+
return ret;
|
|
760
772
|
}
|
|
761
773
|
/**
|
|
762
|
-
* @
|
|
763
|
-
* @returns {EATToken}
|
|
774
|
+
* @returns {number}
|
|
764
775
|
*/
|
|
765
|
-
|
|
766
|
-
const
|
|
767
|
-
|
|
768
|
-
const ret = wasm.eattoken_parse(ptr0, len0);
|
|
769
|
-
if (ret[2]) {
|
|
770
|
-
throw takeFromExternrefTable0(ret[1]);
|
|
771
|
-
}
|
|
772
|
-
return EATToken.__wrap(ret[0]);
|
|
776
|
+
cpu_mod_id() {
|
|
777
|
+
const ret = wasm.parsedattestation_cpu_mod_id(this.__wbg_ptr);
|
|
778
|
+
return ret;
|
|
773
779
|
}
|
|
774
780
|
/**
|
|
775
|
-
*
|
|
776
|
-
* @param {
|
|
777
|
-
* @returns {
|
|
781
|
+
* Parses and constructs a new attestation report from a stream of binary data
|
|
782
|
+
* @param {Uint8Array} bytes
|
|
783
|
+
* @returns {ParsedAttestation}
|
|
778
784
|
*/
|
|
779
|
-
|
|
780
|
-
const
|
|
781
|
-
|
|
782
|
-
|
|
783
|
-
const ret = wasm.eattoken_verify(ptr, keys.__wbg_ptr, nonce.__wbg_ptr);
|
|
785
|
+
static new(bytes) {
|
|
786
|
+
const ptr0 = passArray8ToWasm0(bytes, wasm.__wbindgen_malloc);
|
|
787
|
+
const len0 = WASM_VECTOR_LEN;
|
|
788
|
+
const ret = wasm.parsedattestation_new(ptr0, len0);
|
|
784
789
|
if (ret[2]) {
|
|
785
790
|
throw takeFromExternrefTable0(ret[1]);
|
|
786
791
|
}
|
|
787
|
-
return
|
|
788
|
-
}
|
|
789
|
-
}
|
|
790
|
-
if (Symbol.dispose) EATToken.prototype[Symbol.dispose] = EATToken.prototype.free;
|
|
791
|
-
|
|
792
|
-
class KeyChain {
|
|
793
|
-
static __wrap(ptr) {
|
|
794
|
-
ptr = ptr >>> 0;
|
|
795
|
-
const obj = Object.create(KeyChain.prototype);
|
|
796
|
-
obj.__wbg_ptr = ptr;
|
|
797
|
-
KeyChainFinalization.register(obj, obj.__wbg_ptr, obj);
|
|
798
|
-
return obj;
|
|
799
|
-
}
|
|
800
|
-
__destroy_into_raw() {
|
|
801
|
-
const ptr = this.__wbg_ptr;
|
|
802
|
-
this.__wbg_ptr = 0;
|
|
803
|
-
KeyChainFinalization.unregister(this);
|
|
804
|
-
return ptr;
|
|
805
|
-
}
|
|
806
|
-
free() {
|
|
807
|
-
const ptr = this.__destroy_into_raw();
|
|
808
|
-
wasm.__wbg_nvidia__keychain_free(ptr, 0);
|
|
809
|
-
}
|
|
810
|
-
}
|
|
811
|
-
if (Symbol.dispose) KeyChain.prototype[Symbol.dispose] = KeyChain.prototype.free;
|
|
812
|
-
|
|
813
|
-
class NvidiaNonce {
|
|
814
|
-
static __wrap(ptr) {
|
|
815
|
-
ptr = ptr >>> 0;
|
|
816
|
-
const obj = Object.create(NvidiaNonce.prototype);
|
|
817
|
-
obj.__wbg_ptr = ptr;
|
|
818
|
-
NvidiaNonceFinalization.register(obj, obj.__wbg_ptr, obj);
|
|
819
|
-
return obj;
|
|
820
|
-
}
|
|
821
|
-
__destroy_into_raw() {
|
|
822
|
-
const ptr = this.__wbg_ptr;
|
|
823
|
-
this.__wbg_ptr = 0;
|
|
824
|
-
NvidiaNonceFinalization.unregister(this);
|
|
825
|
-
return ptr;
|
|
826
|
-
}
|
|
827
|
-
free() {
|
|
828
|
-
const ptr = this.__destroy_into_raw();
|
|
829
|
-
wasm.__wbg_nvidia__nvidianonce_free(ptr, 0);
|
|
830
|
-
}
|
|
831
|
-
/**
|
|
832
|
-
* @returns {NvidiaNonce}
|
|
833
|
-
*/
|
|
834
|
-
static generate() {
|
|
835
|
-
const ret = wasm.nvidianonce_generate();
|
|
836
|
-
return NvidiaNonce.__wrap(ret);
|
|
792
|
+
return ParsedAttestation.__wrap(ret[0]);
|
|
837
793
|
}
|
|
838
794
|
/**
|
|
839
|
-
*
|
|
795
|
+
* Verifies the attestation report against a certificate chain
|
|
796
|
+
* @param {VerifiedChain} chain
|
|
797
|
+
* @param {SevNonce} nonce
|
|
840
798
|
*/
|
|
841
|
-
|
|
842
|
-
|
|
843
|
-
|
|
844
|
-
|
|
845
|
-
|
|
846
|
-
|
|
847
|
-
deferred1_1 = ret[1];
|
|
848
|
-
return getStringFromWasm0(ret[0], ret[1]);
|
|
849
|
-
} finally {
|
|
850
|
-
wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
|
|
799
|
+
verify(chain, nonce) {
|
|
800
|
+
_assertClass(chain, VerifiedChain);
|
|
801
|
+
_assertClass(nonce, SevNonce);
|
|
802
|
+
const ret = wasm.parsedattestation_verify(this.__wbg_ptr, chain.__wbg_ptr, nonce.__wbg_ptr);
|
|
803
|
+
if (ret[1]) {
|
|
804
|
+
throw takeFromExternrefTable0(ret[0]);
|
|
851
805
|
}
|
|
852
806
|
}
|
|
853
807
|
}
|
|
854
|
-
if (Symbol.dispose)
|
|
855
|
-
|
|
856
|
-
/**
|
|
857
|
-
* Same as [`KeyChain:fetch_keychain`], put in for better wasm compatibility
|
|
858
|
-
* @returns {Promise<KeyChain>}
|
|
859
|
-
*/
|
|
860
|
-
function fetch_keychain() {
|
|
861
|
-
const ret = wasm.nvidia__fetch_keychain();
|
|
862
|
-
return ret;
|
|
863
|
-
}
|
|
864
|
-
|
|
865
|
-
const nvidia = {};
|
|
866
|
-
nvidia.DecodedClaims = DecodedClaims;
|
|
867
|
-
nvidia.EATToken = EATToken;
|
|
868
|
-
nvidia.KeyChain = KeyChain;
|
|
869
|
-
nvidia.NvidiaNonce = NvidiaNonce;
|
|
870
|
-
nvidia.fetch_keychain = fetch_keychain;
|
|
871
|
-
exports.nvidia = nvidia;
|
|
808
|
+
if (Symbol.dispose) ParsedAttestation.prototype[Symbol.dispose] = ParsedAttestation.prototype.free;
|
|
809
|
+
exports.ParsedAttestation = ParsedAttestation;
|
|
872
810
|
|
|
873
|
-
|
|
874
|
-
* A parsed certificate revocation list
|
|
875
|
-
*/
|
|
876
|
-
class CRL {
|
|
877
|
-
static __wrap(ptr) {
|
|
878
|
-
ptr = ptr >>> 0;
|
|
879
|
-
const obj = Object.create(CRL.prototype);
|
|
880
|
-
obj.__wbg_ptr = ptr;
|
|
881
|
-
CRLFinalization.register(obj, obj.__wbg_ptr, obj);
|
|
882
|
-
return obj;
|
|
883
|
-
}
|
|
811
|
+
class Pcs {
|
|
884
812
|
__destroy_into_raw() {
|
|
885
813
|
const ptr = this.__wbg_ptr;
|
|
886
814
|
this.__wbg_ptr = 0;
|
|
887
|
-
|
|
815
|
+
PcsFinalization.unregister(this);
|
|
888
816
|
return ptr;
|
|
889
817
|
}
|
|
890
818
|
free() {
|
|
891
819
|
const ptr = this.__destroy_into_raw();
|
|
892
|
-
wasm.
|
|
820
|
+
wasm.__wbg_pcs_free(ptr, 0);
|
|
893
821
|
}
|
|
894
822
|
/**
|
|
895
|
-
*
|
|
896
|
-
*
|
|
897
|
-
* @param {VerifiedChain} chain
|
|
823
|
+
* @param {TdxQuote} quote
|
|
824
|
+
* @returns {Promise<Collateral>}
|
|
898
825
|
*/
|
|
899
|
-
|
|
900
|
-
_assertClass(
|
|
901
|
-
const ret = wasm.
|
|
902
|
-
|
|
903
|
-
throw takeFromExternrefTable0(ret[0]);
|
|
904
|
-
}
|
|
826
|
+
fetch_collateral(quote) {
|
|
827
|
+
_assertClass(quote, TdxQuote);
|
|
828
|
+
const ret = wasm.pcs_fetch_collateral(this.__wbg_ptr, quote.__wbg_ptr);
|
|
829
|
+
return ret;
|
|
905
830
|
}
|
|
906
831
|
/**
|
|
907
|
-
*
|
|
908
|
-
* @param {Uint8Array} list
|
|
909
|
-
* @returns {CRL}
|
|
832
|
+
* @param {string} base_url
|
|
910
833
|
*/
|
|
911
|
-
|
|
912
|
-
const ptr0 =
|
|
834
|
+
constructor(base_url) {
|
|
835
|
+
const ptr0 = passStringToWasm0(base_url, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
913
836
|
const len0 = WASM_VECTOR_LEN;
|
|
914
|
-
const ret = wasm.
|
|
837
|
+
const ret = wasm.pcs_new(ptr0, len0);
|
|
915
838
|
if (ret[2]) {
|
|
916
839
|
throw takeFromExternrefTable0(ret[1]);
|
|
917
840
|
}
|
|
918
|
-
|
|
841
|
+
this.__wbg_ptr = ret[0] >>> 0;
|
|
842
|
+
PcsFinalization.register(this, this.__wbg_ptr, this);
|
|
843
|
+
return this;
|
|
919
844
|
}
|
|
920
845
|
}
|
|
921
|
-
if (Symbol.dispose)
|
|
846
|
+
if (Symbol.dispose) Pcs.prototype[Symbol.dispose] = Pcs.prototype.free;
|
|
847
|
+
exports.Pcs = Pcs;
|
|
922
848
|
|
|
923
|
-
|
|
849
|
+
/**
|
|
850
|
+
* Generic per-request query parameters.
|
|
851
|
+
*
|
|
852
|
+
* The `nonce` key is reserved and will be rejected.
|
|
853
|
+
*/
|
|
854
|
+
class QueryParams {
|
|
924
855
|
static __wrap(ptr) {
|
|
925
856
|
ptr = ptr >>> 0;
|
|
926
|
-
const obj = Object.create(
|
|
857
|
+
const obj = Object.create(QueryParams.prototype);
|
|
927
858
|
obj.__wbg_ptr = ptr;
|
|
928
|
-
|
|
859
|
+
QueryParamsFinalization.register(obj, obj.__wbg_ptr, obj);
|
|
929
860
|
return obj;
|
|
930
861
|
}
|
|
931
862
|
__destroy_into_raw() {
|
|
932
863
|
const ptr = this.__wbg_ptr;
|
|
933
864
|
this.__wbg_ptr = 0;
|
|
934
|
-
|
|
865
|
+
QueryParamsFinalization.unregister(this);
|
|
935
866
|
return ptr;
|
|
936
867
|
}
|
|
937
868
|
free() {
|
|
938
869
|
const ptr = this.__destroy_into_raw();
|
|
939
|
-
wasm.
|
|
940
|
-
}
|
|
941
|
-
/**
|
|
942
|
-
* @returns {Uint8Array}
|
|
943
|
-
*/
|
|
944
|
-
get ark() {
|
|
945
|
-
const ret = wasm.__wbg_get_sev__exportpem_ark(this.__wbg_ptr);
|
|
946
|
-
var v1 = getArrayU8FromWasm0(ret[0], ret[1]).slice();
|
|
947
|
-
wasm.__wbindgen_free(ret[0], ret[1] * 1, 1);
|
|
948
|
-
return v1;
|
|
949
|
-
}
|
|
950
|
-
/**
|
|
951
|
-
* @returns {Uint8Array}
|
|
952
|
-
*/
|
|
953
|
-
get ask() {
|
|
954
|
-
const ret = wasm.__wbg_get_sev__exportpem_ask(this.__wbg_ptr);
|
|
955
|
-
var v1 = getArrayU8FromWasm0(ret[0], ret[1]).slice();
|
|
956
|
-
wasm.__wbindgen_free(ret[0], ret[1] * 1, 1);
|
|
957
|
-
return v1;
|
|
958
|
-
}
|
|
959
|
-
/**
|
|
960
|
-
* @returns {Uint8Array}
|
|
961
|
-
*/
|
|
962
|
-
get vek() {
|
|
963
|
-
const ret = wasm.__wbg_get_sev__exportpem_vek(this.__wbg_ptr);
|
|
964
|
-
var v1 = getArrayU8FromWasm0(ret[0], ret[1]).slice();
|
|
965
|
-
wasm.__wbindgen_free(ret[0], ret[1] * 1, 1);
|
|
966
|
-
return v1;
|
|
967
|
-
}
|
|
968
|
-
/**
|
|
969
|
-
* @param {Uint8Array} arg0
|
|
970
|
-
*/
|
|
971
|
-
set ark(arg0) {
|
|
972
|
-
const ptr0 = passArray8ToWasm0(arg0, wasm.__wbindgen_malloc);
|
|
973
|
-
const len0 = WASM_VECTOR_LEN;
|
|
974
|
-
wasm.__wbg_set_sev__exportpem_ark(this.__wbg_ptr, ptr0, len0);
|
|
870
|
+
wasm.__wbg_queryparams_free(ptr, 0);
|
|
975
871
|
}
|
|
976
|
-
|
|
977
|
-
|
|
978
|
-
|
|
979
|
-
|
|
980
|
-
|
|
981
|
-
const len0 = WASM_VECTOR_LEN;
|
|
982
|
-
wasm.__wbg_set_sev__exportpem_ask(this.__wbg_ptr, ptr0, len0);
|
|
872
|
+
constructor() {
|
|
873
|
+
const ret = wasm.queryparams_new();
|
|
874
|
+
this.__wbg_ptr = ret >>> 0;
|
|
875
|
+
QueryParamsFinalization.register(this, this.__wbg_ptr, this);
|
|
876
|
+
return this;
|
|
983
877
|
}
|
|
984
878
|
/**
|
|
985
|
-
*
|
|
879
|
+
* Appends a query parameter.
|
|
880
|
+
*
|
|
881
|
+
* Reserved keywords for specific queries will get overwritten
|
|
882
|
+
* @param {string} key
|
|
883
|
+
* @param {string} value
|
|
884
|
+
* @returns {QueryParams}
|
|
986
885
|
*/
|
|
987
|
-
|
|
988
|
-
const
|
|
886
|
+
with(key, value) {
|
|
887
|
+
const ptr = this.__destroy_into_raw();
|
|
888
|
+
const ptr0 = passStringToWasm0(key, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
989
889
|
const len0 = WASM_VECTOR_LEN;
|
|
990
|
-
|
|
890
|
+
const ptr1 = passStringToWasm0(value, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
891
|
+
const len1 = WASM_VECTOR_LEN;
|
|
892
|
+
const ret = wasm.queryparams_with(ptr, ptr0, len0, ptr1, len1);
|
|
893
|
+
return QueryParams.__wrap(ret);
|
|
991
894
|
}
|
|
992
895
|
}
|
|
993
|
-
if (Symbol.dispose)
|
|
896
|
+
if (Symbol.dispose) QueryParams.prototype[Symbol.dispose] = QueryParams.prototype.free;
|
|
897
|
+
exports.QueryParams = QueryParams;
|
|
994
898
|
|
|
995
|
-
class
|
|
899
|
+
class QuoteVerifier {
|
|
996
900
|
__destroy_into_raw() {
|
|
997
901
|
const ptr = this.__wbg_ptr;
|
|
998
902
|
this.__wbg_ptr = 0;
|
|
999
|
-
|
|
903
|
+
QuoteVerifierFinalization.unregister(this);
|
|
1000
904
|
return ptr;
|
|
1001
905
|
}
|
|
1002
906
|
free() {
|
|
1003
907
|
const ptr = this.__destroy_into_raw();
|
|
1004
|
-
wasm.
|
|
1005
|
-
}
|
|
1006
|
-
/**
|
|
1007
|
-
* @param {ParsedAttestation} attestation
|
|
1008
|
-
* @returns {Promise<VerifiedChain>}
|
|
1009
|
-
*/
|
|
1010
|
-
fetch_certificates(attestation) {
|
|
1011
|
-
_assertClass(attestation, ParsedAttestation);
|
|
1012
|
-
const ret = wasm.kds_fetch_certificates(this.__wbg_ptr, attestation.__wbg_ptr);
|
|
1013
|
-
return ret;
|
|
908
|
+
wasm.__wbg_quoteverifier_free(ptr, 0);
|
|
1014
909
|
}
|
|
1015
910
|
/**
|
|
1016
|
-
*
|
|
1017
|
-
* @param {
|
|
1018
|
-
* @returns {Promise<CRL>}
|
|
911
|
+
* @param {Collateral} collateral
|
|
912
|
+
* @param {TdxQuote} quote
|
|
1019
913
|
*/
|
|
1020
|
-
|
|
1021
|
-
_assertClass(
|
|
1022
|
-
|
|
1023
|
-
|
|
914
|
+
constructor(collateral, quote) {
|
|
915
|
+
_assertClass(collateral, Collateral);
|
|
916
|
+
var ptr0 = collateral.__destroy_into_raw();
|
|
917
|
+
_assertClass(quote, TdxQuote);
|
|
918
|
+
var ptr1 = quote.__destroy_into_raw();
|
|
919
|
+
const ret = wasm.quoteverifier_new(ptr0, ptr1);
|
|
920
|
+
this.__wbg_ptr = ret >>> 0;
|
|
921
|
+
QuoteVerifierFinalization.register(this, this.__wbg_ptr, this);
|
|
922
|
+
return this;
|
|
1024
923
|
}
|
|
1025
924
|
/**
|
|
1026
|
-
* @param {
|
|
925
|
+
* @param {TdxNonce} nonce
|
|
1027
926
|
*/
|
|
1028
|
-
|
|
1029
|
-
|
|
1030
|
-
const
|
|
1031
|
-
|
|
1032
|
-
|
|
1033
|
-
throw takeFromExternrefTable0(ret[1]);
|
|
927
|
+
verify(nonce) {
|
|
928
|
+
_assertClass(nonce, TdxNonce);
|
|
929
|
+
const ret = wasm.quoteverifier_verify(this.__wbg_ptr, nonce.__wbg_ptr);
|
|
930
|
+
if (ret[1]) {
|
|
931
|
+
throw takeFromExternrefTable0(ret[0]);
|
|
1034
932
|
}
|
|
1035
|
-
this.__wbg_ptr = ret[0] >>> 0;
|
|
1036
|
-
KdsFinalization.register(this, this.__wbg_ptr, this);
|
|
1037
|
-
return this;
|
|
1038
933
|
}
|
|
1039
934
|
}
|
|
1040
|
-
if (Symbol.dispose)
|
|
935
|
+
if (Symbol.dispose) QuoteVerifier.prototype[Symbol.dispose] = QuoteVerifier.prototype.free;
|
|
936
|
+
exports.QuoteVerifier = QuoteVerifier;
|
|
1041
937
|
|
|
1042
|
-
|
|
1043
|
-
* Represents a parsed attestation report with some already
|
|
1044
|
-
* parsed commonly accessed fields
|
|
1045
|
-
*/
|
|
1046
|
-
class ParsedAttestation {
|
|
938
|
+
class ResponseHeaders {
|
|
1047
939
|
static __wrap(ptr) {
|
|
1048
940
|
ptr = ptr >>> 0;
|
|
1049
|
-
const obj = Object.create(
|
|
941
|
+
const obj = Object.create(ResponseHeaders.prototype);
|
|
1050
942
|
obj.__wbg_ptr = ptr;
|
|
1051
|
-
|
|
943
|
+
ResponseHeadersFinalization.register(obj, obj.__wbg_ptr, obj);
|
|
1052
944
|
return obj;
|
|
1053
945
|
}
|
|
1054
946
|
__destroy_into_raw() {
|
|
1055
947
|
const ptr = this.__wbg_ptr;
|
|
1056
948
|
this.__wbg_ptr = 0;
|
|
1057
|
-
|
|
949
|
+
ResponseHeadersFinalization.unregister(this);
|
|
1058
950
|
return ptr;
|
|
1059
951
|
}
|
|
1060
952
|
free() {
|
|
1061
953
|
const ptr = this.__destroy_into_raw();
|
|
1062
|
-
wasm.
|
|
1063
|
-
}
|
|
1064
|
-
/**
|
|
1065
|
-
* @returns {number}
|
|
1066
|
-
*/
|
|
1067
|
-
cpu_fam_id() {
|
|
1068
|
-
const ret = wasm.parsedattestation_cpu_fam_id(this.__wbg_ptr);
|
|
1069
|
-
return ret;
|
|
1070
|
-
}
|
|
1071
|
-
/**
|
|
1072
|
-
* @returns {number}
|
|
1073
|
-
*/
|
|
1074
|
-
cpu_mod_id() {
|
|
1075
|
-
const ret = wasm.parsedattestation_cpu_mod_id(this.__wbg_ptr);
|
|
1076
|
-
return ret;
|
|
954
|
+
wasm.__wbg_responseheaders_free(ptr, 0);
|
|
1077
955
|
}
|
|
1078
956
|
/**
|
|
1079
|
-
*
|
|
1080
|
-
* @
|
|
1081
|
-
* @returns {ParsedAttestation}
|
|
957
|
+
* @param {string} name
|
|
958
|
+
* @returns {string | undefined}
|
|
1082
959
|
*/
|
|
1083
|
-
|
|
1084
|
-
const ptr0 =
|
|
960
|
+
get(name) {
|
|
961
|
+
const ptr0 = passStringToWasm0(name, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
1085
962
|
const len0 = WASM_VECTOR_LEN;
|
|
1086
|
-
const ret = wasm.
|
|
1087
|
-
|
|
1088
|
-
|
|
963
|
+
const ret = wasm.responseheaders_get(this.__wbg_ptr, ptr0, len0);
|
|
964
|
+
let v2;
|
|
965
|
+
if (ret[0] !== 0) {
|
|
966
|
+
v2 = getStringFromWasm0(ret[0], ret[1]).slice();
|
|
967
|
+
wasm.__wbindgen_free(ret[0], ret[1] * 1, 1);
|
|
1089
968
|
}
|
|
1090
|
-
return
|
|
969
|
+
return v2;
|
|
1091
970
|
}
|
|
1092
971
|
/**
|
|
1093
|
-
*
|
|
1094
|
-
* @param {VerifiedChain} chain
|
|
1095
|
-
* @param {SevNonce} nonce
|
|
972
|
+
* @returns {string[]}
|
|
1096
973
|
*/
|
|
1097
|
-
|
|
1098
|
-
|
|
1099
|
-
|
|
1100
|
-
|
|
1101
|
-
|
|
1102
|
-
throw takeFromExternrefTable0(ret[0]);
|
|
1103
|
-
}
|
|
974
|
+
keys() {
|
|
975
|
+
const ret = wasm.responseheaders_keys(this.__wbg_ptr);
|
|
976
|
+
var v1 = getArrayJsValueFromWasm0(ret[0], ret[1]).slice();
|
|
977
|
+
wasm.__wbindgen_free(ret[0], ret[1] * 4, 4);
|
|
978
|
+
return v1;
|
|
1104
979
|
}
|
|
1105
980
|
}
|
|
1106
|
-
if (Symbol.dispose)
|
|
981
|
+
if (Symbol.dispose) ResponseHeaders.prototype[Symbol.dispose] = ResponseHeaders.prototype.free;
|
|
982
|
+
exports.ResponseHeaders = ResponseHeaders;
|
|
1107
983
|
|
|
1108
984
|
class SevNonce {
|
|
1109
985
|
static __wrap(ptr) {
|
|
@@ -1121,7 +997,7 @@ class SevNonce {
|
|
|
1121
997
|
}
|
|
1122
998
|
free() {
|
|
1123
999
|
const ptr = this.__destroy_into_raw();
|
|
1124
|
-
wasm.
|
|
1000
|
+
wasm.__wbg_sevnonce_free(ptr, 0);
|
|
1125
1001
|
}
|
|
1126
1002
|
/**
|
|
1127
1003
|
* @returns {SevNonce}
|
|
@@ -1147,6 +1023,94 @@ class SevNonce {
|
|
|
1147
1023
|
}
|
|
1148
1024
|
}
|
|
1149
1025
|
if (Symbol.dispose) SevNonce.prototype[Symbol.dispose] = SevNonce.prototype.free;
|
|
1026
|
+
exports.SevNonce = SevNonce;
|
|
1027
|
+
|
|
1028
|
+
class TcbLevels {
|
|
1029
|
+
__destroy_into_raw() {
|
|
1030
|
+
const ptr = this.__wbg_ptr;
|
|
1031
|
+
this.__wbg_ptr = 0;
|
|
1032
|
+
TcbLevelsFinalization.unregister(this);
|
|
1033
|
+
return ptr;
|
|
1034
|
+
}
|
|
1035
|
+
free() {
|
|
1036
|
+
const ptr = this.__destroy_into_raw();
|
|
1037
|
+
wasm.__wbg_tcblevels_free(ptr, 0);
|
|
1038
|
+
}
|
|
1039
|
+
}
|
|
1040
|
+
if (Symbol.dispose) TcbLevels.prototype[Symbol.dispose] = TcbLevels.prototype.free;
|
|
1041
|
+
exports.TcbLevels = TcbLevels;
|
|
1042
|
+
|
|
1043
|
+
class TdxNonce {
|
|
1044
|
+
__destroy_into_raw() {
|
|
1045
|
+
const ptr = this.__wbg_ptr;
|
|
1046
|
+
this.__wbg_ptr = 0;
|
|
1047
|
+
TdxNonceFinalization.unregister(this);
|
|
1048
|
+
return ptr;
|
|
1049
|
+
}
|
|
1050
|
+
free() {
|
|
1051
|
+
const ptr = this.__destroy_into_raw();
|
|
1052
|
+
wasm.__wbg_tdxnonce_free(ptr, 0);
|
|
1053
|
+
}
|
|
1054
|
+
constructor() {
|
|
1055
|
+
const ret = wasm.tdxnonce_generate();
|
|
1056
|
+
this.__wbg_ptr = ret >>> 0;
|
|
1057
|
+
TdxNonceFinalization.register(this, this.__wbg_ptr, this);
|
|
1058
|
+
return this;
|
|
1059
|
+
}
|
|
1060
|
+
/**
|
|
1061
|
+
* @returns {string}
|
|
1062
|
+
*/
|
|
1063
|
+
to_hex() {
|
|
1064
|
+
let deferred1_0;
|
|
1065
|
+
let deferred1_1;
|
|
1066
|
+
try {
|
|
1067
|
+
const ret = wasm.tdxnonce_to_hex(this.__wbg_ptr);
|
|
1068
|
+
deferred1_0 = ret[0];
|
|
1069
|
+
deferred1_1 = ret[1];
|
|
1070
|
+
return getStringFromWasm0(ret[0], ret[1]);
|
|
1071
|
+
} finally {
|
|
1072
|
+
wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
|
|
1073
|
+
}
|
|
1074
|
+
}
|
|
1075
|
+
}
|
|
1076
|
+
if (Symbol.dispose) TdxNonce.prototype[Symbol.dispose] = TdxNonce.prototype.free;
|
|
1077
|
+
exports.TdxNonce = TdxNonce;
|
|
1078
|
+
|
|
1079
|
+
class TdxQuote {
|
|
1080
|
+
static __wrap(ptr) {
|
|
1081
|
+
ptr = ptr >>> 0;
|
|
1082
|
+
const obj = Object.create(TdxQuote.prototype);
|
|
1083
|
+
obj.__wbg_ptr = ptr;
|
|
1084
|
+
TdxQuoteFinalization.register(obj, obj.__wbg_ptr, obj);
|
|
1085
|
+
return obj;
|
|
1086
|
+
}
|
|
1087
|
+
__destroy_into_raw() {
|
|
1088
|
+
const ptr = this.__wbg_ptr;
|
|
1089
|
+
this.__wbg_ptr = 0;
|
|
1090
|
+
TdxQuoteFinalization.unregister(this);
|
|
1091
|
+
return ptr;
|
|
1092
|
+
}
|
|
1093
|
+
free() {
|
|
1094
|
+
const ptr = this.__destroy_into_raw();
|
|
1095
|
+
wasm.__wbg_tdxquote_free(ptr, 0);
|
|
1096
|
+
}
|
|
1097
|
+
/**
|
|
1098
|
+
* Attempts to parse a quote from DCAP bytes.
|
|
1099
|
+
* @param {Uint8Array} quote
|
|
1100
|
+
* @returns {TdxQuote}
|
|
1101
|
+
*/
|
|
1102
|
+
static from_bytes(quote) {
|
|
1103
|
+
const ptr0 = passArray8ToWasm0(quote, wasm.__wbindgen_malloc);
|
|
1104
|
+
const len0 = WASM_VECTOR_LEN;
|
|
1105
|
+
const ret = wasm.tdxquote_from_bytes(ptr0, len0);
|
|
1106
|
+
if (ret[2]) {
|
|
1107
|
+
throw takeFromExternrefTable0(ret[1]);
|
|
1108
|
+
}
|
|
1109
|
+
return TdxQuote.__wrap(ret[0]);
|
|
1110
|
+
}
|
|
1111
|
+
}
|
|
1112
|
+
if (Symbol.dispose) TdxQuote.prototype[Symbol.dispose] = TdxQuote.prototype.free;
|
|
1113
|
+
exports.TdxQuote = TdxQuote;
|
|
1150
1114
|
|
|
1151
1115
|
/**
|
|
1152
1116
|
* A chain which has been cryptographically verified
|
|
@@ -1167,7 +1131,7 @@ class VerifiedChain {
|
|
|
1167
1131
|
}
|
|
1168
1132
|
free() {
|
|
1169
1133
|
const ptr = this.__destroy_into_raw();
|
|
1170
|
-
wasm.
|
|
1134
|
+
wasm.__wbg_verifiedchain_free(ptr, 0);
|
|
1171
1135
|
}
|
|
1172
1136
|
/**
|
|
1173
1137
|
* parses a triad of ark, ask and vek certificates in the PEM format,
|
|
@@ -1202,15 +1166,17 @@ class VerifiedChain {
|
|
|
1202
1166
|
}
|
|
1203
1167
|
}
|
|
1204
1168
|
if (Symbol.dispose) VerifiedChain.prototype[Symbol.dispose] = VerifiedChain.prototype.free;
|
|
1169
|
+
exports.VerifiedChain = VerifiedChain;
|
|
1205
1170
|
|
|
1206
|
-
|
|
1207
|
-
|
|
1208
|
-
|
|
1209
|
-
|
|
1210
|
-
|
|
1211
|
-
|
|
1212
|
-
|
|
1213
|
-
|
|
1171
|
+
/**
|
|
1172
|
+
* Same as [`KeyChain:fetch_keychain`], put in for better wasm compatibility
|
|
1173
|
+
* @returns {Promise<KeyChain>}
|
|
1174
|
+
*/
|
|
1175
|
+
function fetch_keychain() {
|
|
1176
|
+
const ret = wasm.fetch_keychain();
|
|
1177
|
+
return ret;
|
|
1178
|
+
}
|
|
1179
|
+
exports.fetch_keychain = fetch_keychain;
|
|
1214
1180
|
|
|
1215
1181
|
function __wbg_get_imports() {
|
|
1216
1182
|
const import0 = {
|
|
@@ -1294,6 +1260,10 @@ function __wbg_get_imports() {
|
|
|
1294
1260
|
const ret = Collateral.__wrap(arg0);
|
|
1295
1261
|
return ret;
|
|
1296
1262
|
},
|
|
1263
|
+
__wbg_crl_new: function(arg0) {
|
|
1264
|
+
const ret = CRL.__wrap(arg0);
|
|
1265
|
+
return ret;
|
|
1266
|
+
},
|
|
1297
1267
|
__wbg_crypto_48300657fced39f9: function(arg0) {
|
|
1298
1268
|
const ret = arg0.crypto;
|
|
1299
1269
|
return ret;
|
|
@@ -1366,6 +1336,10 @@ function __wbg_get_imports() {
|
|
|
1366
1336
|
const ret = Symbol.iterator;
|
|
1367
1337
|
return ret;
|
|
1368
1338
|
},
|
|
1339
|
+
__wbg_keychain_new: function(arg0) {
|
|
1340
|
+
const ret = KeyChain.__wrap(arg0);
|
|
1341
|
+
return ret;
|
|
1342
|
+
},
|
|
1369
1343
|
__wbg_length_0c32cb8543c8e4c8: function(arg0) {
|
|
1370
1344
|
const ret = arg0.length;
|
|
1371
1345
|
return ret;
|
|
@@ -1444,14 +1418,14 @@ function __wbg_get_imports() {
|
|
|
1444
1418
|
const ret = arg0.node;
|
|
1445
1419
|
return ret;
|
|
1446
1420
|
},
|
|
1447
|
-
__wbg_nvidia__keychain_new: function(arg0) {
|
|
1448
|
-
const ret = KeyChain.__wrap(arg0);
|
|
1449
|
-
return ret;
|
|
1450
|
-
},
|
|
1451
1421
|
__wbg_nvidiaattestresult_new: function(arg0) {
|
|
1452
1422
|
const ret = NvidiaAttestResult.__wrap(arg0);
|
|
1453
1423
|
return ret;
|
|
1454
1424
|
},
|
|
1425
|
+
__wbg_parsedattestation_new: function(arg0) {
|
|
1426
|
+
const ret = ParsedAttestation.__wrap(arg0);
|
|
1427
|
+
return ret;
|
|
1428
|
+
},
|
|
1455
1429
|
__wbg_process_b2fea42461d03994: function(arg0) {
|
|
1456
1430
|
const ret = arg0.process;
|
|
1457
1431
|
return ret;
|
|
@@ -1520,18 +1494,6 @@ function __wbg_get_imports() {
|
|
|
1520
1494
|
__wbg_set_signal_8564a226c5c6853c: function(arg0, arg1) {
|
|
1521
1495
|
arg0.signal = arg1;
|
|
1522
1496
|
},
|
|
1523
|
-
__wbg_sev__crl_new: function(arg0) {
|
|
1524
|
-
const ret = CRL.__wrap(arg0);
|
|
1525
|
-
return ret;
|
|
1526
|
-
},
|
|
1527
|
-
__wbg_sev__parsedattestation_new: function(arg0) {
|
|
1528
|
-
const ret = ParsedAttestation.__wrap(arg0);
|
|
1529
|
-
return ret;
|
|
1530
|
-
},
|
|
1531
|
-
__wbg_sev__verifiedchain_new: function(arg0) {
|
|
1532
|
-
const ret = VerifiedChain.__wrap(arg0);
|
|
1533
|
-
return ret;
|
|
1534
|
-
},
|
|
1535
1497
|
__wbg_signal_9172c3282bfba2f5: function(arg0) {
|
|
1536
1498
|
const ret = arg0.signal;
|
|
1537
1499
|
return ret;
|
|
@@ -1591,22 +1553,26 @@ function __wbg_get_imports() {
|
|
|
1591
1553
|
const ret = arg0.value;
|
|
1592
1554
|
return ret;
|
|
1593
1555
|
},
|
|
1556
|
+
__wbg_verifiedchain_new: function(arg0) {
|
|
1557
|
+
const ret = VerifiedChain.__wrap(arg0);
|
|
1558
|
+
return ret;
|
|
1559
|
+
},
|
|
1594
1560
|
__wbg_versions_215a3ab1c9d5745a: function(arg0) {
|
|
1595
1561
|
const ret = arg0.versions;
|
|
1596
1562
|
return ret;
|
|
1597
1563
|
},
|
|
1598
1564
|
__wbindgen_cast_0000000000000001: function(arg0, arg1) {
|
|
1599
|
-
// Cast intrinsic for `Closure(Closure { owned: true, function: Function { arguments: [Externref], shim_idx:
|
|
1565
|
+
// Cast intrinsic for `Closure(Closure { owned: true, function: Function { arguments: [Externref], shim_idx: 1946, ret: Result(Unit), inner_ret: Some(Result(Unit)) }, mutable: true }) -> Externref`.
|
|
1600
1566
|
const ret = makeMutClosure(arg0, arg1, wasm_bindgen__convert__closures_____invoke__hc791e2887154c2d7);
|
|
1601
1567
|
return ret;
|
|
1602
1568
|
},
|
|
1603
1569
|
__wbindgen_cast_0000000000000002: function(arg0, arg1) {
|
|
1604
|
-
// Cast intrinsic for `Closure(Closure { owned: true, function: Function { arguments: [], shim_idx:
|
|
1570
|
+
// Cast intrinsic for `Closure(Closure { owned: true, function: Function { arguments: [], shim_idx: 1778, ret: Unit, inner_ret: Some(Unit) }, mutable: true }) -> Externref`.
|
|
1605
1571
|
const ret = makeMutClosure(arg0, arg1, wasm_bindgen__convert__closures_____invoke__h88cd12797a81f64c);
|
|
1606
1572
|
return ret;
|
|
1607
1573
|
},
|
|
1608
1574
|
__wbindgen_cast_0000000000000003: function(arg0, arg1) {
|
|
1609
|
-
// Cast intrinsic for `Closure(Closure { owned: true, function: Function { arguments: [], shim_idx:
|
|
1575
|
+
// Cast intrinsic for `Closure(Closure { owned: true, function: Function { arguments: [], shim_idx: 888, ret: Unit, inner_ret: Some(Unit) }, mutable: true }) -> Externref`.
|
|
1610
1576
|
const ret = makeMutClosure(arg0, arg1, wasm_bindgen__convert__closures_____invoke__h9c983d8434b53ce3);
|
|
1611
1577
|
return ret;
|
|
1612
1578
|
},
|
|
@@ -1678,7 +1644,7 @@ const AttestResultFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
|
1678
1644
|
: new FinalizationRegistry(ptr => wasm.__wbg_attestresult_free(ptr >>> 0, 1));
|
|
1679
1645
|
const CRLFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
1680
1646
|
? { register: () => {}, unregister: () => {} }
|
|
1681
|
-
: new FinalizationRegistry(ptr => wasm.
|
|
1647
|
+
: new FinalizationRegistry(ptr => wasm.__wbg_crl_free(ptr >>> 0, 1));
|
|
1682
1648
|
const ClientFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
1683
1649
|
? { register: () => {}, unregister: () => {} }
|
|
1684
1650
|
: new FinalizationRegistry(ptr => wasm.__wbg_client_free(ptr >>> 0, 1));
|
|
@@ -1690,22 +1656,22 @@ const CollateralFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
|
1690
1656
|
: new FinalizationRegistry(ptr => wasm.__wbg_collateral_free(ptr >>> 0, 1));
|
|
1691
1657
|
const DecodedClaimsFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
1692
1658
|
? { register: () => {}, unregister: () => {} }
|
|
1693
|
-
: new FinalizationRegistry(ptr => wasm.
|
|
1659
|
+
: new FinalizationRegistry(ptr => wasm.__wbg_decodedclaims_free(ptr >>> 0, 1));
|
|
1694
1660
|
const EATTokenFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
1695
1661
|
? { register: () => {}, unregister: () => {} }
|
|
1696
|
-
: new FinalizationRegistry(ptr => wasm.
|
|
1662
|
+
: new FinalizationRegistry(ptr => wasm.__wbg_eattoken_free(ptr >>> 0, 1));
|
|
1697
1663
|
const ExportPemFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
1698
1664
|
? { register: () => {}, unregister: () => {} }
|
|
1699
|
-
: new FinalizationRegistry(ptr => wasm.
|
|
1665
|
+
: new FinalizationRegistry(ptr => wasm.__wbg_exportpem_free(ptr >>> 0, 1));
|
|
1700
1666
|
const GatewayErrorFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
1701
1667
|
? { register: () => {}, unregister: () => {} }
|
|
1702
1668
|
: new FinalizationRegistry(ptr => wasm.__wbg_gatewayerror_free(ptr >>> 0, 1));
|
|
1703
1669
|
const KdsFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
1704
1670
|
? { register: () => {}, unregister: () => {} }
|
|
1705
|
-
: new FinalizationRegistry(ptr => wasm.
|
|
1671
|
+
: new FinalizationRegistry(ptr => wasm.__wbg_kds_free(ptr >>> 0, 1));
|
|
1706
1672
|
const KeyChainFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
1707
1673
|
? { register: () => {}, unregister: () => {} }
|
|
1708
|
-
: new FinalizationRegistry(ptr => wasm.
|
|
1674
|
+
: new FinalizationRegistry(ptr => wasm.__wbg_keychain_free(ptr >>> 0, 1));
|
|
1709
1675
|
const ModulesFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
1710
1676
|
? { register: () => {}, unregister: () => {} }
|
|
1711
1677
|
: new FinalizationRegistry(ptr => wasm.__wbg_modules_free(ptr >>> 0, 1));
|
|
@@ -1714,10 +1680,10 @@ const NvidiaAttestResultFinalization = (typeof FinalizationRegistry === 'undefin
|
|
|
1714
1680
|
: new FinalizationRegistry(ptr => wasm.__wbg_nvidiaattestresult_free(ptr >>> 0, 1));
|
|
1715
1681
|
const NvidiaNonceFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
1716
1682
|
? { register: () => {}, unregister: () => {} }
|
|
1717
|
-
: new FinalizationRegistry(ptr => wasm.
|
|
1683
|
+
: new FinalizationRegistry(ptr => wasm.__wbg_nvidianonce_free(ptr >>> 0, 1));
|
|
1718
1684
|
const ParsedAttestationFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
1719
1685
|
? { register: () => {}, unregister: () => {} }
|
|
1720
|
-
: new FinalizationRegistry(ptr => wasm.
|
|
1686
|
+
: new FinalizationRegistry(ptr => wasm.__wbg_parsedattestation_free(ptr >>> 0, 1));
|
|
1721
1687
|
const PcsFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
1722
1688
|
? { register: () => {}, unregister: () => {} }
|
|
1723
1689
|
: new FinalizationRegistry(ptr => wasm.__wbg_pcs_free(ptr >>> 0, 1));
|
|
@@ -1732,7 +1698,7 @@ const ResponseHeadersFinalization = (typeof FinalizationRegistry === 'undefined'
|
|
|
1732
1698
|
: new FinalizationRegistry(ptr => wasm.__wbg_responseheaders_free(ptr >>> 0, 1));
|
|
1733
1699
|
const SevNonceFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
1734
1700
|
? { register: () => {}, unregister: () => {} }
|
|
1735
|
-
: new FinalizationRegistry(ptr => wasm.
|
|
1701
|
+
: new FinalizationRegistry(ptr => wasm.__wbg_sevnonce_free(ptr >>> 0, 1));
|
|
1736
1702
|
const TcbLevelsFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
1737
1703
|
? { register: () => {}, unregister: () => {} }
|
|
1738
1704
|
: new FinalizationRegistry(ptr => wasm.__wbg_tcblevels_free(ptr >>> 0, 1));
|
|
@@ -1744,7 +1710,7 @@ const TdxQuoteFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
|
1744
1710
|
: new FinalizationRegistry(ptr => wasm.__wbg_tdxquote_free(ptr >>> 0, 1));
|
|
1745
1711
|
const VerifiedChainFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
1746
1712
|
? { register: () => {}, unregister: () => {} }
|
|
1747
|
-
: new FinalizationRegistry(ptr => wasm.
|
|
1713
|
+
: new FinalizationRegistry(ptr => wasm.__wbg_verifiedchain_free(ptr >>> 0, 1));
|
|
1748
1714
|
|
|
1749
1715
|
function addToExternrefTable0(obj) {
|
|
1750
1716
|
const idx = wasm.__externref_table_alloc();
|