@openvtc/trust-tasks 0.24.1 → 0.25.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.
- package/CHANGELOG.md +95 -0
- package/dist/_shared/components.d.ts +55 -2
- package/dist/_shared/components.d.ts.map +1 -1
- package/dist/device/list/0.1/payload.d.ts +4 -4
- package/dist/device/list/0.1/payload.d.ts.map +1 -1
- package/dist/device/list/0.1/payload.js +4 -0
- package/dist/device/list/0.1/payload.js.map +1 -1
- package/dist/device/list/0.2/payload.d.ts +4 -4
- package/dist/device/list/0.2/payload.d.ts.map +1 -1
- package/dist/device/list/0.2/payload.js +4 -0
- package/dist/device/list/0.2/payload.js.map +1 -1
- package/dist/device/register/0.1/payload.d.ts +4 -4
- package/dist/device/register/0.1/payload.d.ts.map +1 -1
- package/dist/device/register/0.1/payload.js +4 -0
- package/dist/device/register/0.1/payload.js.map +1 -1
- package/dist/device/register/0.2/payload.d.ts +4 -4
- package/dist/device/register/0.2/payload.d.ts.map +1 -1
- package/dist/device/register/0.2/payload.js +4 -0
- package/dist/device/register/0.2/payload.js.map +1 -1
- package/dist/index.d.ts +2 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +2 -0
- package/dist/index.js.map +1 -1
- package/dist/keys/sign-csr/0.1/payload.d.ts +729 -0
- package/dist/keys/sign-csr/0.1/payload.d.ts.map +1 -0
- package/dist/keys/sign-csr/0.1/payload.js +280 -0
- package/dist/keys/sign-csr/0.1/payload.js.map +1 -0
- package/dist/keys/sign-jws/0.1/payload.d.ts +352 -0
- package/dist/keys/sign-jws/0.1/payload.d.ts.map +1 -0
- package/dist/keys/sign-jws/0.1/payload.js +207 -0
- package/dist/keys/sign-jws/0.1/payload.js.map +1 -0
- package/dist/rooms/_shared/0.1/blobs.d.ts +1 -1
- package/dist/rooms/_shared/0.1/blobs.d.ts.map +1 -1
- package/dist/rooms/info/0.1/payload.d.ts +2 -2
- package/dist/rooms/info/0.1/payload.js +2 -2
- package/dist/rooms/info/0.1/payload.js.map +1 -1
- package/dist/rooms/usage/0.1/payload.d.ts +2 -2
- package/dist/rooms/usage/0.1/payload.js +2 -2
- package/dist/rooms/usage/0.1/payload.js.map +1 -1
- package/package.json +1 -1
- package/src/_shared/components.ts +57 -0
- package/src/device/list/0.1/payload.ts +4 -0
- package/src/device/list/0.2/payload.ts +4 -0
- package/src/device/register/0.1/payload.ts +4 -0
- package/src/device/register/0.2/payload.ts +4 -0
- package/src/index.ts +2 -0
- package/src/keys/sign-csr/0.1/payload.ts +646 -0
- package/src/keys/sign-jws/0.1/payload.ts +271 -0
- package/src/rooms/_shared/0.1/blobs.ts +1 -1
- package/src/rooms/info/0.1/payload.ts +2 -2
- package/src/rooms/usage/0.1/payload.ts +2 -2
|
@@ -0,0 +1,646 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Generated by scripts/build-ts-bindings.mjs — DO NOT EDIT BY HAND.
|
|
3
|
+
* Source: specs/keys/sign-csr/0.1/payload.schema.json
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
import type { Ext } from "../../../_shared/components.js";
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
/**
|
|
10
|
+
* A request for a PKCS#10 certificate signing request (RFC 2986) for a key the custodian holds. The producer names the subject as structured attributes and optionally the subject alternative names; the custodian builds the CertificationRequestInfo itself from those and the key's own public key, and signs it. The outer document members (id, type, issuer, recipient, issuedAt, expiresAt, proof) are owned by the framework — SPEC §6.3.
|
|
11
|
+
*/
|
|
12
|
+
export interface KeysSignCSRPayload {
|
|
13
|
+
/**
|
|
14
|
+
* Identifier of the key the request is for, as `keys/show` describes it. Its public half becomes the request's subjectPublicKeyInfo and its private half signs the request. The key MUST be `active`, and `p256` or `ed25519`.
|
|
15
|
+
*/
|
|
16
|
+
keyId: string;
|
|
17
|
+
/**
|
|
18
|
+
* The subject distinguished name, one attribute per relative distinguished name, in the order of the encoded RDNSequence: element 0 is the first RDN in the DER, conventionally the country. That is the reverse of the RFC 4514 string form (`CN=…,O=…,C=…`). Never a raw DER or DN string.
|
|
19
|
+
*
|
|
20
|
+
* @minItems 1
|
|
21
|
+
* @maxItems 16
|
|
22
|
+
*/
|
|
23
|
+
subject:
|
|
24
|
+
| [RdnAttribute]
|
|
25
|
+
| [RdnAttribute, RdnAttribute]
|
|
26
|
+
| [RdnAttribute, RdnAttribute, RdnAttribute]
|
|
27
|
+
| [RdnAttribute, RdnAttribute, RdnAttribute, RdnAttribute]
|
|
28
|
+
| [RdnAttribute, RdnAttribute, RdnAttribute, RdnAttribute, RdnAttribute]
|
|
29
|
+
| [RdnAttribute, RdnAttribute, RdnAttribute, RdnAttribute, RdnAttribute, RdnAttribute]
|
|
30
|
+
| [RdnAttribute, RdnAttribute, RdnAttribute, RdnAttribute, RdnAttribute, RdnAttribute, RdnAttribute]
|
|
31
|
+
| [RdnAttribute, RdnAttribute, RdnAttribute, RdnAttribute, RdnAttribute, RdnAttribute, RdnAttribute, RdnAttribute]
|
|
32
|
+
| [
|
|
33
|
+
RdnAttribute,
|
|
34
|
+
RdnAttribute,
|
|
35
|
+
RdnAttribute,
|
|
36
|
+
RdnAttribute,
|
|
37
|
+
RdnAttribute,
|
|
38
|
+
RdnAttribute,
|
|
39
|
+
RdnAttribute,
|
|
40
|
+
RdnAttribute,
|
|
41
|
+
RdnAttribute
|
|
42
|
+
]
|
|
43
|
+
| [
|
|
44
|
+
RdnAttribute,
|
|
45
|
+
RdnAttribute,
|
|
46
|
+
RdnAttribute,
|
|
47
|
+
RdnAttribute,
|
|
48
|
+
RdnAttribute,
|
|
49
|
+
RdnAttribute,
|
|
50
|
+
RdnAttribute,
|
|
51
|
+
RdnAttribute,
|
|
52
|
+
RdnAttribute,
|
|
53
|
+
RdnAttribute
|
|
54
|
+
]
|
|
55
|
+
| [
|
|
56
|
+
RdnAttribute,
|
|
57
|
+
RdnAttribute,
|
|
58
|
+
RdnAttribute,
|
|
59
|
+
RdnAttribute,
|
|
60
|
+
RdnAttribute,
|
|
61
|
+
RdnAttribute,
|
|
62
|
+
RdnAttribute,
|
|
63
|
+
RdnAttribute,
|
|
64
|
+
RdnAttribute,
|
|
65
|
+
RdnAttribute,
|
|
66
|
+
RdnAttribute
|
|
67
|
+
]
|
|
68
|
+
| [
|
|
69
|
+
RdnAttribute,
|
|
70
|
+
RdnAttribute,
|
|
71
|
+
RdnAttribute,
|
|
72
|
+
RdnAttribute,
|
|
73
|
+
RdnAttribute,
|
|
74
|
+
RdnAttribute,
|
|
75
|
+
RdnAttribute,
|
|
76
|
+
RdnAttribute,
|
|
77
|
+
RdnAttribute,
|
|
78
|
+
RdnAttribute,
|
|
79
|
+
RdnAttribute,
|
|
80
|
+
RdnAttribute
|
|
81
|
+
]
|
|
82
|
+
| [
|
|
83
|
+
RdnAttribute,
|
|
84
|
+
RdnAttribute,
|
|
85
|
+
RdnAttribute,
|
|
86
|
+
RdnAttribute,
|
|
87
|
+
RdnAttribute,
|
|
88
|
+
RdnAttribute,
|
|
89
|
+
RdnAttribute,
|
|
90
|
+
RdnAttribute,
|
|
91
|
+
RdnAttribute,
|
|
92
|
+
RdnAttribute,
|
|
93
|
+
RdnAttribute,
|
|
94
|
+
RdnAttribute,
|
|
95
|
+
RdnAttribute
|
|
96
|
+
]
|
|
97
|
+
| [
|
|
98
|
+
RdnAttribute,
|
|
99
|
+
RdnAttribute,
|
|
100
|
+
RdnAttribute,
|
|
101
|
+
RdnAttribute,
|
|
102
|
+
RdnAttribute,
|
|
103
|
+
RdnAttribute,
|
|
104
|
+
RdnAttribute,
|
|
105
|
+
RdnAttribute,
|
|
106
|
+
RdnAttribute,
|
|
107
|
+
RdnAttribute,
|
|
108
|
+
RdnAttribute,
|
|
109
|
+
RdnAttribute,
|
|
110
|
+
RdnAttribute,
|
|
111
|
+
RdnAttribute
|
|
112
|
+
]
|
|
113
|
+
| [
|
|
114
|
+
RdnAttribute,
|
|
115
|
+
RdnAttribute,
|
|
116
|
+
RdnAttribute,
|
|
117
|
+
RdnAttribute,
|
|
118
|
+
RdnAttribute,
|
|
119
|
+
RdnAttribute,
|
|
120
|
+
RdnAttribute,
|
|
121
|
+
RdnAttribute,
|
|
122
|
+
RdnAttribute,
|
|
123
|
+
RdnAttribute,
|
|
124
|
+
RdnAttribute,
|
|
125
|
+
RdnAttribute,
|
|
126
|
+
RdnAttribute,
|
|
127
|
+
RdnAttribute,
|
|
128
|
+
RdnAttribute
|
|
129
|
+
]
|
|
130
|
+
| [
|
|
131
|
+
RdnAttribute,
|
|
132
|
+
RdnAttribute,
|
|
133
|
+
RdnAttribute,
|
|
134
|
+
RdnAttribute,
|
|
135
|
+
RdnAttribute,
|
|
136
|
+
RdnAttribute,
|
|
137
|
+
RdnAttribute,
|
|
138
|
+
RdnAttribute,
|
|
139
|
+
RdnAttribute,
|
|
140
|
+
RdnAttribute,
|
|
141
|
+
RdnAttribute,
|
|
142
|
+
RdnAttribute,
|
|
143
|
+
RdnAttribute,
|
|
144
|
+
RdnAttribute,
|
|
145
|
+
RdnAttribute,
|
|
146
|
+
RdnAttribute
|
|
147
|
+
];
|
|
148
|
+
/**
|
|
149
|
+
* Subject alternative names to request. When present, the custodian adds a non-critical subjectAltName extension to the request's extensionRequest attribute — the only extension this task ever requests.
|
|
150
|
+
*/
|
|
151
|
+
subjectAltNames?: {
|
|
152
|
+
/**
|
|
153
|
+
* dNSName entries: host names in LDH form (an internationalised name as its A-label). No wildcards.
|
|
154
|
+
*
|
|
155
|
+
* @minItems 1
|
|
156
|
+
* @maxItems 16
|
|
157
|
+
*/
|
|
158
|
+
dns?:
|
|
159
|
+
| [string]
|
|
160
|
+
| [string, string]
|
|
161
|
+
| [string, string, string]
|
|
162
|
+
| [string, string, string, string]
|
|
163
|
+
| [string, string, string, string, string]
|
|
164
|
+
| [string, string, string, string, string, string]
|
|
165
|
+
| [string, string, string, string, string, string, string]
|
|
166
|
+
| [string, string, string, string, string, string, string, string]
|
|
167
|
+
| [string, string, string, string, string, string, string, string, string]
|
|
168
|
+
| [string, string, string, string, string, string, string, string, string, string]
|
|
169
|
+
| [string, string, string, string, string, string, string, string, string, string, string]
|
|
170
|
+
| [string, string, string, string, string, string, string, string, string, string, string, string]
|
|
171
|
+
| [string, string, string, string, string, string, string, string, string, string, string, string, string]
|
|
172
|
+
| [string, string, string, string, string, string, string, string, string, string, string, string, string, string]
|
|
173
|
+
| [
|
|
174
|
+
string,
|
|
175
|
+
string,
|
|
176
|
+
string,
|
|
177
|
+
string,
|
|
178
|
+
string,
|
|
179
|
+
string,
|
|
180
|
+
string,
|
|
181
|
+
string,
|
|
182
|
+
string,
|
|
183
|
+
string,
|
|
184
|
+
string,
|
|
185
|
+
string,
|
|
186
|
+
string,
|
|
187
|
+
string,
|
|
188
|
+
string
|
|
189
|
+
]
|
|
190
|
+
| [
|
|
191
|
+
string,
|
|
192
|
+
string,
|
|
193
|
+
string,
|
|
194
|
+
string,
|
|
195
|
+
string,
|
|
196
|
+
string,
|
|
197
|
+
string,
|
|
198
|
+
string,
|
|
199
|
+
string,
|
|
200
|
+
string,
|
|
201
|
+
string,
|
|
202
|
+
string,
|
|
203
|
+
string,
|
|
204
|
+
string,
|
|
205
|
+
string,
|
|
206
|
+
string
|
|
207
|
+
];
|
|
208
|
+
/**
|
|
209
|
+
* uniformResourceIdentifier entries: absolute URIs, printable ASCII without spaces.
|
|
210
|
+
*
|
|
211
|
+
* @minItems 1
|
|
212
|
+
* @maxItems 16
|
|
213
|
+
*/
|
|
214
|
+
uri?:
|
|
215
|
+
| [string]
|
|
216
|
+
| [string, string]
|
|
217
|
+
| [string, string, string]
|
|
218
|
+
| [string, string, string, string]
|
|
219
|
+
| [string, string, string, string, string]
|
|
220
|
+
| [string, string, string, string, string, string]
|
|
221
|
+
| [string, string, string, string, string, string, string]
|
|
222
|
+
| [string, string, string, string, string, string, string, string]
|
|
223
|
+
| [string, string, string, string, string, string, string, string, string]
|
|
224
|
+
| [string, string, string, string, string, string, string, string, string, string]
|
|
225
|
+
| [string, string, string, string, string, string, string, string, string, string, string]
|
|
226
|
+
| [string, string, string, string, string, string, string, string, string, string, string, string]
|
|
227
|
+
| [string, string, string, string, string, string, string, string, string, string, string, string, string]
|
|
228
|
+
| [string, string, string, string, string, string, string, string, string, string, string, string, string, string]
|
|
229
|
+
| [
|
|
230
|
+
string,
|
|
231
|
+
string,
|
|
232
|
+
string,
|
|
233
|
+
string,
|
|
234
|
+
string,
|
|
235
|
+
string,
|
|
236
|
+
string,
|
|
237
|
+
string,
|
|
238
|
+
string,
|
|
239
|
+
string,
|
|
240
|
+
string,
|
|
241
|
+
string,
|
|
242
|
+
string,
|
|
243
|
+
string,
|
|
244
|
+
string
|
|
245
|
+
]
|
|
246
|
+
| [
|
|
247
|
+
string,
|
|
248
|
+
string,
|
|
249
|
+
string,
|
|
250
|
+
string,
|
|
251
|
+
string,
|
|
252
|
+
string,
|
|
253
|
+
string,
|
|
254
|
+
string,
|
|
255
|
+
string,
|
|
256
|
+
string,
|
|
257
|
+
string,
|
|
258
|
+
string,
|
|
259
|
+
string,
|
|
260
|
+
string,
|
|
261
|
+
string,
|
|
262
|
+
string
|
|
263
|
+
];
|
|
264
|
+
/**
|
|
265
|
+
* rfc822Name entries: ASCII mailbox addresses.
|
|
266
|
+
*
|
|
267
|
+
* @minItems 1
|
|
268
|
+
* @maxItems 16
|
|
269
|
+
*/
|
|
270
|
+
email?:
|
|
271
|
+
| [string]
|
|
272
|
+
| [string, string]
|
|
273
|
+
| [string, string, string]
|
|
274
|
+
| [string, string, string, string]
|
|
275
|
+
| [string, string, string, string, string]
|
|
276
|
+
| [string, string, string, string, string, string]
|
|
277
|
+
| [string, string, string, string, string, string, string]
|
|
278
|
+
| [string, string, string, string, string, string, string, string]
|
|
279
|
+
| [string, string, string, string, string, string, string, string, string]
|
|
280
|
+
| [string, string, string, string, string, string, string, string, string, string]
|
|
281
|
+
| [string, string, string, string, string, string, string, string, string, string, string]
|
|
282
|
+
| [string, string, string, string, string, string, string, string, string, string, string, string]
|
|
283
|
+
| [string, string, string, string, string, string, string, string, string, string, string, string, string]
|
|
284
|
+
| [string, string, string, string, string, string, string, string, string, string, string, string, string, string]
|
|
285
|
+
| [
|
|
286
|
+
string,
|
|
287
|
+
string,
|
|
288
|
+
string,
|
|
289
|
+
string,
|
|
290
|
+
string,
|
|
291
|
+
string,
|
|
292
|
+
string,
|
|
293
|
+
string,
|
|
294
|
+
string,
|
|
295
|
+
string,
|
|
296
|
+
string,
|
|
297
|
+
string,
|
|
298
|
+
string,
|
|
299
|
+
string,
|
|
300
|
+
string
|
|
301
|
+
]
|
|
302
|
+
| [
|
|
303
|
+
string,
|
|
304
|
+
string,
|
|
305
|
+
string,
|
|
306
|
+
string,
|
|
307
|
+
string,
|
|
308
|
+
string,
|
|
309
|
+
string,
|
|
310
|
+
string,
|
|
311
|
+
string,
|
|
312
|
+
string,
|
|
313
|
+
string,
|
|
314
|
+
string,
|
|
315
|
+
string,
|
|
316
|
+
string,
|
|
317
|
+
string,
|
|
318
|
+
string
|
|
319
|
+
];
|
|
320
|
+
};
|
|
321
|
+
/**
|
|
322
|
+
* Ecosystem-defined extension members per SPEC.md §4.5.1.
|
|
323
|
+
*/
|
|
324
|
+
ext?: Ext;
|
|
325
|
+
}
|
|
326
|
+
/**
|
|
327
|
+
* One attribute of the subject distinguished name, encoded as a single-valued RDN.
|
|
328
|
+
*/
|
|
329
|
+
export interface RdnAttribute {
|
|
330
|
+
/**
|
|
331
|
+
* The attribute type, by its X.520 / PKCS #9 short name (externally owned, carried verbatim): `CN` commonName (2.5.4.3), `O` organizationName (2.5.4.10), `OU` organizationalUnitName (2.5.4.11), `C` countryName (2.5.4.6), `L` localityName (2.5.4.7), `ST` stateOrProvinceName (2.5.4.8), `organizationIdentifier` (2.5.4.97), `serialNumber` (2.5.4.5), `emailAddress` (1.2.840.113549.1.9.1). Closed: an attribute outside the set is refused, never passed through by OID.
|
|
332
|
+
*/
|
|
333
|
+
type: "CN" | "O" | "OU" | "C" | "L" | "ST" | "organizationIdentifier" | "serialNumber" | "emailAddress";
|
|
334
|
+
/**
|
|
335
|
+
* The attribute value as text. The custodian encodes it without normalising, trimming or re-casing it, and checks the per-type rules of the specification (character set and length), refusing a value that breaks them with `keys/sign-csr:subjectInvalid`.
|
|
336
|
+
*/
|
|
337
|
+
value: string;
|
|
338
|
+
}
|
|
339
|
+
/**
|
|
340
|
+
* The success response to a keys/sign-csr request. Carried in a Trust Task document whose type is https://trusttasks.org/spec/keys/sign-csr/0.1#response. Failures use trust-task-error, not this shape.
|
|
341
|
+
*/
|
|
342
|
+
export interface KeysSignCSRResponsePayload {
|
|
343
|
+
/**
|
|
344
|
+
* The key the request is for. Echoed so a response separated from its request is still attributable.
|
|
345
|
+
*/
|
|
346
|
+
keyId: string;
|
|
347
|
+
/**
|
|
348
|
+
* The PKCS#10 CertificationRequest, DER-encoded and armoured as RFC 7468 `CERTIFICATE REQUEST` text: base64 in lines of 64 characters, LF line endings.
|
|
349
|
+
*/
|
|
350
|
+
csr: string;
|
|
351
|
+
/**
|
|
352
|
+
* The key's public half, multibase-encoded exactly as `KeyRecord.publicKey` carries it, so the producer can confirm the request is for the key it meant without parsing the DER.
|
|
353
|
+
*/
|
|
354
|
+
publicKey: string;
|
|
355
|
+
ext?: Ext;
|
|
356
|
+
}
|
|
357
|
+
|
|
358
|
+
/** Shared definitions this specification references, re-exported under the names it used to declare them with. */
|
|
359
|
+
export type { Ext };
|
|
360
|
+
|
|
361
|
+
/** Trust Task type URI. */
|
|
362
|
+
export const TYPE_URI = "https://trusttasks.org/spec/keys/sign-csr/0.1" as const;
|
|
363
|
+
|
|
364
|
+
/** Stable alias for this specification's request payload shape. */
|
|
365
|
+
export type Payload = KeysSignCSRPayload;
|
|
366
|
+
|
|
367
|
+
/** Trust Task response type URI (request type URI + "#response"). */
|
|
368
|
+
export const RESPONSE_TYPE_URI = "https://trusttasks.org/spec/keys/sign-csr/0.1#response" as const;
|
|
369
|
+
|
|
370
|
+
/** Stable alias for this specification's success-response payload shape. */
|
|
371
|
+
export type Response = KeysSignCSRResponsePayload;
|
|
372
|
+
|
|
373
|
+
/**
|
|
374
|
+
* This specification's payload schema, as a value.
|
|
375
|
+
*
|
|
376
|
+
* SPEC.md §7.2 item 2 is performed against this. It is shipped as data
|
|
377
|
+
* rather than only as a `.json` file because TypeScript types are erased
|
|
378
|
+
* at runtime: without a schema a consumer has nothing to validate, and
|
|
379
|
+
* every REQUIRED payload member is optional in practice. Cross-file
|
|
380
|
+
* `$ref`s are already inlined, so it needs no resolver.
|
|
381
|
+
*/
|
|
382
|
+
export const PAYLOAD_SCHEMA = {
|
|
383
|
+
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
384
|
+
"$id": "https://trusttasks.org/spec/keys/sign-csr/0.1",
|
|
385
|
+
"title": "Keys — Sign CSR — payload",
|
|
386
|
+
"description": "A request for a PKCS#10 certificate signing request (RFC 2986) for a key the custodian holds. The producer names the subject as structured attributes and optionally the subject alternative names; the custodian builds the CertificationRequestInfo itself from those and the key's own public key, and signs it. The outer document members (id, type, issuer, recipient, issuedAt, expiresAt, proof) are owned by the framework — SPEC §6.3.",
|
|
387
|
+
"type": "object",
|
|
388
|
+
"additionalProperties": false,
|
|
389
|
+
"required": [
|
|
390
|
+
"keyId",
|
|
391
|
+
"subject"
|
|
392
|
+
],
|
|
393
|
+
"properties": {
|
|
394
|
+
"keyId": {
|
|
395
|
+
"type": "string",
|
|
396
|
+
"minLength": 1,
|
|
397
|
+
"description": "Identifier of the key the request is for, as `keys/show` describes it. Its public half becomes the request's subjectPublicKeyInfo and its private half signs the request. The key MUST be `active`, and `p256` or `ed25519`."
|
|
398
|
+
},
|
|
399
|
+
"subject": {
|
|
400
|
+
"type": "array",
|
|
401
|
+
"minItems": 1,
|
|
402
|
+
"maxItems": 16,
|
|
403
|
+
"items": {
|
|
404
|
+
"$ref": "#/$defs/RdnAttribute"
|
|
405
|
+
},
|
|
406
|
+
"description": "The subject distinguished name, one attribute per relative distinguished name, in the order of the encoded RDNSequence: element 0 is the first RDN in the DER, conventionally the country. That is the reverse of the RFC 4514 string form (`CN=…,O=…,C=…`). Never a raw DER or DN string."
|
|
407
|
+
},
|
|
408
|
+
"subjectAltNames": {
|
|
409
|
+
"type": "object",
|
|
410
|
+
"additionalProperties": false,
|
|
411
|
+
"minProperties": 1,
|
|
412
|
+
"description": "Subject alternative names to request. When present, the custodian adds a non-critical subjectAltName extension to the request's extensionRequest attribute — the only extension this task ever requests.",
|
|
413
|
+
"properties": {
|
|
414
|
+
"dns": {
|
|
415
|
+
"type": "array",
|
|
416
|
+
"minItems": 1,
|
|
417
|
+
"maxItems": 16,
|
|
418
|
+
"items": {
|
|
419
|
+
"type": "string",
|
|
420
|
+
"minLength": 1,
|
|
421
|
+
"maxLength": 253,
|
|
422
|
+
"pattern": "^([A-Za-z0-9]([A-Za-z0-9-]{0,61}[A-Za-z0-9])?\\.)*[A-Za-z0-9]([A-Za-z0-9-]{0,61}[A-Za-z0-9])?$"
|
|
423
|
+
},
|
|
424
|
+
"description": "dNSName entries: host names in LDH form (an internationalised name as its A-label). No wildcards."
|
|
425
|
+
},
|
|
426
|
+
"uri": {
|
|
427
|
+
"type": "array",
|
|
428
|
+
"minItems": 1,
|
|
429
|
+
"maxItems": 16,
|
|
430
|
+
"items": {
|
|
431
|
+
"type": "string",
|
|
432
|
+
"minLength": 3,
|
|
433
|
+
"maxLength": 2048,
|
|
434
|
+
"pattern": "^[A-Za-z][A-Za-z0-9+.-]*:[!-~]+$"
|
|
435
|
+
},
|
|
436
|
+
"description": "uniformResourceIdentifier entries: absolute URIs, printable ASCII without spaces."
|
|
437
|
+
},
|
|
438
|
+
"email": {
|
|
439
|
+
"type": "array",
|
|
440
|
+
"minItems": 1,
|
|
441
|
+
"maxItems": 16,
|
|
442
|
+
"items": {
|
|
443
|
+
"type": "string",
|
|
444
|
+
"minLength": 3,
|
|
445
|
+
"maxLength": 255,
|
|
446
|
+
"pattern": "^[!-?A-~]+@[A-Za-z0-9.-]+$"
|
|
447
|
+
},
|
|
448
|
+
"description": "rfc822Name entries: ASCII mailbox addresses."
|
|
449
|
+
}
|
|
450
|
+
}
|
|
451
|
+
},
|
|
452
|
+
"ext": {
|
|
453
|
+
"$ref": "#/$defs/Ext",
|
|
454
|
+
"description": "Ecosystem-defined extension members per SPEC.md §4.5.1."
|
|
455
|
+
}
|
|
456
|
+
},
|
|
457
|
+
"$defs": {
|
|
458
|
+
"RdnAttribute": {
|
|
459
|
+
"title": "RdnAttribute",
|
|
460
|
+
"type": "object",
|
|
461
|
+
"additionalProperties": false,
|
|
462
|
+
"required": [
|
|
463
|
+
"type",
|
|
464
|
+
"value"
|
|
465
|
+
],
|
|
466
|
+
"description": "One attribute of the subject distinguished name, encoded as a single-valued RDN.",
|
|
467
|
+
"properties": {
|
|
468
|
+
"type": {
|
|
469
|
+
"type": "string",
|
|
470
|
+
"enum": [
|
|
471
|
+
"CN",
|
|
472
|
+
"O",
|
|
473
|
+
"OU",
|
|
474
|
+
"C",
|
|
475
|
+
"L",
|
|
476
|
+
"ST",
|
|
477
|
+
"organizationIdentifier",
|
|
478
|
+
"serialNumber",
|
|
479
|
+
"emailAddress"
|
|
480
|
+
],
|
|
481
|
+
"description": "The attribute type, by its X.520 / PKCS #9 short name (externally owned, carried verbatim): `CN` commonName (2.5.4.3), `O` organizationName (2.5.4.10), `OU` organizationalUnitName (2.5.4.11), `C` countryName (2.5.4.6), `L` localityName (2.5.4.7), `ST` stateOrProvinceName (2.5.4.8), `organizationIdentifier` (2.5.4.97), `serialNumber` (2.5.4.5), `emailAddress` (1.2.840.113549.1.9.1). Closed: an attribute outside the set is refused, never passed through by OID."
|
|
482
|
+
},
|
|
483
|
+
"value": {
|
|
484
|
+
"type": "string",
|
|
485
|
+
"minLength": 1,
|
|
486
|
+
"maxLength": 255,
|
|
487
|
+
"description": "The attribute value as text. The custodian encodes it without normalising, trimming or re-casing it, and checks the per-type rules of the specification (character set and length), refusing a value that breaks them with `keys/sign-csr:subjectInvalid`."
|
|
488
|
+
}
|
|
489
|
+
}
|
|
490
|
+
},
|
|
491
|
+
"Response": {
|
|
492
|
+
"$anchor": "response",
|
|
493
|
+
"title": "Keys — Sign CSR — response payload",
|
|
494
|
+
"description": "The success response to a keys/sign-csr request. Carried in a Trust Task document whose type is https://trusttasks.org/spec/keys/sign-csr/0.1#response. Failures use trust-task-error, not this shape.",
|
|
495
|
+
"type": "object",
|
|
496
|
+
"additionalProperties": false,
|
|
497
|
+
"required": [
|
|
498
|
+
"keyId",
|
|
499
|
+
"csr",
|
|
500
|
+
"publicKey"
|
|
501
|
+
],
|
|
502
|
+
"properties": {
|
|
503
|
+
"keyId": {
|
|
504
|
+
"type": "string",
|
|
505
|
+
"description": "The key the request is for. Echoed so a response separated from its request is still attributable."
|
|
506
|
+
},
|
|
507
|
+
"csr": {
|
|
508
|
+
"type": "string",
|
|
509
|
+
"maxLength": 16384,
|
|
510
|
+
"pattern": "^-----BEGIN CERTIFICATE REQUEST-----\\n[A-Za-z0-9+/=\\n]+-----END CERTIFICATE REQUEST-----\\n?$",
|
|
511
|
+
"description": "The PKCS#10 CertificationRequest, DER-encoded and armoured as RFC 7468 `CERTIFICATE REQUEST` text: base64 in lines of 64 characters, LF line endings."
|
|
512
|
+
},
|
|
513
|
+
"publicKey": {
|
|
514
|
+
"type": "string",
|
|
515
|
+
"minLength": 1,
|
|
516
|
+
"description": "The key's public half, multibase-encoded exactly as `KeyRecord.publicKey` carries it, so the producer can confirm the request is for the key it meant without parsing the DER."
|
|
517
|
+
},
|
|
518
|
+
"ext": {
|
|
519
|
+
"$ref": "#/$defs/Ext"
|
|
520
|
+
}
|
|
521
|
+
}
|
|
522
|
+
},
|
|
523
|
+
"Ext": {
|
|
524
|
+
"title": "Ext",
|
|
525
|
+
"description": "Vendor-namespaced extension object per SPEC.md §4.5.1. Each immediate key MUST be a reverse-DNS namespace; structure under each namespace is opaque to the framework.",
|
|
526
|
+
"type": "object",
|
|
527
|
+
"minProperties": 1,
|
|
528
|
+
"additionalProperties": true,
|
|
529
|
+
"propertyNames": {
|
|
530
|
+
"pattern": "^[a-z][a-z0-9-]*(\\.[a-z0-9-]+)+$"
|
|
531
|
+
}
|
|
532
|
+
}
|
|
533
|
+
}
|
|
534
|
+
} as const;
|
|
535
|
+
|
|
536
|
+
/** As {@link PAYLOAD_SCHEMA}, for the success-response variant. */
|
|
537
|
+
export const RESPONSE_PAYLOAD_SCHEMA = {
|
|
538
|
+
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
539
|
+
"$ref": "#/$defs/Response",
|
|
540
|
+
"$defs": {
|
|
541
|
+
"RdnAttribute": {
|
|
542
|
+
"title": "RdnAttribute",
|
|
543
|
+
"type": "object",
|
|
544
|
+
"additionalProperties": false,
|
|
545
|
+
"required": [
|
|
546
|
+
"type",
|
|
547
|
+
"value"
|
|
548
|
+
],
|
|
549
|
+
"description": "One attribute of the subject distinguished name, encoded as a single-valued RDN.",
|
|
550
|
+
"properties": {
|
|
551
|
+
"type": {
|
|
552
|
+
"type": "string",
|
|
553
|
+
"enum": [
|
|
554
|
+
"CN",
|
|
555
|
+
"O",
|
|
556
|
+
"OU",
|
|
557
|
+
"C",
|
|
558
|
+
"L",
|
|
559
|
+
"ST",
|
|
560
|
+
"organizationIdentifier",
|
|
561
|
+
"serialNumber",
|
|
562
|
+
"emailAddress"
|
|
563
|
+
],
|
|
564
|
+
"description": "The attribute type, by its X.520 / PKCS #9 short name (externally owned, carried verbatim): `CN` commonName (2.5.4.3), `O` organizationName (2.5.4.10), `OU` organizationalUnitName (2.5.4.11), `C` countryName (2.5.4.6), `L` localityName (2.5.4.7), `ST` stateOrProvinceName (2.5.4.8), `organizationIdentifier` (2.5.4.97), `serialNumber` (2.5.4.5), `emailAddress` (1.2.840.113549.1.9.1). Closed: an attribute outside the set is refused, never passed through by OID."
|
|
565
|
+
},
|
|
566
|
+
"value": {
|
|
567
|
+
"type": "string",
|
|
568
|
+
"minLength": 1,
|
|
569
|
+
"maxLength": 255,
|
|
570
|
+
"description": "The attribute value as text. The custodian encodes it without normalising, trimming or re-casing it, and checks the per-type rules of the specification (character set and length), refusing a value that breaks them with `keys/sign-csr:subjectInvalid`."
|
|
571
|
+
}
|
|
572
|
+
}
|
|
573
|
+
},
|
|
574
|
+
"Response": {
|
|
575
|
+
"$anchor": "response",
|
|
576
|
+
"title": "Keys — Sign CSR — response payload",
|
|
577
|
+
"description": "The success response to a keys/sign-csr request. Carried in a Trust Task document whose type is https://trusttasks.org/spec/keys/sign-csr/0.1#response. Failures use trust-task-error, not this shape.",
|
|
578
|
+
"type": "object",
|
|
579
|
+
"additionalProperties": false,
|
|
580
|
+
"required": [
|
|
581
|
+
"keyId",
|
|
582
|
+
"csr",
|
|
583
|
+
"publicKey"
|
|
584
|
+
],
|
|
585
|
+
"properties": {
|
|
586
|
+
"keyId": {
|
|
587
|
+
"type": "string",
|
|
588
|
+
"description": "The key the request is for. Echoed so a response separated from its request is still attributable."
|
|
589
|
+
},
|
|
590
|
+
"csr": {
|
|
591
|
+
"type": "string",
|
|
592
|
+
"maxLength": 16384,
|
|
593
|
+
"pattern": "^-----BEGIN CERTIFICATE REQUEST-----\\n[A-Za-z0-9+/=\\n]+-----END CERTIFICATE REQUEST-----\\n?$",
|
|
594
|
+
"description": "The PKCS#10 CertificationRequest, DER-encoded and armoured as RFC 7468 `CERTIFICATE REQUEST` text: base64 in lines of 64 characters, LF line endings."
|
|
595
|
+
},
|
|
596
|
+
"publicKey": {
|
|
597
|
+
"type": "string",
|
|
598
|
+
"minLength": 1,
|
|
599
|
+
"description": "The key's public half, multibase-encoded exactly as `KeyRecord.publicKey` carries it, so the producer can confirm the request is for the key it meant without parsing the DER."
|
|
600
|
+
},
|
|
601
|
+
"ext": {
|
|
602
|
+
"$ref": "#/$defs/Ext"
|
|
603
|
+
}
|
|
604
|
+
}
|
|
605
|
+
},
|
|
606
|
+
"Ext": {
|
|
607
|
+
"title": "Ext",
|
|
608
|
+
"description": "Vendor-namespaced extension object per SPEC.md §4.5.1. Each immediate key MUST be a reverse-DNS namespace; structure under each namespace is opaque to the framework.",
|
|
609
|
+
"type": "object",
|
|
610
|
+
"minProperties": 1,
|
|
611
|
+
"additionalProperties": true,
|
|
612
|
+
"propertyNames": {
|
|
613
|
+
"pattern": "^[a-z][a-z0-9-]*(\\.[a-z0-9-]+)+$"
|
|
614
|
+
}
|
|
615
|
+
}
|
|
616
|
+
}
|
|
617
|
+
} as const;
|
|
618
|
+
|
|
619
|
+
/**
|
|
620
|
+
* SPEC.md §7.2 policy for the request variant, from this specification's
|
|
621
|
+
* front matter. Pass to `consumeInbound` — items 5b, 7 and 8 are
|
|
622
|
+
* per-specification and cannot be derived from the document alone, and
|
|
623
|
+
* item 2 needs the schema this carries.
|
|
624
|
+
*/
|
|
625
|
+
export const SPEC = {
|
|
626
|
+
typeUri: TYPE_URI,
|
|
627
|
+
isBearer: false,
|
|
628
|
+
isProofRequired: true,
|
|
629
|
+
isRecipientRequired: true,
|
|
630
|
+
isIssuedAtRequired: true,
|
|
631
|
+
payloadSchema: PAYLOAD_SCHEMA,
|
|
632
|
+
} as const;
|
|
633
|
+
|
|
634
|
+
/**
|
|
635
|
+
* SPEC.md §7.2 policy for the success-response variant. `isRecipientRequired`
|
|
636
|
+
* tracks the *issuer* party's requirement because a response swaps the
|
|
637
|
+
* parties (§7.3 item 5).
|
|
638
|
+
*/
|
|
639
|
+
export const RESPONSE_SPEC = {
|
|
640
|
+
typeUri: RESPONSE_TYPE_URI,
|
|
641
|
+
isBearer: false,
|
|
642
|
+
isProofRequired: false,
|
|
643
|
+
isRecipientRequired: true,
|
|
644
|
+
isIssuedAtRequired: true,
|
|
645
|
+
payloadSchema: RESPONSE_PAYLOAD_SCHEMA,
|
|
646
|
+
} as const;
|