@assistant-ui/better-auth-dbsc 0.0.0-stage → 0.1.0

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.
@@ -0,0 +1,402 @@
1
+ import { calculateJwkThumbprint, compactVerify, decodeProtectedHeader, importJWK } from "jose";
2
+ // src/core/config.ts
3
+ /** The body that tells the browser to drop the DBSC session. */
4
+ const DBSC_TERMINATE = { continue: false };
5
+ /**
6
+ * Serializes cookie attributes in the form DBSC compares against `Set-Cookie`:
7
+ * `Domain=…; Path=/; HttpOnly; Secure; SameSite=Lax`. `Max-Age` and `Expires` are
8
+ * left out on purpose; they change on every refresh.
9
+ */
10
+ function formatCookieAttributes(attributes) {
11
+ const parts = [];
12
+ if (attributes.domain) parts.push(`Domain=${attributes.domain}`);
13
+ parts.push(`Path=${attributes.path ?? "/"}`);
14
+ if (attributes.httpOnly) parts.push("HttpOnly");
15
+ if (attributes.secure) parts.push("Secure");
16
+ if (attributes.sameSite) {
17
+ const value = attributes.sameSite.toLowerCase();
18
+ parts.push(`SameSite=${value.charAt(0).toUpperCase()}${value.slice(1)}`);
19
+ }
20
+ return parts.join("; ");
21
+ }
22
+ // src/core/headers.ts
23
+ const DBSC_HEADERS = {
24
+ registration: {
25
+ standard: "Secure-Session-Registration",
26
+ legacy: "Sec-Session-Registration"
27
+ },
28
+ challenge: {
29
+ standard: "Secure-Session-Challenge",
30
+ legacy: "Sec-Session-Challenge"
31
+ },
32
+ response: {
33
+ standard: "Secure-Session-Response",
34
+ legacy: "Sec-Session-Response"
35
+ },
36
+ sessionId: {
37
+ standard: "Sec-Secure-Session-Id",
38
+ legacy: "Sec-Session-Id"
39
+ }
40
+ };
41
+ /** Response header names to write for `kind`, in send order. */
42
+ function getDbscHeaderNames(kind, names) {
43
+ const pair = DBSC_HEADERS[kind];
44
+ if (names === "standard") return [pair.standard];
45
+ if (names === "legacy") return [pair.legacy];
46
+ return [pair.standard, pair.legacy];
47
+ }
48
+ /** Reads a request header, preferring the standard name over the legacy one. */
49
+ function readDbscHeader(headers, kind) {
50
+ const pair = DBSC_HEADERS[kind];
51
+ return headers.get(pair.standard) ?? headers.get(pair.legacy);
52
+ }
53
+ /**
54
+ * Formats a `Secure-Session-Registration` value (RFC 8941 structured field):
55
+ * `(ES256 RS256);path="/api/auth/dbsc/register";challenge="..."`.
56
+ */
57
+ function formatRegistrationHeader(input) {
58
+ if (input.algorithms.length === 0) throw new TypeError("`algorithms` must list at least one of `ES256` or `RS256`.");
59
+ let value = `(${input.algorithms.join(" ")});path=${sfString(input.path)};challenge=${sfString(input.challenge)}`;
60
+ if (input.authorization !== void 0) value += `;authorization=${sfString(input.authorization)}`;
61
+ return value;
62
+ }
63
+ /** Formats a `Secure-Session-Challenge` value: `"<challenge>";id="<session id>"`. */
64
+ function formatChallengeHeader(input) {
65
+ return `${sfString(input.challenge)};id=${sfString(input.sessionId)}`;
66
+ }
67
+ /**
68
+ * Reads an RFC 8941 sf-string such as the `Sec-Secure-Session-Id` value. Bare tokens are
69
+ * accepted too, since older Chrome builds sent the id unquoted.
70
+ */
71
+ function parseSfString(value) {
72
+ if (value === null) return null;
73
+ const trimmed = value.trim();
74
+ if (!trimmed.startsWith("\"")) return trimmed || null;
75
+ let out = "";
76
+ for (let i = 1; i < trimmed.length; i++) {
77
+ const char = trimmed[i];
78
+ if (char === "\\") {
79
+ const next = trimmed[i + 1];
80
+ if (next !== "\"" && next !== "\\") return null;
81
+ out += next;
82
+ i++;
83
+ continue;
84
+ }
85
+ if (char === "\"") return i === trimmed.length - 1 ? out : null;
86
+ out += char;
87
+ }
88
+ return null;
89
+ }
90
+ function sfString(value) {
91
+ if (!/^[\x20-\x7e]*$/.test(value)) throw new TypeError(`DBSC header values must be printable ASCII, got ${JSON.stringify(value)}.`);
92
+ return `"${value.replace(/[\\"]/g, (char) => `\\${char}`)}"`;
93
+ }
94
+ // src/core/errors.ts
95
+ /**
96
+ * Thrown when a DBSC proof (`Secure-Session-Response` JWT) cannot be accepted.
97
+ * `code` is stable across releases; `message` says what to fix.
98
+ */
99
+ var DbscError = class extends Error {
100
+ code;
101
+ constructor(code, message, options) {
102
+ super(message, options);
103
+ this.name = "DbscError";
104
+ this.code = code;
105
+ }
106
+ };
107
+ function isDbscError(error) {
108
+ return error instanceof DbscError;
109
+ }
110
+ // src/core/proof.ts
111
+ const DBSC_ALGORITHMS = ["ES256", "RS256"];
112
+ const ACCEPTED_TYPES = /* @__PURE__ */ new Set(["dbsc+jwt", "jwt"]);
113
+ const MIN_RSA_MODULUS_BITS = 2048;
114
+ /**
115
+ * Verifies the registration proof the browser sends in `Secure-Session-Response`.
116
+ * The JWT is self-signed by the new device key, which travels in the JOSE header as
117
+ * `jwk` (current spec) or in the payload as `jwk` / `key` (earlier Chrome builds).
118
+ */
119
+ async function verifyRegistrationProof(jwt, input) {
120
+ const algorithms = input.algorithms ?? DBSC_ALGORITHMS;
121
+ const header = readHeader(jwt);
122
+ const algorithm = readAlgorithm(header.alg, algorithms);
123
+ const unverifiedPayload = readUnverifiedPayload(jwt);
124
+ const publicKey = toPublicKey(header.jwk ?? unverifiedPayload.jwk ?? unverifiedPayload.key, algorithm);
125
+ const claims = await verifySignature(jwt, publicKey);
126
+ checkClaims(claims, input);
127
+ if (input.authorization !== void 0 && claims.authorization !== input.authorization) throw new DbscError("AUTHORIZATION_MISMATCH", "The registration proof's `authorization` claim does not match the value the server issued.");
128
+ return {
129
+ publicKey,
130
+ thumbprint: await calculateJwkThumbprint(publicKey),
131
+ algorithm,
132
+ claims
133
+ };
134
+ }
135
+ /** Verifies a refresh proof against the key bound at registration. */
136
+ async function verifyRefreshProof(jwt, input) {
137
+ readAlgorithm(readHeader(jwt).alg, [input.publicKey.alg]);
138
+ const claims = await verifySignature(jwt, input.publicKey);
139
+ checkClaims(claims, input);
140
+ return { claims };
141
+ }
142
+ /**
143
+ * The proof JWT from a `Secure-Session-Response` value: an sf-string, or a bare JWT as
144
+ * earlier drafts sent it. Parameters are ignored.
145
+ */
146
+ function parseProofHeader(header) {
147
+ return /^\s*"?([\w-]+\.[\w-]+\.[\w-]*)"?\s*(;|$)/.exec(header ?? "")?.[1] ?? null;
148
+ }
149
+ /** The proof's `jti`, read without verifying anything. Use it only to find the challenge. */
150
+ function readUnverifiedChallenge(jwt) {
151
+ try {
152
+ const jti = readUnverifiedPayload(jwt).jti;
153
+ return typeof jti === "string" ? jti : null;
154
+ } catch {
155
+ return null;
156
+ }
157
+ }
158
+ /** Parses a stored public key, or returns `null` when it is missing or not a DBSC key. */
159
+ function parseStoredPublicKey(value) {
160
+ if (typeof value !== "string" || value.length === 0) return null;
161
+ try {
162
+ const jwk = JSON.parse(value);
163
+ if (!isDbscAlgorithm(jwk.alg)) return null;
164
+ return toPublicKey(jwk, jwk.alg);
165
+ } catch {
166
+ return null;
167
+ }
168
+ }
169
+ function isDbscAlgorithm(value) {
170
+ return value === "ES256" || value === "RS256";
171
+ }
172
+ function readHeader(jwt) {
173
+ if (typeof jwt !== "string" || jwt.split(".").length !== 3) throw new DbscError("MALFORMED_PROOF", "The DBSC proof must be a compact JWS with three segments.");
174
+ let header;
175
+ try {
176
+ header = decodeProtectedHeader(jwt);
177
+ } catch (cause) {
178
+ throw new DbscError("MALFORMED_PROOF", "The DBSC proof has an unreadable JOSE header.", { cause });
179
+ }
180
+ if (typeof header.typ === "string" && !ACCEPTED_TYPES.has(header.typ.toLowerCase())) throw new DbscError("UNSUPPORTED_TYPE", `The DBSC proof has \`typ\` "${header.typ}"; expected "dbsc+jwt".`);
181
+ return header;
182
+ }
183
+ function readAlgorithm(alg, allowed) {
184
+ if (typeof alg === "string" && allowed.includes(alg)) return alg;
185
+ throw new DbscError("UNSUPPORTED_ALGORITHM", `The DBSC proof uses \`alg\` ${JSON.stringify(alg)}; expected one of ${allowed.join(", ")}.`);
186
+ }
187
+ function readUnverifiedPayload(jwt) {
188
+ try {
189
+ const segment = jwt.split(".")[1] ?? "";
190
+ const parsed = JSON.parse(new TextDecoder().decode(base64UrlDecode$1(segment)));
191
+ if (parsed && typeof parsed === "object" && !Array.isArray(parsed)) return parsed;
192
+ } catch {}
193
+ throw new DbscError("MALFORMED_PROOF", "The DBSC proof payload is not a JSON object.");
194
+ }
195
+ function toPublicKey(value, algorithm) {
196
+ if (!value || typeof value !== "object" || Array.isArray(value)) throw new DbscError("INVALID_PUBLIC_KEY", "The registration proof does not carry a public key. Expected a JWK in the JOSE header `jwk`.");
197
+ const jwk = value;
198
+ if ("d" in jwk || "p" in jwk || "q" in jwk) throw new DbscError("INVALID_PUBLIC_KEY", "The DBSC key must be a public JWK; it contains private members.");
199
+ if (algorithm === "ES256") {
200
+ if (jwk.kty !== "EC" || jwk.crv !== "P-256" || typeof jwk.x !== "string" || typeof jwk.y !== "string") throw new DbscError("INVALID_PUBLIC_KEY", "An ES256 DBSC key must be an EC P-256 JWK with `x` and `y`.");
201
+ return {
202
+ kty: "EC",
203
+ crv: "P-256",
204
+ x: jwk.x,
205
+ y: jwk.y,
206
+ alg: "ES256"
207
+ };
208
+ }
209
+ if (jwk.kty !== "RSA" || typeof jwk.n !== "string" || typeof jwk.e !== "string") throw new DbscError("INVALID_PUBLIC_KEY", "An RS256 DBSC key must be an RSA JWK with `n` and `e`.");
210
+ if (modulusBits(jwk.n) < MIN_RSA_MODULUS_BITS) throw new DbscError("INVALID_PUBLIC_KEY", `An RS256 DBSC key must be at least ${MIN_RSA_MODULUS_BITS} bits.`);
211
+ return {
212
+ kty: "RSA",
213
+ n: jwk.n,
214
+ e: jwk.e,
215
+ alg: "RS256"
216
+ };
217
+ }
218
+ async function verifySignature(jwt, publicKey) {
219
+ let payload;
220
+ try {
221
+ const key = await importJWK(publicKey, publicKey.alg);
222
+ ({payload} = await compactVerify(jwt, key, { algorithms: [publicKey.alg] }));
223
+ } catch (cause) {
224
+ throw new DbscError("INVALID_SIGNATURE", "The DBSC proof signature does not verify with the session key.", { cause });
225
+ }
226
+ let claims;
227
+ try {
228
+ claims = JSON.parse(new TextDecoder().decode(payload));
229
+ } catch {
230
+ claims = null;
231
+ }
232
+ if (!claims || typeof claims !== "object" || Array.isArray(claims)) throw new DbscError("MALFORMED_PROOF", "The DBSC proof payload is not a JSON object.");
233
+ return claims;
234
+ }
235
+ function checkClaims(claims, input) {
236
+ if (typeof claims.jti !== "string" || !timingSafeEqual(claims.jti, input.challenge)) throw new DbscError("CHALLENGE_MISMATCH", "The DBSC proof's `jti` does not match the current challenge.");
237
+ if (input.expectedOrigin === void 0 || claims.aud === void 0) return;
238
+ const audiences = Array.isArray(claims.aud) ? claims.aud : [claims.aud];
239
+ for (const audience of audiences) if (typeof audience !== "string" || originOf(audience) !== input.expectedOrigin) throw new DbscError("AUDIENCE_MISMATCH", `The DBSC proof's \`aud\` ${JSON.stringify(audience)} is not on ${input.expectedOrigin}.`);
240
+ }
241
+ function originOf(url) {
242
+ try {
243
+ return new URL(url).origin;
244
+ } catch {
245
+ return null;
246
+ }
247
+ }
248
+ function timingSafeEqual(a, b) {
249
+ if (a.length !== b.length) return false;
250
+ let diff = 0;
251
+ for (let i = 0; i < a.length; i++) diff |= a.charCodeAt(i) ^ b.charCodeAt(i);
252
+ return diff === 0;
253
+ }
254
+ function modulusBits(n) {
255
+ try {
256
+ return base64UrlDecode$1(n).length * 8;
257
+ } catch {
258
+ return 0;
259
+ }
260
+ }
261
+ function base64UrlDecode$1(value) {
262
+ const base64 = value.replace(/-/g, "+").replace(/_/g, "/");
263
+ const binary = atob(base64 + "=".repeat((4 - base64.length % 4) % 4));
264
+ return Uint8Array.from(binary, (char) => char.charCodeAt(0));
265
+ }
266
+ // src/core/token.ts
267
+ /**
268
+ * The values this package signs with the server secret. Each is
269
+ * `<numbers…>.<nonce>.<mac>`, where the MAC covers a fixed domain, the session token and
270
+ * every other part, so a value made for one purpose or session is worthless for another.
271
+ * Nothing here is stored: a value is checked by recomputing its MAC.
272
+ */
273
+ const encoder = new TextEncoder();
274
+ const DOMAIN = {
275
+ challenge: "dbsc.challenge.v1",
276
+ bound: "dbsc.bound-cookie.v2",
277
+ freshProof: "dbsc.fresh-proof.v1"
278
+ };
279
+ /** A challenge the browser signs as its proof's `jti`: `<issued ms>.<nonce>.<mac>`. */
280
+ async function createDbscChallenge(input) {
281
+ const issued = String(input.nowMs);
282
+ const nonce = randomId();
283
+ return `${issued}.${nonce}.${await sign(input.secret, DOMAIN.challenge, input.purpose, input.sessionToken, nonce, issued)}`;
284
+ }
285
+ /**
286
+ * When the challenge was issued, or `null` when it was not made by this server for this
287
+ * purpose and session, or is older than `ttlSeconds`. Up to 30 seconds of clock skew
288
+ * between instances is tolerated.
289
+ */
290
+ async function readDbscChallenge(input) {
291
+ const parts = splitParts(input.challenge, 3);
292
+ if (!parts) return null;
293
+ const [issued, nonce, mac] = parts;
294
+ if (!isDigits(issued)) return null;
295
+ const age = input.nowMs - Number(issued);
296
+ if (age > input.ttlSeconds * 1e3 || age < -3e4) return null;
297
+ return await verify(input.secret, mac, DOMAIN.challenge, input.purpose, input.sessionToken, nonce, issued) ? { issuedAtMs: Number(issued) } : null;
298
+ }
299
+ /** No fresh-proof challenge: `-` is never a nonce. */
300
+ const NO_CHALLENGE = "-";
301
+ /** The bound cookie's value: `<expires s>.<answered nonce or ->.<nonce>.<mac>`. */
302
+ async function createBoundToken(input) {
303
+ const expires = String(Math.floor(input.expiresAtMs / 1e3));
304
+ const answers = input.answers && isNonce(input.answers) ? input.answers : NO_CHALLENGE;
305
+ const nonce = randomId();
306
+ return `${expires}.${answers}.${nonce}.${await sign(input.secret, DOMAIN.bound, input.sessionToken, nonce, expires, answers)}`;
307
+ }
308
+ /**
309
+ * The cookie's expiry and the fresh-proof challenge it answers, or `null` unless it is
310
+ * live and minted for this session.
311
+ */
312
+ async function readBoundToken(input) {
313
+ const parts = splitParts(input.token, 4);
314
+ if (!parts) return null;
315
+ const [expires, answers, nonce, mac] = parts;
316
+ if (!isDigits(expires) || answers !== NO_CHALLENGE && !isNonce(answers)) return null;
317
+ if (Number(expires) * 1e3 <= input.nowMs) return null;
318
+ if (!await verify(input.secret, mac, DOMAIN.bound, input.sessionToken, nonce, expires, answers)) return null;
319
+ return {
320
+ expiresAtMs: Number(expires) * 1e3,
321
+ answers: answers === NO_CHALLENGE ? null : answers
322
+ };
323
+ }
324
+ /** A fresh-proof challenge for one action: `<issued ms>.<nonce>.<mac>`. */
325
+ async function createFreshProofToken(input) {
326
+ const issued = String(input.nowMs);
327
+ const nonce = randomId();
328
+ return `${issued}.${nonce}.${await sign(input.secret, DOMAIN.freshProof, input.sessionToken, input.action, nonce, issued)}`;
329
+ }
330
+ /**
331
+ * When the fresh-proof challenge was issued and its nonce, or `null` unless it is live and
332
+ * for this action.
333
+ */
334
+ async function readFreshProofToken(input) {
335
+ const parts = splitParts(input.token, 3);
336
+ if (!parts) return null;
337
+ const [issued, nonce, mac] = parts;
338
+ if (!isDigits(issued)) return null;
339
+ const age = input.nowMs - Number(issued);
340
+ if (age < 0 || age > input.ttlSeconds * 1e3) return null;
341
+ return await verify(input.secret, mac, DOMAIN.freshProof, input.sessionToken, input.action, nonce, issued) ? {
342
+ issuedAtMs: Number(issued),
343
+ nonce
344
+ } : null;
345
+ }
346
+ /**
347
+ * The nonce in a fresh-proof challenge, unverified, for `createBoundToken`'s `answers`.
348
+ * A refresh doesn't know the action the challenge is for, so it can't check the MAC; the
349
+ * answer is checked in full when the bound cookie is compared against the challenge.
350
+ */
351
+ function readFreshProofNonce(token) {
352
+ const parts = splitParts(token, 3);
353
+ return parts && isNonce(parts[1]) ? parts[1] : null;
354
+ }
355
+ function splitParts(value, count) {
356
+ if (typeof value !== "string") return null;
357
+ const parts = value.split(".");
358
+ if (parts.length !== count || parts.some((part) => part.length === 0)) return null;
359
+ return parts;
360
+ }
361
+ function isDigits(value) {
362
+ return /^\d{1,16}$/.test(value);
363
+ }
364
+ function isNonce(value) {
365
+ return /^[A-Za-z0-9_-]{16,64}$/.test(value);
366
+ }
367
+ function randomId() {
368
+ return base64UrlEncode(crypto.getRandomValues(/* @__PURE__ */ new Uint8Array(16)));
369
+ }
370
+ async function sign(secret, ...parts) {
371
+ const key = await importKey(secret);
372
+ const mac = await crypto.subtle.sign("HMAC", key, encoder.encode(parts.join("\0")));
373
+ return base64UrlEncode(new Uint8Array(mac));
374
+ }
375
+ /** Constant-time: WebCrypto's HMAC verify compares in constant time. */
376
+ async function verify(secret, mac, ...parts) {
377
+ const bytes = base64UrlDecode(mac);
378
+ if (!bytes) return false;
379
+ return crypto.subtle.verify("HMAC", await importKey(secret), bytes, encoder.encode(parts.join("\0")));
380
+ }
381
+ function importKey(secret) {
382
+ return crypto.subtle.importKey("raw", encoder.encode(secret), {
383
+ name: "HMAC",
384
+ hash: "SHA-256"
385
+ }, false, ["sign", "verify"]);
386
+ }
387
+ function base64UrlEncode(bytes) {
388
+ let binary = "";
389
+ for (const byte of bytes) binary += String.fromCharCode(byte);
390
+ return btoa(binary).replace(/\+/g, "-").replace(/\//g, "_").replace(/=+$/, "");
391
+ }
392
+ function base64UrlDecode(value) {
393
+ if (!/^[A-Za-z0-9_-]+$/.test(value)) return null;
394
+ const base64 = value.replace(/-/g, "+").replace(/_/g, "/");
395
+ try {
396
+ const binary = atob(base64 + "=".repeat((4 - base64.length % 4) % 4));
397
+ return Uint8Array.from(binary, (char) => char.charCodeAt(0));
398
+ } catch {
399
+ return null;
400
+ }
401
+ }
402
+ export { formatCookieAttributes as C, DBSC_TERMINATE as S, formatChallengeHeader as _, readDbscChallenge as a, parseSfString as b, DBSC_ALGORITHMS as c, readUnverifiedChallenge as d, verifyRefreshProof as f, DBSC_HEADERS as g, isDbscError as h, readBoundToken as i, parseProofHeader as l, DbscError as m, createDbscChallenge as n, readFreshProofNonce as o, verifyRegistrationProof as p, createFreshProofToken as r, readFreshProofToken as s, createBoundToken as t, parseStoredPublicKey as u, formatRegistrationHeader as v, readDbscHeader as x, getDbscHeaderNames as y };
package/dist/core.d.ts ADDED
@@ -0,0 +1,3 @@
1
+ import { C as DBSC_TERMINATE, D as DbscSessionConfig, E as DbscScopeRule, O as formatCookieAttributes, S as verifyRegistrationProof, T as DbscCredential, _ as VerifyRegistrationProofResult, a as formatChallengeHeader, b as readUnverifiedChallenge, c as parseSfString, d as DbscAlgorithm, f as DbscProofClaims, g as VerifyRegistrationProofInput, h as VerifyRefreshProofResult, i as DbscRegistrationHeaderInput, l as readDbscHeader, m as VerifyRefreshProofInput, n as DbscChallengeHeaderInput, o as formatRegistrationHeader, p as DbscPublicKey, r as DbscHeaderNames, s as getDbscHeaderNames, t as DBSC_HEADERS, u as DBSC_ALGORITHMS, v as parseProofHeader, w as DbscCookieAttributes, x as verifyRefreshProof, y as parseStoredPublicKey } from "./headers-KXqmHcXY.js";
2
+ import { _ as isDbscError, a as ReadBoundTokenInput, c as createBoundToken, d as readBoundToken, f as readDbscChallenge, g as DbscErrorCode, h as DbscError, i as DbscChallengePurpose, l as createDbscChallenge, m as readFreshProofToken, n as CreateDbscChallengeInput, o as ReadDbscChallengeInput, p as readFreshProofNonce, r as CreateFreshProofTokenInput, s as ReadFreshProofTokenInput, t as CreateBoundTokenInput, u as createFreshProofToken } from "./index-s7R-j-qI.js";
3
+ export { type CreateBoundTokenInput, type CreateDbscChallengeInput, type CreateFreshProofTokenInput, DBSC_ALGORITHMS, DBSC_HEADERS, DBSC_TERMINATE, type DbscAlgorithm, type DbscChallengeHeaderInput, type DbscChallengePurpose, type DbscCookieAttributes, type DbscCredential, DbscError, type DbscErrorCode, type DbscHeaderNames, type DbscProofClaims, type DbscPublicKey, type DbscRegistrationHeaderInput, type DbscScopeRule, type DbscSessionConfig, type ReadBoundTokenInput, type ReadDbscChallengeInput, type ReadFreshProofTokenInput, type VerifyRefreshProofInput, type VerifyRefreshProofResult, type VerifyRegistrationProofInput, type VerifyRegistrationProofResult, createBoundToken, createDbscChallenge, createFreshProofToken, formatChallengeHeader, formatCookieAttributes, formatRegistrationHeader, getDbscHeaderNames, isDbscError, parseProofHeader, parseSfString, parseStoredPublicKey, readBoundToken, readDbscChallenge, readDbscHeader, readFreshProofNonce, readFreshProofToken, readUnverifiedChallenge, verifyRefreshProof, verifyRegistrationProof };
package/dist/core.js ADDED
@@ -0,0 +1 @@
1
+ export { c as DBSC_ALGORITHMS, g as DBSC_HEADERS, S as DBSC_TERMINATE, m as DbscError, t as createBoundToken, n as createDbscChallenge, r as createFreshProofToken, _ as formatChallengeHeader, C as formatCookieAttributes, v as formatRegistrationHeader, y as getDbscHeaderNames, h as isDbscError, l as parseProofHeader, b as parseSfString, u as parseStoredPublicKey, i as readBoundToken, a as readDbscChallenge, x as readDbscHeader, o as readFreshProofNonce, s as readFreshProofToken, d as readUnverifiedChallenge, f as verifyRefreshProof, p as verifyRegistrationProof } from "./core-B8q_n4sn.js";