@codespar/sdk 0.16.9 → 0.16.11
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/dist/__tests__/mandate-strict.test.d.ts +2 -0
- package/dist/__tests__/mandate-strict.test.d.ts.map +1 -0
- package/dist/__tests__/mandate-strict.test.js +234 -0
- package/dist/__tests__/mandate-strict.test.js.map +1 -0
- package/dist/__tests__/mandate.test.js +9 -3
- package/dist/__tests__/mandate.test.js.map +1 -1
- package/dist/generated/openapi.d.ts +376 -59
- package/dist/generated/openapi.d.ts.map +1 -1
- package/dist/mandate/index.d.ts +63 -24
- package/dist/mandate/index.d.ts.map +1 -1
- package/dist/mandate/index.js +104 -30
- package/dist/mandate/index.js.map +1 -1
- package/package.json +1 -1
package/dist/mandate/index.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* The signed mandate fields.
|
|
3
|
-
* `
|
|
2
|
+
* The signed mandate fields. `principal_kyc_ref` and `agent_kid` are absent on
|
|
3
|
+
* V2 and required from V3 on; `issued_at` is required on V4 and absent before.
|
|
4
4
|
*/
|
|
5
5
|
export interface MandateFields {
|
|
6
6
|
format_version: number;
|
|
@@ -18,10 +18,12 @@ export interface MandateFields {
|
|
|
18
18
|
parent_id?: string | null;
|
|
19
19
|
denomination?: string | null;
|
|
20
20
|
secret_version: number;
|
|
21
|
-
/** V3
|
|
21
|
+
/** V3+. Reference to the proofed CPF/CNPJ (Celcoin KYC) the agent acts for. */
|
|
22
22
|
principal_kyc_ref?: string | null;
|
|
23
|
-
/** V3
|
|
23
|
+
/** V3+. The agent key id (`<agent_did>#<n>`) that signed this mandate. */
|
|
24
24
|
agent_kid?: string | null;
|
|
25
|
+
/** V4-only. Issuance time, UNIX seconds. Signed, so it cannot be moved. */
|
|
26
|
+
issued_at?: number;
|
|
25
27
|
}
|
|
26
28
|
/** A decoded presentation token: the signed fields plus the signature envelope. */
|
|
27
29
|
export interface DecodedMandateToken {
|
|
@@ -53,13 +55,13 @@ export declare function decodeMandateToken(token: string): MandateDecodeResult;
|
|
|
53
55
|
/**
|
|
54
56
|
* Reconstruct the canonical signing string the Ed25519 signatures cover.
|
|
55
57
|
*
|
|
56
|
-
* Field order
|
|
57
|
-
* V3
|
|
58
|
-
*
|
|
59
|
-
*
|
|
60
|
-
*
|
|
61
|
-
*
|
|
62
|
-
*
|
|
58
|
+
* Field order: V2 = 12 fields; V3 = V2 + principal_kyc_ref + agent_kid (14);
|
|
59
|
+
* V4 = V3 with issued_at inserted before agent_kid (15), so agent_kid stays the
|
|
60
|
+
* last field. Absent optionals render empty so the separator count is
|
|
61
|
+
* invariant. `purposes` is comma-joined after a lexicographic sort with
|
|
62
|
+
* escaping (`\` → `\\` first, then `,` → `\,`). Colons inside `agent_kid` (from
|
|
63
|
+
* `did:web`) are emitted verbatim — the string is a one-way serialization,
|
|
64
|
+
* never re-split.
|
|
63
65
|
*/
|
|
64
66
|
export declare function reconstructSigningString(f: Record<string, unknown>): string;
|
|
65
67
|
/**
|
|
@@ -69,7 +71,10 @@ export declare function reconstructSigningString(f: Record<string, unknown>): st
|
|
|
69
71
|
export declare function verifyEd25519(signingString: string, signatureB64url: string, pub: Buffer): boolean;
|
|
70
72
|
/** Strip the `#<fragment>` from an agent key id to recover the bare agent DID. */
|
|
71
73
|
export declare function agentDidFromKid(kid: string): string;
|
|
72
|
-
/**
|
|
74
|
+
/**
|
|
75
|
+
* Per-signature outcome. `skipped` = carried but no key supplied to check it;
|
|
76
|
+
* `absent` = the token does not carry it. Neither is a pass.
|
|
77
|
+
*/
|
|
73
78
|
export type SignatureStatus = "verified" | "failed" | "skipped" | "absent";
|
|
74
79
|
export interface SignatureCheck {
|
|
75
80
|
present: boolean;
|
|
@@ -77,35 +82,69 @@ export interface SignatureCheck {
|
|
|
77
82
|
/** The key id associated with the signature (agent kid; issuer has none). */
|
|
78
83
|
kid?: string;
|
|
79
84
|
}
|
|
85
|
+
/**
|
|
86
|
+
* Why a token is not verified. Stable machine codes, in this order:
|
|
87
|
+
* - `kid_mismatch`: the envelope `kid` differs from the signed `agent_kid`;
|
|
88
|
+
* - `kid_not_in_document`: the agent DID document has no Ed25519 key under
|
|
89
|
+
* the kid the token names (no other key is tried);
|
|
90
|
+
* - `agent_sig_absent` / `issuer_sig_absent`: the token does not carry it;
|
|
91
|
+
* - `agent_sig_unchecked` / `issuer_sig_unchecked`: carried, no key given;
|
|
92
|
+
* - `agent_sig_invalid` / `issuer_sig_invalid`: checked and did not verify;
|
|
93
|
+
* - `expired`: the clock is past `expires_at`.
|
|
94
|
+
*/
|
|
95
|
+
export type MandateVerificationFailure = "kid_mismatch" | "kid_not_in_document" | "agent_sig_absent" | "agent_sig_unchecked" | "agent_sig_invalid" | "issuer_sig_absent" | "issuer_sig_unchecked" | "issuer_sig_invalid" | "expired";
|
|
80
96
|
export interface VerifyMandateOptions {
|
|
81
|
-
/**
|
|
97
|
+
/**
|
|
98
|
+
* Raw 32-byte Ed25519 agent public key — hex string or bytes. Passing a raw
|
|
99
|
+
* key asserts it is the key published under the token's `agent_kid`; to have
|
|
100
|
+
* the verifier pick it, pass `agentDidDocument` instead.
|
|
101
|
+
*/
|
|
82
102
|
agentPublicKey?: string | Uint8Array;
|
|
103
|
+
/**
|
|
104
|
+
* The agent's did:web document (parsed JSON). Only the `verificationMethod`
|
|
105
|
+
* whose `id` equals the token's signed `agent_kid` is used: a retired key
|
|
106
|
+
* listed beside it does not verify a token that names another kid.
|
|
107
|
+
* Mutually exclusive with `agentPublicKey`.
|
|
108
|
+
*/
|
|
109
|
+
agentDidDocument?: unknown;
|
|
83
110
|
/** Raw 32-byte Ed25519 issuer (platform) public key — hex string or bytes. */
|
|
84
111
|
issuerPublicKey?: string | Uint8Array;
|
|
112
|
+
/** The clock for the expiry check, in UNIX seconds. Default: now. */
|
|
113
|
+
now?: number;
|
|
85
114
|
}
|
|
86
115
|
export interface MandateVerification {
|
|
87
|
-
/**
|
|
116
|
+
/**
|
|
117
|
+
* True iff BOTH Ed25519 signatures are carried and verify, under the key the
|
|
118
|
+
* token names, and the token is not expired. Nothing unchecked counts.
|
|
119
|
+
*/
|
|
88
120
|
verified: boolean;
|
|
121
|
+
/** Why `verified` is false; empty exactly when it is true. */
|
|
122
|
+
failures: MandateVerificationFailure[];
|
|
123
|
+
/** The clock was past `expires_at`. */
|
|
124
|
+
expired: boolean;
|
|
89
125
|
mandate: MandateFields;
|
|
90
126
|
/** The bare agent DID (kid without its `#fragment`), when present. */
|
|
91
127
|
agentDid?: string;
|
|
92
|
-
/** The agent key id
|
|
128
|
+
/** The agent key id the token names: the signed `agent_kid` (V3+), else the envelope `kid`. */
|
|
93
129
|
kid?: string;
|
|
130
|
+
/** V4: the signed issuance time, UNIX seconds. */
|
|
131
|
+
issuedAt?: number;
|
|
94
132
|
agent: SignatureCheck;
|
|
95
133
|
issuer: SignatureCheck;
|
|
96
134
|
}
|
|
97
135
|
/**
|
|
98
|
-
* Offline-verify a V3 mandate presentation token against supplied
|
|
136
|
+
* Offline-verify a V3 or V4 mandate presentation token against supplied keys.
|
|
99
137
|
*
|
|
100
|
-
* Pure and network-free: you pass the
|
|
101
|
-
*
|
|
102
|
-
*
|
|
103
|
-
*
|
|
104
|
-
*
|
|
105
|
-
*
|
|
138
|
+
* Pure and network-free: you pass the issuer public key and the agent's public
|
|
139
|
+
* key (or its DID document) and it checks both signatures. `verified` is true
|
|
140
|
+
* only when both signatures are carried and verify, the agent signature under
|
|
141
|
+
* the key the token names, and the token has not expired. A V2 token carries
|
|
142
|
+
* no Ed25519 signature and is never verified here (its only proof is the org
|
|
143
|
+
* HMAC, which needs the org secret).
|
|
106
144
|
*
|
|
107
|
-
* Throws
|
|
108
|
-
* malformed token from a well-formed but unverified one)
|
|
145
|
+
* Throws on a token that cannot be decoded (so a caller can distinguish a
|
|
146
|
+
* malformed token from a well-formed but unverified one), and when both
|
|
147
|
+
* `agentPublicKey` and `agentDidDocument` are given.
|
|
109
148
|
*/
|
|
110
149
|
export declare function verifyMandateToken(token: string, opts?: VerifyMandateOptions): MandateVerification;
|
|
111
150
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/mandate/index.ts"],"names":[],"mappings":"AAwBA;;;GAGG;AACH,MAAM,WAAW,aAAa;IAC5B,cAAc,EAAE,MAAM,CAAC;IACvB,EAAE,EAAE,MAAM,CAAC;IACX,QAAQ,EAAE,MAAM,CAAC;IACjB,IAAI,EAAE,SAAS,GAAG,cAAc,GAAG,YAAY,CAAC;IAChD,mEAAmE;IACnE,MAAM,EAAE,MAAM,CAAC;IACf,QAAQ,EAAE,MAAM,CAAC;IACjB,4DAA4D;IAC5D,QAAQ,EAAE,MAAM,EAAE,CAAC;IACnB,oBAAoB;IACpB,UAAU,EAAE,MAAM,CAAC;IACnB,UAAU,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAC3B,SAAS,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAC1B,YAAY,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAC7B,cAAc,EAAE,MAAM,CAAC;IACvB
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/mandate/index.ts"],"names":[],"mappings":"AAwBA;;;GAGG;AACH,MAAM,WAAW,aAAa;IAC5B,cAAc,EAAE,MAAM,CAAC;IACvB,EAAE,EAAE,MAAM,CAAC;IACX,QAAQ,EAAE,MAAM,CAAC;IACjB,IAAI,EAAE,SAAS,GAAG,cAAc,GAAG,YAAY,CAAC;IAChD,mEAAmE;IACnE,MAAM,EAAE,MAAM,CAAC;IACf,QAAQ,EAAE,MAAM,CAAC;IACjB,4DAA4D;IAC5D,QAAQ,EAAE,MAAM,EAAE,CAAC;IACnB,oBAAoB;IACpB,UAAU,EAAE,MAAM,CAAC;IACnB,UAAU,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAC3B,SAAS,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|
|
2
|
-
* `@codespar/sdk/mandate` — offline V3 mandate verification.
|
|
2
|
+
* `@codespar/sdk/mandate` — offline V3/V4 mandate verification.
|
|
3
3
|
*
|
|
4
4
|
* A third party holding only a presentation token and a raw Ed25519 public key
|
|
5
5
|
* (from the agent's did:web document) can reconstruct the exact signing string
|
|
@@ -15,9 +15,9 @@
|
|
|
15
15
|
* if (!res.verified) throw new Error("mandate signature invalid");
|
|
16
16
|
* ```
|
|
17
17
|
*
|
|
18
|
-
* The byte format is frozen by the shared `canonical.v3.fixture.json`
|
|
19
|
-
*
|
|
20
|
-
* step. `node:crypto` is a Node builtin, not an npm dependency — the SDK's
|
|
18
|
+
* The byte format is frozen by the shared `canonical.v3.fixture.json` and
|
|
19
|
+
* `canonical.v4.fixture.json` (the same freezes the enterprise codec and the CLI
|
|
20
|
+
* pin), so all three impls stay in lock step. `node:crypto` is a Node builtin, not an npm dependency — the SDK's
|
|
21
21
|
* zero-runtime-dependency guarantee is intact.
|
|
22
22
|
*/
|
|
23
23
|
import { createPublicKey, verify as nodeVerify } from "node:crypto";
|
|
@@ -40,7 +40,10 @@ export function decodeMandateToken(token) {
|
|
|
40
40
|
}
|
|
41
41
|
const r = raw;
|
|
42
42
|
const version = r["format_version"];
|
|
43
|
-
|
|
43
|
+
// Only the formats whose signing string this module knows. A later format
|
|
44
|
+
// reconstructed with an older tail would fail as "tampered", which is the
|
|
45
|
+
// wrong answer: it is unreadable here, not forged.
|
|
46
|
+
if (typeof version !== "number" || !SUPPORTED_FORMATS.includes(version)) {
|
|
44
47
|
return { ok: false, error: "mandate_format_unsupported" };
|
|
45
48
|
}
|
|
46
49
|
if (!isValidMandateFields(r)) {
|
|
@@ -59,6 +62,7 @@ export function decodeMandateToken(token) {
|
|
|
59
62
|
decoded.kid = kid;
|
|
60
63
|
return { ok: true, token: decoded };
|
|
61
64
|
}
|
|
65
|
+
const SUPPORTED_FORMATS = [2, 3, 4];
|
|
62
66
|
function isValidMandateFields(r) {
|
|
63
67
|
if (typeof r["format_version"] !== "number")
|
|
64
68
|
return false;
|
|
@@ -78,24 +82,28 @@ function isValidMandateFields(r) {
|
|
|
78
82
|
return false;
|
|
79
83
|
if (typeof r["secret_version"] !== "number")
|
|
80
84
|
return false;
|
|
81
|
-
if (r["format_version"] === 3) {
|
|
85
|
+
if (r["format_version"] === 3 || r["format_version"] === 4) {
|
|
82
86
|
if (typeof r["principal_kyc_ref"] !== "string")
|
|
83
87
|
return false;
|
|
84
88
|
if (typeof r["agent_kid"] !== "string")
|
|
85
89
|
return false;
|
|
86
90
|
}
|
|
91
|
+
if (r["format_version"] === 4) {
|
|
92
|
+
if (typeof r["issued_at"] !== "number" || !Number.isInteger(r["issued_at"]))
|
|
93
|
+
return false;
|
|
94
|
+
}
|
|
87
95
|
return true;
|
|
88
96
|
}
|
|
89
97
|
/**
|
|
90
98
|
* Reconstruct the canonical signing string the Ed25519 signatures cover.
|
|
91
99
|
*
|
|
92
|
-
* Field order
|
|
93
|
-
* V3
|
|
94
|
-
*
|
|
95
|
-
*
|
|
96
|
-
*
|
|
97
|
-
*
|
|
98
|
-
*
|
|
100
|
+
* Field order: V2 = 12 fields; V3 = V2 + principal_kyc_ref + agent_kid (14);
|
|
101
|
+
* V4 = V3 with issued_at inserted before agent_kid (15), so agent_kid stays the
|
|
102
|
+
* last field. Absent optionals render empty so the separator count is
|
|
103
|
+
* invariant. `purposes` is comma-joined after a lexicographic sort with
|
|
104
|
+
* escaping (`\` → `\\` first, then `,` → `\,`). Colons inside `agent_kid` (from
|
|
105
|
+
* `did:web`) are emitted verbatim — the string is a one-way serialization,
|
|
106
|
+
* never re-split.
|
|
99
107
|
*/
|
|
100
108
|
export function reconstructSigningString(f) {
|
|
101
109
|
const esc = (s) => s.replace(/\\/g, "\\\\").replace(/,/g, "\\,");
|
|
@@ -119,9 +127,12 @@ export function reconstructSigningString(f) {
|
|
|
119
127
|
f["denomination"] ?? "",
|
|
120
128
|
String(f["secret_version"]),
|
|
121
129
|
];
|
|
122
|
-
if (version >= 3)
|
|
123
|
-
parts.push(f["principal_kyc_ref"] ?? ""
|
|
124
|
-
|
|
130
|
+
if (version >= 3)
|
|
131
|
+
parts.push(f["principal_kyc_ref"] ?? "");
|
|
132
|
+
if (version >= 4)
|
|
133
|
+
parts.push(f["issued_at"] == null ? "" : String(f["issued_at"]));
|
|
134
|
+
if (version >= 3)
|
|
135
|
+
parts.push(f["agent_kid"] ?? "");
|
|
125
136
|
return parts.join(":");
|
|
126
137
|
}
|
|
127
138
|
// A raw Ed25519 public key becomes an SPKI KeyObject by prefixing the fixed
|
|
@@ -168,19 +179,23 @@ export function agentDidFromKid(kid) {
|
|
|
168
179
|
return hash === -1 ? kid : kid.slice(0, hash);
|
|
169
180
|
}
|
|
170
181
|
/**
|
|
171
|
-
* Offline-verify a V3 mandate presentation token against supplied
|
|
182
|
+
* Offline-verify a V3 or V4 mandate presentation token against supplied keys.
|
|
172
183
|
*
|
|
173
|
-
* Pure and network-free: you pass the
|
|
174
|
-
*
|
|
175
|
-
*
|
|
176
|
-
*
|
|
177
|
-
*
|
|
178
|
-
*
|
|
184
|
+
* Pure and network-free: you pass the issuer public key and the agent's public
|
|
185
|
+
* key (or its DID document) and it checks both signatures. `verified` is true
|
|
186
|
+
* only when both signatures are carried and verify, the agent signature under
|
|
187
|
+
* the key the token names, and the token has not expired. A V2 token carries
|
|
188
|
+
* no Ed25519 signature and is never verified here (its only proof is the org
|
|
189
|
+
* HMAC, which needs the org secret).
|
|
179
190
|
*
|
|
180
|
-
* Throws
|
|
181
|
-
* malformed token from a well-formed but unverified one)
|
|
191
|
+
* Throws on a token that cannot be decoded (so a caller can distinguish a
|
|
192
|
+
* malformed token from a well-formed but unverified one), and when both
|
|
193
|
+
* `agentPublicKey` and `agentDidDocument` are given.
|
|
182
194
|
*/
|
|
183
195
|
export function verifyMandateToken(token, opts = {}) {
|
|
196
|
+
if (opts.agentPublicKey !== undefined && opts.agentDidDocument !== undefined) {
|
|
197
|
+
throw new TypeError("pass agentPublicKey or agentDidDocument, not both");
|
|
198
|
+
}
|
|
184
199
|
const decoded = decodeMandateToken(token);
|
|
185
200
|
if (!decoded.ok) {
|
|
186
201
|
throw new Error(`cannot decode mandate token: ${decoded.error}`);
|
|
@@ -188,14 +203,48 @@ export function verifyMandateToken(token, opts = {}) {
|
|
|
188
203
|
const t = decoded.token;
|
|
189
204
|
const m = t.mandate;
|
|
190
205
|
const signingString = reconstructSigningString(m);
|
|
191
|
-
const
|
|
206
|
+
const failures = [];
|
|
207
|
+
// The signed agent_kid names the key; the envelope kid is an unsigned copy
|
|
208
|
+
// and may not rename it.
|
|
209
|
+
const signedKid = typeof m.agent_kid === "string" ? m.agent_kid : undefined;
|
|
210
|
+
const kid = signedKid ?? t.kid;
|
|
211
|
+
const kidMismatch = signedKid !== undefined && t.kid !== undefined && t.kid !== signedKid;
|
|
192
212
|
const agentDid = kid ? agentDidFromKid(kid) : undefined;
|
|
193
|
-
|
|
213
|
+
let agentKey;
|
|
214
|
+
let kidMissing = false;
|
|
215
|
+
if (opts.agentDidDocument !== undefined) {
|
|
216
|
+
agentKey = kid ? keyForKid(opts.agentDidDocument, kid) : null;
|
|
217
|
+
kidMissing = agentKey === null;
|
|
218
|
+
}
|
|
219
|
+
else {
|
|
220
|
+
agentKey = toPubkey(opts.agentPublicKey);
|
|
221
|
+
}
|
|
222
|
+
let agent;
|
|
223
|
+
if (kidMismatch) {
|
|
224
|
+
failures.push("kid_mismatch");
|
|
225
|
+
agent = { present: Boolean(t.agent_sig), status: "failed", ...(kid ? { kid } : {}) };
|
|
226
|
+
}
|
|
227
|
+
else if (kidMissing && t.agent_sig) {
|
|
228
|
+
failures.push("kid_not_in_document");
|
|
229
|
+
agent = { present: true, status: "failed", ...(kid ? { kid } : {}) };
|
|
230
|
+
}
|
|
231
|
+
else {
|
|
232
|
+
agent = checkSignature(signingString, t.agent_sig, agentKey, kid);
|
|
233
|
+
if (agent.status !== "verified")
|
|
234
|
+
failures.push(failureFor("agent", agent.status));
|
|
235
|
+
}
|
|
194
236
|
const issuer = checkSignature(signingString, t.issuer_sig, toPubkey(opts.issuerPublicKey), undefined);
|
|
195
|
-
|
|
196
|
-
|
|
237
|
+
if (issuer.status !== "verified")
|
|
238
|
+
failures.push(failureFor("issuer", issuer.status));
|
|
239
|
+
const now = opts.now ?? Date.now() / 1000;
|
|
240
|
+
// The API refuses a mandate only once the clock is past expires_at.
|
|
241
|
+
const expired = now > m.expires_at;
|
|
242
|
+
if (expired)
|
|
243
|
+
failures.push("expired");
|
|
197
244
|
const result = {
|
|
198
|
-
verified:
|
|
245
|
+
verified: failures.length === 0,
|
|
246
|
+
failures,
|
|
247
|
+
expired,
|
|
199
248
|
mandate: m,
|
|
200
249
|
agent,
|
|
201
250
|
issuer,
|
|
@@ -204,8 +253,33 @@ export function verifyMandateToken(token, opts = {}) {
|
|
|
204
253
|
result.agentDid = agentDid;
|
|
205
254
|
if (kid)
|
|
206
255
|
result.kid = kid;
|
|
256
|
+
if (typeof m.issued_at === "number")
|
|
257
|
+
result.issuedAt = m.issued_at;
|
|
207
258
|
return result;
|
|
208
259
|
}
|
|
260
|
+
function failureFor(who, status) {
|
|
261
|
+
const suffix = status === "absent" ? "absent" : status === "skipped" ? "unchecked" : "invalid";
|
|
262
|
+
return `${who}_sig_${suffix}`;
|
|
263
|
+
}
|
|
264
|
+
/** The raw Ed25519 key a DID document publishes under exactly `kid`, or null. */
|
|
265
|
+
function keyForKid(doc, kid) {
|
|
266
|
+
if (!doc || typeof doc !== "object")
|
|
267
|
+
return null;
|
|
268
|
+
const methods = doc.verificationMethod;
|
|
269
|
+
if (!Array.isArray(methods))
|
|
270
|
+
return null;
|
|
271
|
+
for (const vm of methods) {
|
|
272
|
+
if (!vm || vm["id"] !== kid)
|
|
273
|
+
continue;
|
|
274
|
+
const jwk = vm["publicKeyJwk"];
|
|
275
|
+
if (!jwk || jwk["kty"] !== "OKP" || jwk["crv"] !== "Ed25519" || typeof jwk["x"] !== "string") {
|
|
276
|
+
return null;
|
|
277
|
+
}
|
|
278
|
+
const pub = Buffer.from(jwk["x"], "base64url");
|
|
279
|
+
return pub.length === 32 ? pub : null;
|
|
280
|
+
}
|
|
281
|
+
return null;
|
|
282
|
+
}
|
|
209
283
|
function checkSignature(signingString, sig, pub, kid) {
|
|
210
284
|
if (!sig)
|
|
211
285
|
return { present: false, status: "absent", ...(kid ? { kid } : {}) };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/mandate/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,OAAO,EAAE,eAAe,EAAE,MAAM,IAAI,UAAU,EAAkB,MAAM,aAAa,CAAC;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/mandate/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,OAAO,EAAE,eAAe,EAAE,MAAM,IAAI,UAAU,EAAkB,MAAM,aAAa,CAAC;AAgDpF;;;;;GAKG;AACH,MAAM,UAAU,kBAAkB,CAAC,KAAa;IAC9C,IAAI,GAAY,CAAC;IACjB,IAAI,CAAC;QACH,GAAG,GAAG,IAAI,CAAC,KAAK,CAAC,MAAM,CAAC,IAAI,CAAC,KAAK,EAAE,WAAW,CAAC,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAC,CAAC;IACrE,CAAC;IAAC,MAAM,CAAC;QACP,OAAO,EAAE,EAAE,EAAE,KAAK,EAAE,KAAK,EAAE,iBAAiB,EAAE,CAAC;IACjD,CAAC;IACD,IAAI,CAAC,GAAG,IAAI,OAAO,GAAG,KAAK,QAAQ,EAAE,CAAC;QACpC,OAAO,EAAE,EAAE,EAAE,KAAK,EAAE,KAAK,EAAE,iBAAiB,EAAE,CAAC;IACjD,CAAC;IAED,MAAM,CAAC,GAAG,GAA8B,CAAC;IACzC,MAAM,OAAO,GAAG,CAAC,CAAC,gBAAgB,CAAC,CAAC;I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