@premai/reticle 0.4.0 → 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 +98 -115
- package/reticle.js +1 -1
- package/reticle_bg.js +522 -537
- package/reticle_bg.wasm +0 -0
- package/reticle_main.js +533 -539
package/package.json
CHANGED
package/reticle.d.ts
CHANGED
|
@@ -17,6 +17,24 @@ export class AttestResult {
|
|
|
17
17
|
modules(): Modules;
|
|
18
18
|
}
|
|
19
19
|
|
|
20
|
+
/**
|
|
21
|
+
* A parsed certificate revocation list
|
|
22
|
+
*/
|
|
23
|
+
export class CRL {
|
|
24
|
+
private constructor();
|
|
25
|
+
free(): void;
|
|
26
|
+
[Symbol.dispose](): void;
|
|
27
|
+
/**
|
|
28
|
+
* Passes if the certificates are not in the certificate revocation list
|
|
29
|
+
* Throws `AttestationError` on fail
|
|
30
|
+
*/
|
|
31
|
+
check_chain(chain: VerifiedChain): void;
|
|
32
|
+
/**
|
|
33
|
+
* Parses a certificate revocation list from DER format binary data
|
|
34
|
+
*/
|
|
35
|
+
static from_der(list: Uint8Array): CRL;
|
|
36
|
+
}
|
|
37
|
+
|
|
20
38
|
export class Client {
|
|
21
39
|
private constructor();
|
|
22
40
|
free(): void;
|
|
@@ -108,205 +126,174 @@ export enum CpuModule {
|
|
|
108
126
|
Tdx = 1,
|
|
109
127
|
}
|
|
110
128
|
|
|
111
|
-
export class
|
|
129
|
+
export class DecodedClaims {
|
|
112
130
|
private constructor();
|
|
113
131
|
free(): void;
|
|
114
132
|
[Symbol.dispose](): void;
|
|
115
|
-
message: string;
|
|
116
|
-
}
|
|
117
|
-
|
|
118
|
-
export enum GpuModule {
|
|
119
|
-
Nvidia = 0,
|
|
120
133
|
}
|
|
121
134
|
|
|
122
|
-
export class
|
|
135
|
+
export class EATToken {
|
|
123
136
|
private constructor();
|
|
124
137
|
free(): void;
|
|
125
138
|
[Symbol.dispose](): void;
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
has_gpu(): boolean;
|
|
139
|
+
static parse(from: string): EATToken;
|
|
140
|
+
verify(keys: KeyChain, nonce: NvidiaNonce): DecodedClaims;
|
|
129
141
|
}
|
|
130
142
|
|
|
131
|
-
export class
|
|
143
|
+
export class ExportPem {
|
|
132
144
|
private constructor();
|
|
133
145
|
free(): void;
|
|
134
146
|
[Symbol.dispose](): void;
|
|
147
|
+
ark: Uint8Array;
|
|
148
|
+
ask: Uint8Array;
|
|
149
|
+
vek: Uint8Array;
|
|
135
150
|
}
|
|
136
151
|
|
|
137
|
-
export class
|
|
152
|
+
export class GatewayError {
|
|
153
|
+
private constructor();
|
|
138
154
|
free(): void;
|
|
139
155
|
[Symbol.dispose](): void;
|
|
140
|
-
|
|
141
|
-
constructor(base_url: string);
|
|
156
|
+
message: string;
|
|
142
157
|
}
|
|
143
158
|
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
export class QueryParams {
|
|
159
|
+
export enum GpuModule {
|
|
160
|
+
Nvidia = 0,
|
|
161
|
+
}
|
|
162
|
+
|
|
163
|
+
export class Kds {
|
|
150
164
|
free(): void;
|
|
151
165
|
[Symbol.dispose](): void;
|
|
152
|
-
|
|
166
|
+
fetch_certificates(attestation: ParsedAttestation): Promise<VerifiedChain>;
|
|
153
167
|
/**
|
|
154
|
-
*
|
|
155
|
-
*
|
|
156
|
-
* Reserved keywords for specific queries will get overwritten
|
|
168
|
+
* Fetches the certificate revocation list from AMD's KDS
|
|
157
169
|
*/
|
|
158
|
-
|
|
170
|
+
fetch_crl(attestation: ParsedAttestation): Promise<CRL>;
|
|
171
|
+
constructor(cache_url: string);
|
|
159
172
|
}
|
|
160
173
|
|
|
161
|
-
export class
|
|
174
|
+
export class KeyChain {
|
|
175
|
+
private constructor();
|
|
162
176
|
free(): void;
|
|
163
177
|
[Symbol.dispose](): void;
|
|
164
|
-
constructor(collateral: Collateral, quote: TdxQuote);
|
|
165
|
-
verify(nonce: TdxNonce): void;
|
|
166
178
|
}
|
|
167
179
|
|
|
168
|
-
export class
|
|
180
|
+
export class Modules {
|
|
169
181
|
private constructor();
|
|
170
182
|
free(): void;
|
|
171
183
|
[Symbol.dispose](): void;
|
|
172
|
-
|
|
173
|
-
|
|
184
|
+
cpu(): CpuModule;
|
|
185
|
+
gpu(): GpuModule | undefined;
|
|
186
|
+
has_gpu(): boolean;
|
|
174
187
|
}
|
|
175
188
|
|
|
176
|
-
export class
|
|
189
|
+
export class NvidiaAttestResult {
|
|
177
190
|
private constructor();
|
|
178
191
|
free(): void;
|
|
179
192
|
[Symbol.dispose](): void;
|
|
180
193
|
}
|
|
181
194
|
|
|
182
|
-
export class
|
|
195
|
+
export class NvidiaNonce {
|
|
196
|
+
private constructor();
|
|
183
197
|
free(): void;
|
|
184
198
|
[Symbol.dispose](): void;
|
|
185
|
-
|
|
199
|
+
static generate(): NvidiaNonce;
|
|
186
200
|
to_hex(): string;
|
|
187
201
|
}
|
|
188
202
|
|
|
189
|
-
|
|
203
|
+
/**
|
|
204
|
+
* Represents a parsed attestation report with some already
|
|
205
|
+
* parsed commonly accessed fields
|
|
206
|
+
*/
|
|
207
|
+
export class ParsedAttestation {
|
|
190
208
|
private constructor();
|
|
191
209
|
free(): void;
|
|
192
210
|
[Symbol.dispose](): void;
|
|
211
|
+
cpu_fam_id(): number;
|
|
212
|
+
cpu_mod_id(): number;
|
|
193
213
|
/**
|
|
194
|
-
*
|
|
214
|
+
* Parses and constructs a new attestation report from a stream of binary data
|
|
195
215
|
*/
|
|
196
|
-
static
|
|
216
|
+
static new(bytes: Uint8Array): ParsedAttestation;
|
|
217
|
+
/**
|
|
218
|
+
* Verifies the attestation report against a certificate chain
|
|
219
|
+
*/
|
|
220
|
+
verify(chain: VerifiedChain, nonce: SevNonce): void;
|
|
197
221
|
}
|
|
198
222
|
|
|
199
|
-
|
|
200
|
-
private constructor();
|
|
223
|
+
export class Pcs {
|
|
201
224
|
free(): void;
|
|
202
225
|
[Symbol.dispose](): void;
|
|
226
|
+
fetch_collateral(quote: TdxQuote): Promise<Collateral>;
|
|
227
|
+
constructor(base_url: string);
|
|
203
228
|
}
|
|
204
229
|
|
|
205
|
-
|
|
206
|
-
|
|
230
|
+
/**
|
|
231
|
+
* Generic per-request query parameters.
|
|
232
|
+
*
|
|
233
|
+
* The `nonce` key is reserved and will be rejected.
|
|
234
|
+
*/
|
|
235
|
+
export class QueryParams {
|
|
207
236
|
free(): void;
|
|
208
237
|
[Symbol.dispose](): void;
|
|
209
|
-
|
|
210
|
-
|
|
238
|
+
constructor();
|
|
239
|
+
/**
|
|
240
|
+
* Appends a query parameter.
|
|
241
|
+
*
|
|
242
|
+
* Reserved keywords for specific queries will get overwritten
|
|
243
|
+
*/
|
|
244
|
+
with(key: string, value: string): QueryParams;
|
|
211
245
|
}
|
|
212
246
|
|
|
213
|
-
|
|
214
|
-
private constructor();
|
|
247
|
+
export class QuoteVerifier {
|
|
215
248
|
free(): void;
|
|
216
249
|
[Symbol.dispose](): void;
|
|
250
|
+
constructor(collateral: Collateral, quote: TdxQuote);
|
|
251
|
+
verify(nonce: TdxNonce): void;
|
|
217
252
|
}
|
|
218
253
|
|
|
219
|
-
|
|
254
|
+
export class ResponseHeaders {
|
|
220
255
|
private constructor();
|
|
221
256
|
free(): void;
|
|
222
257
|
[Symbol.dispose](): void;
|
|
223
|
-
|
|
224
|
-
|
|
258
|
+
get(name: string): string | undefined;
|
|
259
|
+
keys(): string[];
|
|
225
260
|
}
|
|
226
261
|
|
|
227
|
-
|
|
228
|
-
* Same as [`KeyChain:fetch_keychain`], put in for better wasm compatibility
|
|
229
|
-
*/
|
|
230
|
-
declare function fetch_keychain(): Promise<KeyChain>;
|
|
231
|
-
|
|
232
|
-
export let nvidia: {
|
|
233
|
-
DecodedClaims: typeof DecodedClaims,
|
|
234
|
-
EATToken: typeof EATToken,
|
|
235
|
-
KeyChain: typeof KeyChain,
|
|
236
|
-
NvidiaNonce: typeof NvidiaNonce,
|
|
237
|
-
fetch_keychain: typeof fetch_keychain,
|
|
238
|
-
};
|
|
239
|
-
|
|
240
|
-
/**
|
|
241
|
-
* A parsed certificate revocation list
|
|
242
|
-
*/
|
|
243
|
-
declare class CRL {
|
|
262
|
+
export class SevNonce {
|
|
244
263
|
private constructor();
|
|
245
264
|
free(): void;
|
|
246
265
|
[Symbol.dispose](): void;
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
* Throws `AttestationError` on fail
|
|
250
|
-
*/
|
|
251
|
-
check_chain(chain: VerifiedChain): void;
|
|
252
|
-
/**
|
|
253
|
-
* Parses a certificate revocation list from DER format binary data
|
|
254
|
-
*/
|
|
255
|
-
static from_der(list: Uint8Array): CRL;
|
|
266
|
+
static generate(): SevNonce;
|
|
267
|
+
to_hex(): string;
|
|
256
268
|
}
|
|
257
269
|
|
|
258
|
-
|
|
270
|
+
export class TcbLevels {
|
|
259
271
|
private constructor();
|
|
260
272
|
free(): void;
|
|
261
273
|
[Symbol.dispose](): void;
|
|
262
|
-
ark: Uint8Array;
|
|
263
|
-
ask: Uint8Array;
|
|
264
|
-
vek: Uint8Array;
|
|
265
274
|
}
|
|
266
275
|
|
|
267
|
-
|
|
276
|
+
export class TdxNonce {
|
|
268
277
|
free(): void;
|
|
269
278
|
[Symbol.dispose](): void;
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
* Fetches the certificate revocation list from AMD's KDS
|
|
273
|
-
*/
|
|
274
|
-
fetch_crl(attestation: ParsedAttestation): Promise<CRL>;
|
|
275
|
-
constructor(cache_url: string);
|
|
279
|
+
constructor();
|
|
280
|
+
to_hex(): string;
|
|
276
281
|
}
|
|
277
282
|
|
|
278
|
-
|
|
279
|
-
* Represents a parsed attestation report with some already
|
|
280
|
-
* parsed commonly accessed fields
|
|
281
|
-
*/
|
|
282
|
-
declare class ParsedAttestation {
|
|
283
|
+
export class TdxQuote {
|
|
283
284
|
private constructor();
|
|
284
285
|
free(): void;
|
|
285
286
|
[Symbol.dispose](): void;
|
|
286
|
-
cpu_fam_id(): number;
|
|
287
|
-
cpu_mod_id(): number;
|
|
288
287
|
/**
|
|
289
|
-
*
|
|
290
|
-
*/
|
|
291
|
-
static new(bytes: Uint8Array): ParsedAttestation;
|
|
292
|
-
/**
|
|
293
|
-
* Verifies the attestation report against a certificate chain
|
|
288
|
+
* Attempts to parse a quote from DCAP bytes.
|
|
294
289
|
*/
|
|
295
|
-
|
|
296
|
-
}
|
|
297
|
-
|
|
298
|
-
declare class SevNonce {
|
|
299
|
-
private constructor();
|
|
300
|
-
free(): void;
|
|
301
|
-
[Symbol.dispose](): void;
|
|
302
|
-
static generate(): SevNonce;
|
|
303
|
-
to_hex(): string;
|
|
290
|
+
static from_bytes(quote: Uint8Array): TdxQuote;
|
|
304
291
|
}
|
|
305
292
|
|
|
306
293
|
/**
|
|
307
294
|
* A chain which has been cryptographically verified
|
|
308
295
|
*/
|
|
309
|
-
|
|
296
|
+
export class VerifiedChain {
|
|
310
297
|
private constructor();
|
|
311
298
|
free(): void;
|
|
312
299
|
[Symbol.dispose](): void;
|
|
@@ -318,11 +305,7 @@ declare class VerifiedChain {
|
|
|
318
305
|
to_pem(): ExportPem;
|
|
319
306
|
}
|
|
320
307
|
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
ParsedAttestation: typeof ParsedAttestation,
|
|
326
|
-
SevNonce: typeof SevNonce,
|
|
327
|
-
VerifiedChain: typeof VerifiedChain,
|
|
328
|
-
};
|
|
308
|
+
/**
|
|
309
|
+
* Same as [`KeyChain:fetch_keychain`], put in for better wasm compatibility
|
|
310
|
+
*/
|
|
311
|
+
export function fetch_keychain(): Promise<KeyChain>;
|
package/reticle.js
CHANGED
|
@@ -5,5 +5,5 @@ import { __wbg_set_wasm } from "./reticle_bg.js";
|
|
|
5
5
|
__wbg_set_wasm(wasm);
|
|
6
6
|
wasm.__wbindgen_start();
|
|
7
7
|
export {
|
|
8
|
-
AttestHeaders, AttestResult, Client, ClientBuilder, Collateral, CpuModule, GatewayError, GpuModule, Modules, NvidiaAttestResult, Pcs, QueryParams, QuoteVerifier, ResponseHeaders, TcbLevels, TdxNonce, TdxQuote
|
|
8
|
+
AttestHeaders, AttestResult, CRL, Client, ClientBuilder, Collateral, CpuModule, DecodedClaims, EATToken, ExportPem, GatewayError, GpuModule, Kds, KeyChain, Modules, NvidiaAttestResult, NvidiaNonce, ParsedAttestation, Pcs, QueryParams, QuoteVerifier, ResponseHeaders, SevNonce, TcbLevels, TdxNonce, TdxQuote, VerifiedChain, fetch_keychain
|
|
9
9
|
} from "./reticle_bg.js";
|