@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/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;
|
|
@@ -27,23 +45,23 @@ export class Client {
|
|
|
27
45
|
* - Iterates through each module and performs end-to-end attestation
|
|
28
46
|
* - Returns the list of attested modules
|
|
29
47
|
*/
|
|
30
|
-
attest(
|
|
48
|
+
attest(): Promise<AttestResult>;
|
|
31
49
|
/**
|
|
32
50
|
* Completes end-to-end nvidia attestation. Generates nonce and validates claims all in one
|
|
33
51
|
*/
|
|
34
|
-
attest_nvidia(
|
|
52
|
+
attest_nvidia(): Promise<ResponseHeaders>;
|
|
35
53
|
/**
|
|
36
54
|
* Performs end-to-end sev-snp attestation. Generates nonce and validates claims all in one
|
|
37
55
|
*/
|
|
38
|
-
attest_sev(
|
|
56
|
+
attest_sev(): Promise<void>;
|
|
39
57
|
/**
|
|
40
58
|
* Performs end-to-end tdx attestation. Generates nonce and validates claims all in one
|
|
41
59
|
*/
|
|
42
|
-
attest_tdx(
|
|
60
|
+
attest_tdx(): Promise<void>;
|
|
43
61
|
/**
|
|
44
62
|
* Gather available attestable modules from remote attestation endpoint
|
|
45
63
|
*/
|
|
46
|
-
request_modules(
|
|
64
|
+
request_modules(): Promise<Modules>;
|
|
47
65
|
/**
|
|
48
66
|
* Requests and parses an Nvidia EATToken attestation from the attestation server
|
|
49
67
|
*
|
|
@@ -52,7 +70,7 @@ export class Client {
|
|
|
52
70
|
* or measurement checks on the attestation. If you want to perform end-to-end attestation
|
|
53
71
|
* please refer to [`Self::attest_nvidia`]
|
|
54
72
|
*/
|
|
55
|
-
request_nvidia(nonce: NvidiaNonce
|
|
73
|
+
request_nvidia(nonce: NvidiaNonce): Promise<NvidiaAttestResult>;
|
|
56
74
|
/**
|
|
57
75
|
* Requests and parses a SEV-SNP attestation from the attestation server.
|
|
58
76
|
*
|
|
@@ -61,7 +79,7 @@ export class Client {
|
|
|
61
79
|
* or measurement checks on the attestation. If you want to perform end-to-end attestation
|
|
62
80
|
* please refer to [`Self::attest_sev`]
|
|
63
81
|
*/
|
|
64
|
-
request_sev(nonce: SevNonce
|
|
82
|
+
request_sev(nonce: SevNonce): Promise<ParsedAttestation>;
|
|
65
83
|
/**
|
|
66
84
|
* Requests and parses a TDX quote
|
|
67
85
|
*
|
|
@@ -70,7 +88,8 @@ export class Client {
|
|
|
70
88
|
* or measurement checks on the attestation. If you want to perform end-to-end attestation
|
|
71
89
|
* please refer to [`Self::attest_tdx`]
|
|
72
90
|
*/
|
|
73
|
-
request_tdx(nonce: TdxNonce
|
|
91
|
+
request_tdx(nonce: TdxNonce): Promise<TdxQuote>;
|
|
92
|
+
set_query(query_params: QueryParams): void;
|
|
74
93
|
}
|
|
75
94
|
|
|
76
95
|
export class ClientBuilder {
|
|
@@ -107,205 +126,174 @@ export enum CpuModule {
|
|
|
107
126
|
Tdx = 1,
|
|
108
127
|
}
|
|
109
128
|
|
|
110
|
-
export class
|
|
129
|
+
export class DecodedClaims {
|
|
111
130
|
private constructor();
|
|
112
131
|
free(): void;
|
|
113
132
|
[Symbol.dispose](): void;
|
|
114
|
-
message: string;
|
|
115
|
-
}
|
|
116
|
-
|
|
117
|
-
export enum GpuModule {
|
|
118
|
-
Nvidia = 0,
|
|
119
133
|
}
|
|
120
134
|
|
|
121
|
-
export class
|
|
135
|
+
export class EATToken {
|
|
122
136
|
private constructor();
|
|
123
137
|
free(): void;
|
|
124
138
|
[Symbol.dispose](): void;
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
has_gpu(): boolean;
|
|
139
|
+
static parse(from: string): EATToken;
|
|
140
|
+
verify(keys: KeyChain, nonce: NvidiaNonce): DecodedClaims;
|
|
128
141
|
}
|
|
129
142
|
|
|
130
|
-
export class
|
|
143
|
+
export class ExportPem {
|
|
131
144
|
private constructor();
|
|
132
145
|
free(): void;
|
|
133
146
|
[Symbol.dispose](): void;
|
|
147
|
+
ark: Uint8Array;
|
|
148
|
+
ask: Uint8Array;
|
|
149
|
+
vek: Uint8Array;
|
|
134
150
|
}
|
|
135
151
|
|
|
136
|
-
export class
|
|
152
|
+
export class GatewayError {
|
|
153
|
+
private constructor();
|
|
137
154
|
free(): void;
|
|
138
155
|
[Symbol.dispose](): void;
|
|
139
|
-
|
|
140
|
-
constructor(base_url: string);
|
|
156
|
+
message: string;
|
|
141
157
|
}
|
|
142
158
|
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
export class QueryParams {
|
|
159
|
+
export enum GpuModule {
|
|
160
|
+
Nvidia = 0,
|
|
161
|
+
}
|
|
162
|
+
|
|
163
|
+
export class Kds {
|
|
149
164
|
free(): void;
|
|
150
165
|
[Symbol.dispose](): void;
|
|
151
|
-
|
|
166
|
+
fetch_certificates(attestation: ParsedAttestation): Promise<VerifiedChain>;
|
|
152
167
|
/**
|
|
153
|
-
*
|
|
154
|
-
*
|
|
155
|
-
* Reserved keywords for specific queries will get overwritten
|
|
168
|
+
* Fetches the certificate revocation list from AMD's KDS
|
|
156
169
|
*/
|
|
157
|
-
|
|
170
|
+
fetch_crl(attestation: ParsedAttestation): Promise<CRL>;
|
|
171
|
+
constructor(cache_url: string);
|
|
158
172
|
}
|
|
159
173
|
|
|
160
|
-
export class
|
|
174
|
+
export class KeyChain {
|
|
175
|
+
private constructor();
|
|
161
176
|
free(): void;
|
|
162
177
|
[Symbol.dispose](): void;
|
|
163
|
-
constructor(collateral: Collateral, quote: TdxQuote);
|
|
164
|
-
verify(nonce: TdxNonce): void;
|
|
165
178
|
}
|
|
166
179
|
|
|
167
|
-
export class
|
|
180
|
+
export class Modules {
|
|
168
181
|
private constructor();
|
|
169
182
|
free(): void;
|
|
170
183
|
[Symbol.dispose](): void;
|
|
171
|
-
|
|
172
|
-
|
|
184
|
+
cpu(): CpuModule;
|
|
185
|
+
gpu(): GpuModule | undefined;
|
|
186
|
+
has_gpu(): boolean;
|
|
173
187
|
}
|
|
174
188
|
|
|
175
|
-
export class
|
|
189
|
+
export class NvidiaAttestResult {
|
|
176
190
|
private constructor();
|
|
177
191
|
free(): void;
|
|
178
192
|
[Symbol.dispose](): void;
|
|
179
193
|
}
|
|
180
194
|
|
|
181
|
-
export class
|
|
195
|
+
export class NvidiaNonce {
|
|
196
|
+
private constructor();
|
|
182
197
|
free(): void;
|
|
183
198
|
[Symbol.dispose](): void;
|
|
184
|
-
|
|
199
|
+
static generate(): NvidiaNonce;
|
|
185
200
|
to_hex(): string;
|
|
186
201
|
}
|
|
187
202
|
|
|
188
|
-
|
|
203
|
+
/**
|
|
204
|
+
* Represents a parsed attestation report with some already
|
|
205
|
+
* parsed commonly accessed fields
|
|
206
|
+
*/
|
|
207
|
+
export class ParsedAttestation {
|
|
189
208
|
private constructor();
|
|
190
209
|
free(): void;
|
|
191
210
|
[Symbol.dispose](): void;
|
|
211
|
+
cpu_fam_id(): number;
|
|
212
|
+
cpu_mod_id(): number;
|
|
192
213
|
/**
|
|
193
|
-
*
|
|
214
|
+
* Parses and constructs a new attestation report from a stream of binary data
|
|
194
215
|
*/
|
|
195
|
-
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;
|
|
196
221
|
}
|
|
197
222
|
|
|
198
|
-
|
|
199
|
-
private constructor();
|
|
223
|
+
export class Pcs {
|
|
200
224
|
free(): void;
|
|
201
225
|
[Symbol.dispose](): void;
|
|
226
|
+
fetch_collateral(quote: TdxQuote): Promise<Collateral>;
|
|
227
|
+
constructor(base_url: string);
|
|
202
228
|
}
|
|
203
229
|
|
|
204
|
-
|
|
205
|
-
|
|
230
|
+
/**
|
|
231
|
+
* Generic per-request query parameters.
|
|
232
|
+
*
|
|
233
|
+
* The `nonce` key is reserved and will be rejected.
|
|
234
|
+
*/
|
|
235
|
+
export class QueryParams {
|
|
206
236
|
free(): void;
|
|
207
237
|
[Symbol.dispose](): void;
|
|
208
|
-
|
|
209
|
-
|
|
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;
|
|
210
245
|
}
|
|
211
246
|
|
|
212
|
-
|
|
213
|
-
private constructor();
|
|
247
|
+
export class QuoteVerifier {
|
|
214
248
|
free(): void;
|
|
215
249
|
[Symbol.dispose](): void;
|
|
250
|
+
constructor(collateral: Collateral, quote: TdxQuote);
|
|
251
|
+
verify(nonce: TdxNonce): void;
|
|
216
252
|
}
|
|
217
253
|
|
|
218
|
-
|
|
254
|
+
export class ResponseHeaders {
|
|
219
255
|
private constructor();
|
|
220
256
|
free(): void;
|
|
221
257
|
[Symbol.dispose](): void;
|
|
222
|
-
|
|
223
|
-
|
|
258
|
+
get(name: string): string | undefined;
|
|
259
|
+
keys(): string[];
|
|
224
260
|
}
|
|
225
261
|
|
|
226
|
-
|
|
227
|
-
* Same as [`KeyChain:fetch_keychain`], put in for better wasm compatibility
|
|
228
|
-
*/
|
|
229
|
-
declare function fetch_keychain(): Promise<KeyChain>;
|
|
230
|
-
|
|
231
|
-
export let nvidia: {
|
|
232
|
-
DecodedClaims: typeof DecodedClaims,
|
|
233
|
-
EATToken: typeof EATToken,
|
|
234
|
-
KeyChain: typeof KeyChain,
|
|
235
|
-
NvidiaNonce: typeof NvidiaNonce,
|
|
236
|
-
fetch_keychain: typeof fetch_keychain,
|
|
237
|
-
};
|
|
238
|
-
|
|
239
|
-
/**
|
|
240
|
-
* A parsed certificate revocation list
|
|
241
|
-
*/
|
|
242
|
-
declare class CRL {
|
|
262
|
+
export class SevNonce {
|
|
243
263
|
private constructor();
|
|
244
264
|
free(): void;
|
|
245
265
|
[Symbol.dispose](): void;
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
* Throws `AttestationError` on fail
|
|
249
|
-
*/
|
|
250
|
-
check_chain(chain: VerifiedChain): void;
|
|
251
|
-
/**
|
|
252
|
-
* Parses a certificate revocation list from DER format binary data
|
|
253
|
-
*/
|
|
254
|
-
static from_der(list: Uint8Array): CRL;
|
|
266
|
+
static generate(): SevNonce;
|
|
267
|
+
to_hex(): string;
|
|
255
268
|
}
|
|
256
269
|
|
|
257
|
-
|
|
270
|
+
export class TcbLevels {
|
|
258
271
|
private constructor();
|
|
259
272
|
free(): void;
|
|
260
273
|
[Symbol.dispose](): void;
|
|
261
|
-
ark: Uint8Array;
|
|
262
|
-
ask: Uint8Array;
|
|
263
|
-
vek: Uint8Array;
|
|
264
274
|
}
|
|
265
275
|
|
|
266
|
-
|
|
276
|
+
export class TdxNonce {
|
|
267
277
|
free(): void;
|
|
268
278
|
[Symbol.dispose](): void;
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
* Fetches the certificate revocation list from AMD's KDS
|
|
272
|
-
*/
|
|
273
|
-
fetch_crl(attestation: ParsedAttestation): Promise<CRL>;
|
|
274
|
-
constructor(cache_url: string);
|
|
279
|
+
constructor();
|
|
280
|
+
to_hex(): string;
|
|
275
281
|
}
|
|
276
282
|
|
|
277
|
-
|
|
278
|
-
* Represents a parsed attestation report with some already
|
|
279
|
-
* parsed commonly accessed fields
|
|
280
|
-
*/
|
|
281
|
-
declare class ParsedAttestation {
|
|
283
|
+
export class TdxQuote {
|
|
282
284
|
private constructor();
|
|
283
285
|
free(): void;
|
|
284
286
|
[Symbol.dispose](): void;
|
|
285
|
-
cpu_fam_id(): number;
|
|
286
|
-
cpu_mod_id(): number;
|
|
287
287
|
/**
|
|
288
|
-
*
|
|
289
|
-
*/
|
|
290
|
-
static new(bytes: Uint8Array): ParsedAttestation;
|
|
291
|
-
/**
|
|
292
|
-
* Verifies the attestation report against a certificate chain
|
|
288
|
+
* Attempts to parse a quote from DCAP bytes.
|
|
293
289
|
*/
|
|
294
|
-
|
|
295
|
-
}
|
|
296
|
-
|
|
297
|
-
declare class SevNonce {
|
|
298
|
-
private constructor();
|
|
299
|
-
free(): void;
|
|
300
|
-
[Symbol.dispose](): void;
|
|
301
|
-
static generate(): SevNonce;
|
|
302
|
-
to_hex(): string;
|
|
290
|
+
static from_bytes(quote: Uint8Array): TdxQuote;
|
|
303
291
|
}
|
|
304
292
|
|
|
305
293
|
/**
|
|
306
294
|
* A chain which has been cryptographically verified
|
|
307
295
|
*/
|
|
308
|
-
|
|
296
|
+
export class VerifiedChain {
|
|
309
297
|
private constructor();
|
|
310
298
|
free(): void;
|
|
311
299
|
[Symbol.dispose](): void;
|
|
@@ -317,11 +305,7 @@ declare class VerifiedChain {
|
|
|
317
305
|
to_pem(): ExportPem;
|
|
318
306
|
}
|
|
319
307
|
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
ParsedAttestation: typeof ParsedAttestation,
|
|
325
|
-
SevNonce: typeof SevNonce,
|
|
326
|
-
VerifiedChain: typeof VerifiedChain,
|
|
327
|
-
};
|
|
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";
|