@owf/mdoc 0.6.0-alpha-20260225221529
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/LICENSE +176 -0
- package/README.md +47 -0
- package/dist/index.d.mts +1928 -0
- package/dist/index.mjs +3499 -0
- package/dist/index.mjs.map +1 -0
- package/package.json +63 -0
package/dist/index.d.mts
ADDED
|
@@ -0,0 +1,1928 @@
|
|
|
1
|
+
import { Options } from "cbor-x";
|
|
2
|
+
import z$1, { z } from "zod";
|
|
3
|
+
|
|
4
|
+
//#region src/cbor/cbor-structure.d.ts
|
|
5
|
+
type CborEncodeOptions = {
|
|
6
|
+
asDataItem?: boolean;
|
|
7
|
+
};
|
|
8
|
+
type AnyCborStructure = CborStructure<any, any>;
|
|
9
|
+
type EncodedStructureType<T> = T extends CborStructure<infer EncodedStructure, unknown> ? EncodedStructure : any;
|
|
10
|
+
type DecodedStructureType<T> = T extends CborStructure<unknown, infer DecodedStructure> ? DecodedStructure : any;
|
|
11
|
+
type CborStructureStaticThis<T extends AnyCborStructure> = {
|
|
12
|
+
new (structure: any): T;
|
|
13
|
+
encodingSchema: z.ZodType<any, any, any> | undefined;
|
|
14
|
+
fromEncodedStructure: (encodedStructure: EncodedStructureType<T>) => {
|
|
15
|
+
decodedStructure: DecodedStructureType<T>;
|
|
16
|
+
};
|
|
17
|
+
};
|
|
18
|
+
declare class CborStructure<EncodedStructure = unknown, DecodedStructure = EncodedStructure> {
|
|
19
|
+
protected structure: DecodedStructure;
|
|
20
|
+
constructor(structure: DecodedStructure);
|
|
21
|
+
get decodedStructure(): DecodedStructure;
|
|
22
|
+
/**
|
|
23
|
+
* Static getter for the Zod codec schema that defines the CBOR structure.
|
|
24
|
+
* Subclasses CAN override this to provide their specific schema for automatic encoding/decoding.
|
|
25
|
+
* The schema should be a Zod schema or codec that handles validation and transformation.
|
|
26
|
+
* If not provided, subclasses must override encode(), decode(), and fromEncodedStructure().
|
|
27
|
+
*/
|
|
28
|
+
static get encodingSchema(): z.ZodType | undefined;
|
|
29
|
+
/**
|
|
30
|
+
* Returns the encoded structure that will be serialized to CBOR.
|
|
31
|
+
* By default, returns the protected structure property.
|
|
32
|
+
* Override if custom encoding logic is needed.
|
|
33
|
+
*/
|
|
34
|
+
get encodedStructure(): EncodedStructure;
|
|
35
|
+
/**
|
|
36
|
+
* Encodes this structure to CBOR bytes.
|
|
37
|
+
*/
|
|
38
|
+
encode(options?: CborEncodeOptions): Uint8Array;
|
|
39
|
+
/**
|
|
40
|
+
* Decodes CBOR bytes into a structure instance.
|
|
41
|
+
* Uses the encodingSchema's decode() method to validate and transform the decoded data.
|
|
42
|
+
*/
|
|
43
|
+
static decode<T extends AnyCborStructure>(this: CborStructureStaticThis<T>, bytes: Uint8Array): T;
|
|
44
|
+
/**
|
|
45
|
+
* Creates a structure instance from the encoded CBOR structure (after calling cborDecode).
|
|
46
|
+
*
|
|
47
|
+
* Uses the encodingSchema's decode() method to validate and transform the structure if available.
|
|
48
|
+
* Otherwise, subclasses must override this method.
|
|
49
|
+
*/
|
|
50
|
+
static fromEncodedStructure<T extends AnyCborStructure>(this: CborStructureStaticThis<T>, encodedStructure: EncodedStructureType<T>): T;
|
|
51
|
+
static fromDataItem<T extends AnyCborStructure>(this: CborStructureStaticThis<T>, dataItem: unknown): T;
|
|
52
|
+
/**
|
|
53
|
+
* Creates a structure instance from the decoded structure.
|
|
54
|
+
*
|
|
55
|
+
* Uses the encodingSchema's parse method to validate the structure if available.
|
|
56
|
+
* Otherwise, subclasses must override this method.
|
|
57
|
+
*/
|
|
58
|
+
static fromDecodedStructure<T extends AnyCborStructure>(this: CborStructureStaticThis<T>, decodedStructure: DecodedStructureType<T>): T;
|
|
59
|
+
}
|
|
60
|
+
//#endregion
|
|
61
|
+
//#region src/cbor/data-item.d.ts
|
|
62
|
+
type DataItemOptions<T = unknown> = {
|
|
63
|
+
data: T;
|
|
64
|
+
buffer: Uint8Array;
|
|
65
|
+
} | {
|
|
66
|
+
data: T;
|
|
67
|
+
} | {
|
|
68
|
+
buffer: Uint8Array;
|
|
69
|
+
};
|
|
70
|
+
/**
|
|
71
|
+
* DataItem is an extension defined https://www.rfc-editor.org/rfc/rfc8949.html#name-encoded-cbor-data-item
|
|
72
|
+
* > Sometimes it is beneficial to carry an embedded CBOR data item that is
|
|
73
|
+
* > not meant to be decoded immediately at the time the enclosing data item is being decoded.
|
|
74
|
+
*
|
|
75
|
+
* The idea of this class is to provide lazy encode and decode of cbor data.
|
|
76
|
+
*
|
|
77
|
+
* Due to a bug in the cbor-x library, we are eagerly encoding the data in the constructor.
|
|
78
|
+
* https://github.com/kriszyp/cbor-x/issues/83
|
|
79
|
+
*
|
|
80
|
+
*/
|
|
81
|
+
declare class DataItem<T = unknown> {
|
|
82
|
+
#private;
|
|
83
|
+
constructor(options: DataItemOptions<T>);
|
|
84
|
+
get data(): T;
|
|
85
|
+
get buffer(): Uint8Array;
|
|
86
|
+
static fromData<T>(data: T): DataItem<T>;
|
|
87
|
+
static fromBuffer<T>(buffer: Uint8Array): DataItem<T>;
|
|
88
|
+
}
|
|
89
|
+
//#endregion
|
|
90
|
+
//#region src/cbor/models/date-only.d.ts
|
|
91
|
+
declare const customInspectSymbol: unique symbol;
|
|
92
|
+
declare class DateOnly {
|
|
93
|
+
private date;
|
|
94
|
+
constructor(date?: string);
|
|
95
|
+
get [Symbol.toStringTag](): string;
|
|
96
|
+
toString(): string;
|
|
97
|
+
toJSON(): string;
|
|
98
|
+
toISOString(): string;
|
|
99
|
+
[customInspectSymbol](): string;
|
|
100
|
+
}
|
|
101
|
+
//#endregion
|
|
102
|
+
//#region src/cbor/parser.d.ts
|
|
103
|
+
type CborOptions = Options & {
|
|
104
|
+
unwrapTopLevelDataItem?: boolean;
|
|
105
|
+
};
|
|
106
|
+
declare const cborDecode: <T>(input: Uint8Array, options?: CborOptions) => T;
|
|
107
|
+
declare const cborEncode: (obj: unknown, options?: Options) => Uint8Array;
|
|
108
|
+
//#endregion
|
|
109
|
+
//#region src/cose/error.d.ts
|
|
110
|
+
declare class CoseError extends Error {
|
|
111
|
+
constructor(message?: string);
|
|
112
|
+
}
|
|
113
|
+
declare class CoseUnsupportedMacError extends CoseError {}
|
|
114
|
+
declare class CoseInvalidSignatureError extends CoseError {}
|
|
115
|
+
declare class CoseInvalidAlgorithmError extends CoseError {}
|
|
116
|
+
declare class CosePayloadMustBeNullError extends CoseError {}
|
|
117
|
+
declare class CosePayloadMustBeDefinedError extends CoseError {}
|
|
118
|
+
declare class CosePayloadInvalidStructureError extends CoseError {}
|
|
119
|
+
declare class CoseInvalidTypeForKeyError extends CoseError {}
|
|
120
|
+
declare class CoseInvalidValueForKtyError extends CoseError {}
|
|
121
|
+
declare class CoseInvalidKtyForRawError extends CoseError {}
|
|
122
|
+
declare class CoseXNotDefinedError extends CoseError {}
|
|
123
|
+
declare class CoseYNotDefinedError extends CoseError {}
|
|
124
|
+
declare class CoseDNotDefinedError extends CoseError {}
|
|
125
|
+
declare class CoseKNotDefinedError extends CoseError {}
|
|
126
|
+
declare class CoseEphemeralMacKeyIsRequiredError extends CoseError {}
|
|
127
|
+
declare class CoseCertificateNotFoundError extends CoseError {}
|
|
128
|
+
declare class CoseKeyTypeNotSupportedForPrivateKeyExtractionError extends CoseError {}
|
|
129
|
+
//#endregion
|
|
130
|
+
//#region src/cose/headers/defaults.d.ts
|
|
131
|
+
declare enum Header {
|
|
132
|
+
Algorithm = 1,
|
|
133
|
+
Critical = 2,
|
|
134
|
+
ContentType = 3,
|
|
135
|
+
KeyId = 4,
|
|
136
|
+
Iv = 5,
|
|
137
|
+
PartialIv = 6,
|
|
138
|
+
CounterSignature = 7,
|
|
139
|
+
CounterSignature0 = 9,
|
|
140
|
+
CounterSignatureV2 = 11,
|
|
141
|
+
CounterSignature0V2 = 12,
|
|
142
|
+
X5Bag = 32,
|
|
143
|
+
X5Chain = 33,
|
|
144
|
+
X5T = 34,
|
|
145
|
+
X5U = 35
|
|
146
|
+
}
|
|
147
|
+
declare enum SignatureAlgorithm {
|
|
148
|
+
EdDSA = -8,
|
|
149
|
+
ES256 = -7,
|
|
150
|
+
ES384 = -35,
|
|
151
|
+
ES512 = -36,
|
|
152
|
+
PS256 = -37,
|
|
153
|
+
PS384 = -38,
|
|
154
|
+
PS512 = -39,
|
|
155
|
+
RS256 = -257,
|
|
156
|
+
RS384 = -258,
|
|
157
|
+
RS512 = -259
|
|
158
|
+
}
|
|
159
|
+
declare enum MacAlgorithm {
|
|
160
|
+
HS256 = 5,
|
|
161
|
+
HS384 = 6,
|
|
162
|
+
HS512 = 7
|
|
163
|
+
}
|
|
164
|
+
declare enum EncryptionAlgorithm {
|
|
165
|
+
A128GCM = 1,
|
|
166
|
+
A192GCM = 2,
|
|
167
|
+
A256GCM = 3,
|
|
168
|
+
Direct = -6
|
|
169
|
+
}
|
|
170
|
+
type DigestAlgorithm = 'SHA-256' | 'SHA-384' | 'SHA-512';
|
|
171
|
+
//#endregion
|
|
172
|
+
//#region src/cose/headers/protected-headers.d.ts
|
|
173
|
+
declare const protectedHeadersEncodedStructure: z$1.ZodCustom<Uint8Array<ArrayBufferLike>, Uint8Array<ArrayBufferLike>>;
|
|
174
|
+
declare const protectedHeadersDecodedStructure: z$1.ZodMap<z$1.ZodNumber, z$1.ZodUnknown>;
|
|
175
|
+
type ProtectedHeadersDecodedStructure = z$1.infer<typeof protectedHeadersDecodedStructure>;
|
|
176
|
+
type ProtectedHeadersEncodedStructure = z$1.infer<typeof protectedHeadersEncodedStructure>;
|
|
177
|
+
type ProtectedHeaderOptions = {
|
|
178
|
+
protectedHeaders?: ProtectedHeadersDecodedStructure;
|
|
179
|
+
};
|
|
180
|
+
declare class ProtectedHeaders extends CborStructure<ProtectedHeadersEncodedStructure, ProtectedHeadersDecodedStructure> {
|
|
181
|
+
static get encodingSchema(): z$1.ZodCodec<z$1.ZodCustom<Uint8Array<ArrayBufferLike>, Uint8Array<ArrayBufferLike>>, z$1.ZodMap<z$1.ZodNumber, z$1.ZodUnknown>>;
|
|
182
|
+
get headers(): Map<number, unknown>;
|
|
183
|
+
static create(options: ProtectedHeaderOptions): ProtectedHeaders;
|
|
184
|
+
}
|
|
185
|
+
//#endregion
|
|
186
|
+
//#region src/cose/headers/unprotected-headers.d.ts
|
|
187
|
+
declare const unprotectedHeadersStructure: z$1.ZodMap<z$1.ZodNumber, z$1.ZodUnknown>;
|
|
188
|
+
type UnprotectedHeadersStructure = z$1.infer<typeof unprotectedHeadersStructure>;
|
|
189
|
+
type UnprotectedHeaderOptions = {
|
|
190
|
+
unprotectedHeaders?: UnprotectedHeadersStructure;
|
|
191
|
+
};
|
|
192
|
+
declare class UnprotectedHeaders extends CborStructure<UnprotectedHeadersStructure> {
|
|
193
|
+
static get encodingSchema(): z$1.ZodMap<z$1.ZodNumber, z$1.ZodUnknown>;
|
|
194
|
+
get headers(): Map<number, unknown>;
|
|
195
|
+
static create(options: UnprotectedHeaderOptions): UnprotectedHeaders;
|
|
196
|
+
}
|
|
197
|
+
//#endregion
|
|
198
|
+
//#region src/cose/key/curve.d.ts
|
|
199
|
+
declare enum Curve {
|
|
200
|
+
'P-256' = 1,
|
|
201
|
+
'P-384' = 2,
|
|
202
|
+
'P-521' = 3,
|
|
203
|
+
X25519 = 4,
|
|
204
|
+
X448 = 5,
|
|
205
|
+
Ed25519 = 6,
|
|
206
|
+
Ed448 = 7
|
|
207
|
+
}
|
|
208
|
+
//#endregion
|
|
209
|
+
//#region src/utils/transformers.d.ts
|
|
210
|
+
declare const base64: {
|
|
211
|
+
decode: (base64: string) => Uint8Array;
|
|
212
|
+
encode: (bytes: Uint8Array) => string;
|
|
213
|
+
};
|
|
214
|
+
declare const base64url: {
|
|
215
|
+
decode: (base64url: string) => Uint8Array;
|
|
216
|
+
encode: (bytes: Uint8Array) => string;
|
|
217
|
+
};
|
|
218
|
+
declare const hex: {
|
|
219
|
+
decode: (hex: string) => Uint8Array;
|
|
220
|
+
encode: (bytes: Uint8Array) => string;
|
|
221
|
+
};
|
|
222
|
+
declare const bytesToString: (bytes: Uint8Array) => string;
|
|
223
|
+
declare const stringToBytes: (str: string) => Uint8Array;
|
|
224
|
+
declare const concatBytes: (byteArrays: Array<Uint8Array>) => Uint8Array;
|
|
225
|
+
declare const compareBytes: (lhs: Uint8Array, rhs: Uint8Array) => boolean;
|
|
226
|
+
//#endregion
|
|
227
|
+
//#region src/utils/typed-map.d.ts
|
|
228
|
+
/**
|
|
229
|
+
* TypedMap provides compile-time type safety for Maps where each key has its own specific value type.
|
|
230
|
+
* Unlike Map<K, V> which has the same value type V for all keys, TypedMap<Schema, OptionalKeys>
|
|
231
|
+
* allows different value types per key (heterogeneous values).
|
|
232
|
+
*
|
|
233
|
+
* Example:
|
|
234
|
+
* type CoseKeySchema = {
|
|
235
|
+
* [CoseKeyParameter.KeyType]: KeyType // number key → KeyType value
|
|
236
|
+
* [CoseKeyParameter.Curve]: Curve // number key → Curve value
|
|
237
|
+
* [CoseKeyParameter.X]: Uint8Array // number key → Uint8Array value
|
|
238
|
+
* }
|
|
239
|
+
*
|
|
240
|
+
* const map = new TypedMap<CoseKeySchema>()
|
|
241
|
+
* map.get(CoseKeyParameter.KeyType) // TypeScript knows this is KeyType!
|
|
242
|
+
* map.get(CoseKeyParameter.Curve) // TypeScript knows this is Curve!
|
|
243
|
+
* map.get(CoseKeyParameter.X) // TypeScript knows this is Uint8Array!
|
|
244
|
+
*
|
|
245
|
+
* @template Schema - Object type mapping keys to their value types
|
|
246
|
+
* @template OptionalKeys - Union of keys that are optional (can be absent)
|
|
247
|
+
*/
|
|
248
|
+
declare class TypedMap<Schema extends Record<PropertyKey, any>, OptionalKeys extends keyof Schema = never> {
|
|
249
|
+
private readonly map;
|
|
250
|
+
constructor(entries?: (readonly [keyof Schema, Schema[keyof Schema]])[] | null);
|
|
251
|
+
static fromMap<Schema extends Record<PropertyKey, any>, OptionalKeys extends keyof Schema = never>(map: Map<any, any>): TypedMap<Schema, OptionalKeys>;
|
|
252
|
+
/**
|
|
253
|
+
* Type-safe get that returns the correct value type for each key.
|
|
254
|
+
* Required keys return T, optional keys return T | undefined.
|
|
255
|
+
*/
|
|
256
|
+
get<K extends keyof Schema>(key: K): K extends OptionalKeys ? Schema[K] | undefined : Schema[K];
|
|
257
|
+
/**
|
|
258
|
+
* Type-safe set that ensures the value matches the key's type
|
|
259
|
+
*/
|
|
260
|
+
set<K extends keyof Schema>(key: K, value: Schema[K]): this;
|
|
261
|
+
has(key: keyof Schema): boolean;
|
|
262
|
+
delete(key: keyof Schema): boolean;
|
|
263
|
+
clear(): void;
|
|
264
|
+
get size(): number;
|
|
265
|
+
keys(): IterableIterator<keyof Schema>;
|
|
266
|
+
values(): IterableIterator<Schema[keyof Schema]>;
|
|
267
|
+
entries(): IterableIterator<[keyof Schema, Schema[keyof Schema]]>;
|
|
268
|
+
forEach(callbackfn: (value: Schema[keyof Schema], key: keyof Schema, map: Map<keyof Schema, Schema[keyof Schema]>) => void, thisArg?: any): void;
|
|
269
|
+
[Symbol.iterator](): IterableIterator<[keyof Schema, Schema[keyof Schema]]>;
|
|
270
|
+
toMap(): Map<keyof Schema, Schema[keyof Schema]>;
|
|
271
|
+
}
|
|
272
|
+
type EntriesArrayToSchema<T extends ReadonlyArray<readonly [any, any]>> = { [K in T[number][0]]: Extract<T[number], readonly [K, any]>[1] };
|
|
273
|
+
type EntriesBase = ReadonlyArray<readonly [string | number, z.ZodType<any>]>;
|
|
274
|
+
type InferredEntries<Entries extends EntriesBase> = { [K in keyof Entries]: readonly [Entries[K][0], z.infer<Entries[K][1]>] };
|
|
275
|
+
type InferredSchema<Entries extends EntriesBase> = EntriesArrayToSchema<InferredEntries<Entries>>;
|
|
276
|
+
type OptionalKeys<Entries extends EntriesBase> = Entries[number] extends infer E ? E extends readonly [infer K, infer V] ? V extends z.ZodExactOptional<any> ? K : never : never : never;
|
|
277
|
+
/**
|
|
278
|
+
* Utility function to create a typed map codec.
|
|
279
|
+
* Takes an array of [key, valueSchema] entries to support any key type (including non-string keys for CBOR).
|
|
280
|
+
*
|
|
281
|
+
* Example:
|
|
282
|
+
* const coseKeyMap = typedMap([
|
|
283
|
+
* [CoseKeyParameter.KeyType, z.number()],
|
|
284
|
+
* [CoseKeyParameter.Curve, z.number()],
|
|
285
|
+
* [CoseKeyParameter.X, z.instanceof(Uint8Array)]
|
|
286
|
+
* ] as const)
|
|
287
|
+
*
|
|
288
|
+
* The resulting schema validates a Map and transforms it to TypedMap<Schema, never>.
|
|
289
|
+
*/
|
|
290
|
+
declare function typedMap<const Entries extends EntriesBase>(entries: Entries, {
|
|
291
|
+
allowAdditionalKeys,
|
|
292
|
+
encode,
|
|
293
|
+
decode
|
|
294
|
+
}?: {
|
|
295
|
+
/**
|
|
296
|
+
* Whether to allow additional keys in the typed map
|
|
297
|
+
*
|
|
298
|
+
* @default true
|
|
299
|
+
*/
|
|
300
|
+
allowAdditionalKeys?: boolean;
|
|
301
|
+
/**
|
|
302
|
+
* Allows overriding the encode function. The original encode method is passed as second
|
|
303
|
+
* argument, so you can use this method to pre/post process
|
|
304
|
+
*/
|
|
305
|
+
encode?: (decoded: TypedMap<InferredSchema<Entries>, OptionalKeys<Entries>>, originalEncode: (decoded: TypedMap<InferredSchema<Entries>, OptionalKeys<Entries>>) => Map<unknown, unknown>) => Map<unknown, unknown>;
|
|
306
|
+
/**
|
|
307
|
+
* Allows overriding the decode function. The original decode method is passed as second
|
|
308
|
+
* argument, so you can use this method to pre/post process
|
|
309
|
+
*/
|
|
310
|
+
decode?: (encoded: Map<unknown, unknown>, originalDecode: (decoded: Map<unknown, unknown>) => TypedMap<InferredSchema<Entries>, OptionalKeys<Entries>>) => TypedMap<InferredSchema<Entries>, OptionalKeys<Entries>>;
|
|
311
|
+
}): z.ZodCodec<z.ZodMap<z.ZodUnknown, z.ZodUnknown>, z.ZodCustom<TypedMap<InferredSchema<Entries>, OptionalKeys<Entries>>, TypedMap<InferredSchema<Entries>, OptionalKeys<Entries>>>>;
|
|
312
|
+
//#endregion
|
|
313
|
+
//#region src/cose/key/key-operation.d.ts
|
|
314
|
+
declare enum KeyOps {
|
|
315
|
+
Sign = 1,
|
|
316
|
+
Verify = 2,
|
|
317
|
+
Encrypt = 3,
|
|
318
|
+
Decrypt = 4,
|
|
319
|
+
WrapKey = 5,
|
|
320
|
+
UnwrapKey = 6,
|
|
321
|
+
DeriveKey = 7,
|
|
322
|
+
DeriveBits = 8,
|
|
323
|
+
MACCreate = 9,
|
|
324
|
+
MACVerify = 10
|
|
325
|
+
}
|
|
326
|
+
//#endregion
|
|
327
|
+
//#region src/cose/key/key-type.d.ts
|
|
328
|
+
declare enum KeyType {
|
|
329
|
+
Okp = 1,
|
|
330
|
+
Ec = 2,
|
|
331
|
+
Oct = 4,
|
|
332
|
+
Reserved = 0
|
|
333
|
+
}
|
|
334
|
+
//#endregion
|
|
335
|
+
//#region src/cose/key/key.d.ts
|
|
336
|
+
declare enum CoseKeyParameter {
|
|
337
|
+
KeyType = 1,
|
|
338
|
+
KeyId = 2,
|
|
339
|
+
Algorithm = 3,
|
|
340
|
+
KeyOps = 4,
|
|
341
|
+
BaseIv = 5,
|
|
342
|
+
CurveOrK = -1,
|
|
343
|
+
X = -2,
|
|
344
|
+
Y = -3,
|
|
345
|
+
D = -4
|
|
346
|
+
}
|
|
347
|
+
declare const coseKeySchema: z.ZodCodec<z.ZodMap<z.ZodUnknown, z.ZodUnknown>, z.ZodCustom<TypedMap<{
|
|
348
|
+
1: string | KeyType;
|
|
349
|
+
2: string | Uint8Array<ArrayBufferLike>;
|
|
350
|
+
3: string | number;
|
|
351
|
+
4: (string | KeyOps)[];
|
|
352
|
+
5: Uint8Array<ArrayBufferLike>;
|
|
353
|
+
[-1]: Uint8Array<ArrayBufferLike> | Curve;
|
|
354
|
+
[-2]: Uint8Array<ArrayBufferLike>;
|
|
355
|
+
[-3]: Uint8Array<ArrayBufferLike>;
|
|
356
|
+
[-4]: Uint8Array<ArrayBufferLike>;
|
|
357
|
+
}, CoseKeyParameter.KeyId | CoseKeyParameter.Algorithm | CoseKeyParameter.KeyOps | CoseKeyParameter.BaseIv | CoseKeyParameter.CurveOrK | CoseKeyParameter.X | CoseKeyParameter.Y | CoseKeyParameter.D>, TypedMap<{
|
|
358
|
+
1: string | KeyType;
|
|
359
|
+
2: string | Uint8Array<ArrayBufferLike>;
|
|
360
|
+
3: string | number;
|
|
361
|
+
4: (string | KeyOps)[];
|
|
362
|
+
5: Uint8Array<ArrayBufferLike>;
|
|
363
|
+
[-1]: Uint8Array<ArrayBufferLike> | Curve;
|
|
364
|
+
[-2]: Uint8Array<ArrayBufferLike>;
|
|
365
|
+
[-3]: Uint8Array<ArrayBufferLike>;
|
|
366
|
+
[-4]: Uint8Array<ArrayBufferLike>;
|
|
367
|
+
}, CoseKeyParameter.KeyId | CoseKeyParameter.Algorithm | CoseKeyParameter.KeyOps | CoseKeyParameter.BaseIv | CoseKeyParameter.CurveOrK | CoseKeyParameter.X | CoseKeyParameter.Y | CoseKeyParameter.D>>>;
|
|
368
|
+
type CoseKeyDecodedStructure = z.output<typeof coseKeySchema>;
|
|
369
|
+
type CoseKeyEncodedStructure = z.input<typeof coseKeySchema>;
|
|
370
|
+
type CoseKeyOptions = {
|
|
371
|
+
keyType: KeyType | string;
|
|
372
|
+
keyId?: string;
|
|
373
|
+
algorithm?: string | number;
|
|
374
|
+
keyOps?: Array<KeyOps | string>;
|
|
375
|
+
baseIv?: Uint8Array;
|
|
376
|
+
curve?: Curve;
|
|
377
|
+
x?: Uint8Array;
|
|
378
|
+
y?: Uint8Array;
|
|
379
|
+
d?: Uint8Array;
|
|
380
|
+
k?: Uint8Array;
|
|
381
|
+
};
|
|
382
|
+
declare class CoseKey extends CborStructure<CoseKeyEncodedStructure, CoseKeyDecodedStructure> {
|
|
383
|
+
static get encodingSchema(): z.ZodCodec<z.ZodMap<z.ZodUnknown, z.ZodUnknown>, z.ZodCustom<TypedMap<{
|
|
384
|
+
1: string | KeyType;
|
|
385
|
+
2: string | Uint8Array<ArrayBufferLike>;
|
|
386
|
+
3: string | number;
|
|
387
|
+
4: (string | KeyOps)[];
|
|
388
|
+
5: Uint8Array<ArrayBufferLike>;
|
|
389
|
+
[-1]: Uint8Array<ArrayBufferLike> | Curve;
|
|
390
|
+
[-2]: Uint8Array<ArrayBufferLike>;
|
|
391
|
+
[-3]: Uint8Array<ArrayBufferLike>;
|
|
392
|
+
[-4]: Uint8Array<ArrayBufferLike>;
|
|
393
|
+
}, CoseKeyParameter.KeyId | CoseKeyParameter.Algorithm | CoseKeyParameter.KeyOps | CoseKeyParameter.BaseIv | CoseKeyParameter.CurveOrK | CoseKeyParameter.X | CoseKeyParameter.Y | CoseKeyParameter.D>, TypedMap<{
|
|
394
|
+
1: string | KeyType;
|
|
395
|
+
2: string | Uint8Array<ArrayBufferLike>;
|
|
396
|
+
3: string | number;
|
|
397
|
+
4: (string | KeyOps)[];
|
|
398
|
+
5: Uint8Array<ArrayBufferLike>;
|
|
399
|
+
[-1]: Uint8Array<ArrayBufferLike> | Curve;
|
|
400
|
+
[-2]: Uint8Array<ArrayBufferLike>;
|
|
401
|
+
[-3]: Uint8Array<ArrayBufferLike>;
|
|
402
|
+
[-4]: Uint8Array<ArrayBufferLike>;
|
|
403
|
+
}, CoseKeyParameter.KeyId | CoseKeyParameter.Algorithm | CoseKeyParameter.KeyOps | CoseKeyParameter.BaseIv | CoseKeyParameter.CurveOrK | CoseKeyParameter.X | CoseKeyParameter.Y | CoseKeyParameter.D>>>;
|
|
404
|
+
get keyType(): string | KeyType;
|
|
405
|
+
get keyId(): string | undefined;
|
|
406
|
+
get algorithm(): string | number | undefined;
|
|
407
|
+
get keyOps(): (string | KeyOps)[] | undefined;
|
|
408
|
+
get baseIv(): Uint8Array<ArrayBufferLike> | undefined;
|
|
409
|
+
get curve(): Curve | undefined;
|
|
410
|
+
get x(): Uint8Array<ArrayBufferLike> | undefined;
|
|
411
|
+
get y(): Uint8Array<ArrayBufferLike> | undefined;
|
|
412
|
+
get d(): Uint8Array<ArrayBufferLike> | undefined;
|
|
413
|
+
get k(): Uint8Array<ArrayBufferLike> | undefined;
|
|
414
|
+
static create(options: CoseKeyOptions): CoseKey;
|
|
415
|
+
static fromJwk(jwk: Record<string, unknown>): CoseKey;
|
|
416
|
+
get publicKey(): Uint8Array<ArrayBufferLike>;
|
|
417
|
+
get privateKey(): Uint8Array<ArrayBufferLike>;
|
|
418
|
+
get jwk(): Record<string, unknown>;
|
|
419
|
+
}
|
|
420
|
+
//#endregion
|
|
421
|
+
//#region src/cose/key/jwk.d.ts
|
|
422
|
+
declare const jwkCoseOptionsMap: Record<string, keyof CoseKeyOptions>;
|
|
423
|
+
declare const coseOptionsJwkMap: {
|
|
424
|
+
[k: string]: string;
|
|
425
|
+
};
|
|
426
|
+
declare const jwkToCoseKey: {
|
|
427
|
+
kty: (kty?: unknown) => KeyType;
|
|
428
|
+
crv: (crv?: unknown) => Curve;
|
|
429
|
+
alg: (alg?: unknown) => MacAlgorithm | SignatureAlgorithm | EncryptionAlgorithm;
|
|
430
|
+
kid: (kid?: unknown) => unknown;
|
|
431
|
+
keyOps: (keyOps?: unknown) => KeyOps[] | undefined;
|
|
432
|
+
x: (s?: unknown) => Uint8Array<ArrayBufferLike> | undefined;
|
|
433
|
+
y: (s?: unknown) => Uint8Array<ArrayBufferLike> | undefined;
|
|
434
|
+
d: (s?: unknown) => Uint8Array<ArrayBufferLike> | undefined;
|
|
435
|
+
};
|
|
436
|
+
declare const coseKeyToJwk: {
|
|
437
|
+
keyType: (keyType: KeyType) => any;
|
|
438
|
+
keyId: (keyId: unknown) => unknown;
|
|
439
|
+
algorithm: (algorithm?: SignatureAlgorithm | MacAlgorithm) => any;
|
|
440
|
+
keyOps: (keyOps?: unknown) => any[] | undefined;
|
|
441
|
+
baseIv: (baseIv?: unknown) => unknown;
|
|
442
|
+
curve: (curve?: Curve) => any;
|
|
443
|
+
x: (x?: Uint8Array) => string | undefined;
|
|
444
|
+
y: (y?: Uint8Array) => string | undefined;
|
|
445
|
+
d: (d?: Uint8Array) => string | undefined;
|
|
446
|
+
};
|
|
447
|
+
//#endregion
|
|
448
|
+
//#region src/mdoc/models/ble-options.d.ts
|
|
449
|
+
declare enum BleOptionsKeys {
|
|
450
|
+
PeripheralServerMode = 0,
|
|
451
|
+
CentralClientMode = 1,
|
|
452
|
+
PeripheralServerModeUuid = 10,
|
|
453
|
+
CentralClientModeUuid = 11,
|
|
454
|
+
PeripheralServerModeDeviceAddress = 20
|
|
455
|
+
}
|
|
456
|
+
declare const bleOptionsSchema: z.ZodCodec<z.ZodMap<z.ZodUnknown, z.ZodUnknown>, z.ZodCustom<TypedMap<{
|
|
457
|
+
0: boolean;
|
|
458
|
+
1: boolean;
|
|
459
|
+
10: Uint8Array<ArrayBufferLike>;
|
|
460
|
+
11: Uint8Array<ArrayBufferLike>;
|
|
461
|
+
20: Uint8Array<ArrayBufferLike>;
|
|
462
|
+
}, BleOptionsKeys.PeripheralServerModeUuid | BleOptionsKeys.CentralClientModeUuid | BleOptionsKeys.PeripheralServerModeDeviceAddress>, TypedMap<{
|
|
463
|
+
0: boolean;
|
|
464
|
+
1: boolean;
|
|
465
|
+
10: Uint8Array<ArrayBufferLike>;
|
|
466
|
+
11: Uint8Array<ArrayBufferLike>;
|
|
467
|
+
20: Uint8Array<ArrayBufferLike>;
|
|
468
|
+
}, BleOptionsKeys.PeripheralServerModeUuid | BleOptionsKeys.CentralClientModeUuid | BleOptionsKeys.PeripheralServerModeDeviceAddress>>>;
|
|
469
|
+
type BleOptionsEncodedStructure = z.input<typeof bleOptionsSchema>;
|
|
470
|
+
type BleOptionsDecodedStructure = z.output<typeof bleOptionsSchema>;
|
|
471
|
+
type BleOptionsOptions = {
|
|
472
|
+
peripheralServerMode: boolean;
|
|
473
|
+
centralClientMode: boolean;
|
|
474
|
+
peripheralServerModeUuid?: Uint8Array;
|
|
475
|
+
centralClientModeUuid?: Uint8Array;
|
|
476
|
+
peripheralServerModeDeviceAddress?: Uint8Array;
|
|
477
|
+
};
|
|
478
|
+
declare class BleOptions extends CborStructure<BleOptionsEncodedStructure, BleOptionsDecodedStructure> {
|
|
479
|
+
static get encodingSchema(): z.ZodCodec<z.ZodMap<z.ZodUnknown, z.ZodUnknown>, z.ZodCustom<TypedMap<{
|
|
480
|
+
0: boolean;
|
|
481
|
+
1: boolean;
|
|
482
|
+
10: Uint8Array<ArrayBufferLike>;
|
|
483
|
+
11: Uint8Array<ArrayBufferLike>;
|
|
484
|
+
20: Uint8Array<ArrayBufferLike>;
|
|
485
|
+
}, BleOptionsKeys.PeripheralServerModeUuid | BleOptionsKeys.CentralClientModeUuid | BleOptionsKeys.PeripheralServerModeDeviceAddress>, TypedMap<{
|
|
486
|
+
0: boolean;
|
|
487
|
+
1: boolean;
|
|
488
|
+
10: Uint8Array<ArrayBufferLike>;
|
|
489
|
+
11: Uint8Array<ArrayBufferLike>;
|
|
490
|
+
20: Uint8Array<ArrayBufferLike>;
|
|
491
|
+
}, BleOptionsKeys.PeripheralServerModeUuid | BleOptionsKeys.CentralClientModeUuid | BleOptionsKeys.PeripheralServerModeDeviceAddress>>>;
|
|
492
|
+
get peripheralServerMode(): boolean;
|
|
493
|
+
get centralClientMode(): boolean;
|
|
494
|
+
get peripheralServerModeUuid(): Uint8Array<ArrayBufferLike> | undefined;
|
|
495
|
+
get centralClientModeUuid(): Uint8Array<ArrayBufferLike> | undefined;
|
|
496
|
+
get peripheralServerModeDeviceAddress(): Uint8Array<ArrayBufferLike> | undefined;
|
|
497
|
+
static create(options: BleOptionsOptions): BleOptions;
|
|
498
|
+
}
|
|
499
|
+
//#endregion
|
|
500
|
+
//#region src/mdoc/models/nfc-options.d.ts
|
|
501
|
+
declare const nfcOptionsSchema: z.ZodCodec<z.ZodMap<z.ZodUnknown, z.ZodUnknown>, z.ZodCustom<TypedMap<{
|
|
502
|
+
0: number;
|
|
503
|
+
1: number;
|
|
504
|
+
}, never>, TypedMap<{
|
|
505
|
+
0: number;
|
|
506
|
+
1: number;
|
|
507
|
+
}, never>>>;
|
|
508
|
+
type NfcOptionsEncodedStructure = z.input<typeof nfcOptionsSchema>;
|
|
509
|
+
type NfcOptionsDecodedStructure = z.output<typeof nfcOptionsSchema>;
|
|
510
|
+
type NfcOptionsOptions = {
|
|
511
|
+
maxCommandDataLength: number;
|
|
512
|
+
maxResponseDataLength: number;
|
|
513
|
+
};
|
|
514
|
+
declare class NfcOptions extends CborStructure<NfcOptionsEncodedStructure, NfcOptionsDecodedStructure> {
|
|
515
|
+
static get encodingSchema(): z.ZodCodec<z.ZodMap<z.ZodUnknown, z.ZodUnknown>, z.ZodCustom<TypedMap<{
|
|
516
|
+
0: number;
|
|
517
|
+
1: number;
|
|
518
|
+
}, never>, TypedMap<{
|
|
519
|
+
0: number;
|
|
520
|
+
1: number;
|
|
521
|
+
}, never>>>;
|
|
522
|
+
get maxCommandDataLength(): number;
|
|
523
|
+
get maxResponseDataLength(): number;
|
|
524
|
+
static create(options: NfcOptionsOptions): NfcOptions;
|
|
525
|
+
}
|
|
526
|
+
//#endregion
|
|
527
|
+
//#region src/mdoc/models/wifi-options.d.ts
|
|
528
|
+
declare enum WifiOptionsKeys {
|
|
529
|
+
Passphrase = 0,
|
|
530
|
+
OperatingClass = 1,
|
|
531
|
+
ChannelNumber = 2,
|
|
532
|
+
SupportedBands = 3
|
|
533
|
+
}
|
|
534
|
+
declare const wifiOptionsSchema: z.ZodCodec<z.ZodMap<z.ZodUnknown, z.ZodUnknown>, z.ZodCustom<TypedMap<{
|
|
535
|
+
0: string;
|
|
536
|
+
1: number;
|
|
537
|
+
2: number;
|
|
538
|
+
3: Uint8Array<ArrayBufferLike>;
|
|
539
|
+
}, WifiOptionsKeys>, TypedMap<{
|
|
540
|
+
0: string;
|
|
541
|
+
1: number;
|
|
542
|
+
2: number;
|
|
543
|
+
3: Uint8Array<ArrayBufferLike>;
|
|
544
|
+
}, WifiOptionsKeys>>>;
|
|
545
|
+
type WifiOptionsEncodedStructure = z.input<typeof wifiOptionsSchema>;
|
|
546
|
+
type WifiOptionsDecodedStructure = z.output<typeof wifiOptionsSchema>;
|
|
547
|
+
type WifiOptionsOptions = {
|
|
548
|
+
passphrase?: string;
|
|
549
|
+
channelInfoOperatingClass?: number;
|
|
550
|
+
channelInfoChannelNumber?: number;
|
|
551
|
+
bandInfoSupportedBands?: Uint8Array;
|
|
552
|
+
};
|
|
553
|
+
declare class WifiOptions extends CborStructure<WifiOptionsEncodedStructure, WifiOptionsDecodedStructure> {
|
|
554
|
+
static get encodingSchema(): z.ZodCodec<z.ZodMap<z.ZodUnknown, z.ZodUnknown>, z.ZodCustom<TypedMap<{
|
|
555
|
+
0: string;
|
|
556
|
+
1: number;
|
|
557
|
+
2: number;
|
|
558
|
+
3: Uint8Array<ArrayBufferLike>;
|
|
559
|
+
}, WifiOptionsKeys>, TypedMap<{
|
|
560
|
+
0: string;
|
|
561
|
+
1: number;
|
|
562
|
+
2: number;
|
|
563
|
+
3: Uint8Array<ArrayBufferLike>;
|
|
564
|
+
}, WifiOptionsKeys>>>;
|
|
565
|
+
get encodedStructure(): WifiOptionsEncodedStructure;
|
|
566
|
+
get passphrase(): string | undefined;
|
|
567
|
+
get channelInfoOperatingClass(): number | undefined;
|
|
568
|
+
get channelInfoChannelNumber(): number | undefined;
|
|
569
|
+
get bandInfoSupportedBands(): Uint8Array<ArrayBufferLike> | undefined;
|
|
570
|
+
static create(options: WifiOptionsOptions): WifiOptions;
|
|
571
|
+
}
|
|
572
|
+
//#endregion
|
|
573
|
+
//#region src/mdoc/models/retrieval-options.d.ts
|
|
574
|
+
type RetrievalOptions = WifiOptions | BleOptions | NfcOptions;
|
|
575
|
+
//#endregion
|
|
576
|
+
//#region src/mdoc/models/device-retrieval-method.d.ts
|
|
577
|
+
declare enum DeviceRetrievalMethodType {
|
|
578
|
+
Nfc = 1,
|
|
579
|
+
Ble = 2,
|
|
580
|
+
WifiAware = 3
|
|
581
|
+
}
|
|
582
|
+
declare const deviceRetrievalMethodEncodedSchema: z.ZodTuple<[z.ZodUnion<[z.ZodEnum<typeof DeviceRetrievalMethodType>, z.ZodNumber]>, z.ZodNumber, z.ZodMap<z.ZodUnknown, z.ZodUnknown>], null>;
|
|
583
|
+
declare const deviceRetrievalMethodDecodedSchema: z.ZodObject<{
|
|
584
|
+
type: z.ZodUnion<[z.ZodEnum<typeof DeviceRetrievalMethodType>, z.ZodNumber]>;
|
|
585
|
+
version: z.ZodNumber;
|
|
586
|
+
retrievalOptions: z.ZodUnion<readonly [z.ZodCustom<NfcOptions, NfcOptions>, z.ZodCustom<BleOptions, BleOptions>, z.ZodCustom<WifiOptions, WifiOptions>, z.ZodMap<z.ZodUnknown, z.ZodUnknown>]>;
|
|
587
|
+
}, z.core.$strip>;
|
|
588
|
+
type DeviceRetrievalMethodEncodedStructure = z.infer<typeof deviceRetrievalMethodEncodedSchema>;
|
|
589
|
+
type DeviceRetrievalMethodDecodedStructure = z.infer<typeof deviceRetrievalMethodDecodedSchema>;
|
|
590
|
+
type DeviceRetrievalMethodOptions = {
|
|
591
|
+
type: DeviceRetrievalMethodType | number;
|
|
592
|
+
version: number;
|
|
593
|
+
retrievalOptions: RetrievalOptions;
|
|
594
|
+
};
|
|
595
|
+
declare class DeviceRetrievalMethod extends CborStructure<DeviceRetrievalMethodEncodedStructure, DeviceRetrievalMethodDecodedStructure> {
|
|
596
|
+
static get encodingSchema(): z.ZodCodec<z.ZodTuple<[z.ZodUnion<[z.ZodEnum<typeof DeviceRetrievalMethodType>, z.ZodNumber]>, z.ZodNumber, z.ZodMap<z.ZodUnknown, z.ZodUnknown>], null>, z.ZodObject<{
|
|
597
|
+
type: z.ZodUnion<[z.ZodEnum<typeof DeviceRetrievalMethodType>, z.ZodNumber]>;
|
|
598
|
+
version: z.ZodNumber;
|
|
599
|
+
retrievalOptions: z.ZodUnion<readonly [z.ZodCustom<NfcOptions, NfcOptions>, z.ZodCustom<BleOptions, BleOptions>, z.ZodCustom<WifiOptions, WifiOptions>, z.ZodMap<z.ZodUnknown, z.ZodUnknown>]>;
|
|
600
|
+
}, z.core.$strip>>;
|
|
601
|
+
get type(): number;
|
|
602
|
+
get version(): number;
|
|
603
|
+
get retrievalOptions(): Map<unknown, unknown> | NfcOptions | BleOptions | WifiOptions;
|
|
604
|
+
static create(options: DeviceRetrievalMethodOptions): DeviceRetrievalMethod;
|
|
605
|
+
}
|
|
606
|
+
//#endregion
|
|
607
|
+
//#region src/mdoc/models/protocol-info.d.ts
|
|
608
|
+
declare const protocolInfoSchema: z$1.ZodUnknown;
|
|
609
|
+
type ProtocolInfoStructure = z$1.infer<typeof protocolInfoSchema>;
|
|
610
|
+
declare class ProtocolInfo extends CborStructure<ProtocolInfoStructure> {
|
|
611
|
+
static get encodingSchema(): z$1.ZodUnknown;
|
|
612
|
+
}
|
|
613
|
+
//#endregion
|
|
614
|
+
//#region src/mdoc/models/e-device-key.d.ts
|
|
615
|
+
type EDeviceKeyDecodedStructure = CoseKeyDecodedStructure;
|
|
616
|
+
type EDeviceKeyEncodedStructure = CoseKeyEncodedStructure;
|
|
617
|
+
type EDeviceKeyOptions = CoseKeyOptions;
|
|
618
|
+
declare class EDeviceKey extends CoseKey {}
|
|
619
|
+
//#endregion
|
|
620
|
+
//#region src/mdoc/models/security.d.ts
|
|
621
|
+
declare const securityEncodedSchema: z.ZodTuple<[z.ZodNumber, z.ZodCustom<DataItem<unknown>, DataItem<unknown>>], null>;
|
|
622
|
+
declare const securityDecodedSchema: z.ZodObject<{
|
|
623
|
+
cipherSuiteIdentifier: z.ZodNumber;
|
|
624
|
+
eDeviceKey: z.ZodCustom<EDeviceKey, EDeviceKey>;
|
|
625
|
+
}, z.core.$strip>;
|
|
626
|
+
type SecurityEncodedStructure = z.infer<typeof securityEncodedSchema>;
|
|
627
|
+
type SecurityDecodedStructure = z.infer<typeof securityDecodedSchema>;
|
|
628
|
+
type SecurityOptions = {
|
|
629
|
+
cipherSuiteIdentifier: number;
|
|
630
|
+
eDeviceKey: EDeviceKey;
|
|
631
|
+
};
|
|
632
|
+
declare class Security extends CborStructure<SecurityEncodedStructure, SecurityDecodedStructure> {
|
|
633
|
+
static get encodingSchema(): z.ZodCodec<z.ZodTuple<[z.ZodNumber, z.ZodCustom<DataItem<unknown>, DataItem<unknown>>], null>, z.ZodObject<{
|
|
634
|
+
cipherSuiteIdentifier: z.ZodNumber;
|
|
635
|
+
eDeviceKey: z.ZodCustom<EDeviceKey, EDeviceKey>;
|
|
636
|
+
}, z.core.$strip>>;
|
|
637
|
+
get cipherSuiteIdentifier(): number;
|
|
638
|
+
get eDeviceKey(): EDeviceKey;
|
|
639
|
+
static create(options: SecurityOptions): Security;
|
|
640
|
+
}
|
|
641
|
+
//#endregion
|
|
642
|
+
//#region src/mdoc/models/oidc.d.ts
|
|
643
|
+
declare const oidcEncodedSchema: z.ZodTuple<[z.ZodNumber, z.ZodString, z.ZodString], null>;
|
|
644
|
+
declare const oidcDecodedSchema: z.ZodObject<{
|
|
645
|
+
version: z.ZodNumber;
|
|
646
|
+
issuerUrl: z.ZodString;
|
|
647
|
+
serverRetrievalToken: z.ZodString;
|
|
648
|
+
}, z.core.$strip>;
|
|
649
|
+
type OidcEncodedStructure = z.infer<typeof oidcEncodedSchema>;
|
|
650
|
+
type OidcDecodedStructure = z.infer<typeof oidcDecodedSchema>;
|
|
651
|
+
type OidcOptions = OidcDecodedStructure;
|
|
652
|
+
declare class Oidc extends CborStructure<OidcEncodedStructure, OidcDecodedStructure> {
|
|
653
|
+
static get encodingSchema(): z.ZodCodec<z.ZodTuple<[z.ZodNumber, z.ZodString, z.ZodString], null>, z.ZodObject<{
|
|
654
|
+
version: z.ZodNumber;
|
|
655
|
+
issuerUrl: z.ZodString;
|
|
656
|
+
serverRetrievalToken: z.ZodString;
|
|
657
|
+
}, z.core.$strip>>;
|
|
658
|
+
get version(): number;
|
|
659
|
+
get issuerUrl(): string;
|
|
660
|
+
get serverRetrievalToken(): string;
|
|
661
|
+
static create(options: OidcOptions): Oidc;
|
|
662
|
+
}
|
|
663
|
+
//#endregion
|
|
664
|
+
//#region src/mdoc/models/web-api.d.ts
|
|
665
|
+
declare const webApiEncodedSchema: z.ZodTuple<[z.ZodNumber, z.ZodString, z.ZodString], null>;
|
|
666
|
+
declare const webApiDecodedSchema: z.ZodObject<{
|
|
667
|
+
version: z.ZodNumber;
|
|
668
|
+
issuerUrl: z.ZodString;
|
|
669
|
+
serverRetrievalToken: z.ZodString;
|
|
670
|
+
}, z.core.$strip>;
|
|
671
|
+
type WebApiEncodedStructure = z.infer<typeof webApiEncodedSchema>;
|
|
672
|
+
type WebApiDecodedStructure = z.infer<typeof webApiDecodedSchema>;
|
|
673
|
+
type WebApiOptions = WebApiDecodedStructure;
|
|
674
|
+
declare class WebApi extends CborStructure<WebApiEncodedStructure, WebApiDecodedStructure> {
|
|
675
|
+
static get encodingSchema(): z.ZodCodec<z.ZodTuple<[z.ZodNumber, z.ZodString, z.ZodString], null>, z.ZodObject<{
|
|
676
|
+
version: z.ZodNumber;
|
|
677
|
+
issuerUrl: z.ZodString;
|
|
678
|
+
serverRetrievalToken: z.ZodString;
|
|
679
|
+
}, z.core.$strip>>;
|
|
680
|
+
get version(): number;
|
|
681
|
+
get issuerUrl(): string;
|
|
682
|
+
get serverRetrievalToken(): string;
|
|
683
|
+
static create(options: WebApiOptions): WebApi;
|
|
684
|
+
}
|
|
685
|
+
//#endregion
|
|
686
|
+
//#region src/mdoc/models/server-retrieval-method.d.ts
|
|
687
|
+
declare const serverRetrievalMethodSchema: z.ZodCodec<z.ZodMap<z.ZodUnknown, z.ZodUnknown>, z.ZodCustom<TypedMap<{
|
|
688
|
+
webApi: WebApi;
|
|
689
|
+
oidc: Oidc;
|
|
690
|
+
}, "webApi" | "oidc">, TypedMap<{
|
|
691
|
+
webApi: WebApi;
|
|
692
|
+
oidc: Oidc;
|
|
693
|
+
}, "webApi" | "oidc">>>;
|
|
694
|
+
type ServerRetrievalMethodDecodedStructure = z.output<typeof serverRetrievalMethodSchema>;
|
|
695
|
+
type ServerRetrievalMethodEncodedStructure = z.input<typeof serverRetrievalMethodSchema>;
|
|
696
|
+
type ServerRetrievalMethodOptions = {
|
|
697
|
+
webApi?: WebApi;
|
|
698
|
+
oidc?: Oidc;
|
|
699
|
+
};
|
|
700
|
+
declare class ServerRetrievalMethod extends CborStructure<ServerRetrievalMethodEncodedStructure, ServerRetrievalMethodDecodedStructure> {
|
|
701
|
+
static get encodingSchema(): z.ZodCodec<z.ZodMap<z.ZodUnknown, z.ZodUnknown>, z.ZodCustom<TypedMap<{
|
|
702
|
+
webApi: WebApi;
|
|
703
|
+
oidc: Oidc;
|
|
704
|
+
}, "webApi" | "oidc">, TypedMap<{
|
|
705
|
+
webApi: WebApi;
|
|
706
|
+
oidc: Oidc;
|
|
707
|
+
}, "webApi" | "oidc">>>;
|
|
708
|
+
get webApi(): WebApi | undefined;
|
|
709
|
+
get oidc(): Oidc | undefined;
|
|
710
|
+
static create(options: ServerRetrievalMethodOptions): ServerRetrievalMethod;
|
|
711
|
+
}
|
|
712
|
+
//#endregion
|
|
713
|
+
//#region src/mdoc/models/device-engagement.d.ts
|
|
714
|
+
declare enum DeviceEngagementKeys {
|
|
715
|
+
Version = 0,
|
|
716
|
+
Security = 1,
|
|
717
|
+
DeviceRetrievalMethods = 2,
|
|
718
|
+
ServerRetrievalMethods = 3,
|
|
719
|
+
ProtocolInfo = 4
|
|
720
|
+
}
|
|
721
|
+
declare const deviceEngagementSchema: z.ZodCodec<z.ZodMap<z.ZodUnknown, z.ZodUnknown>, z.ZodCustom<TypedMap<{
|
|
722
|
+
0: string;
|
|
723
|
+
1: Security;
|
|
724
|
+
2: DeviceRetrievalMethod[];
|
|
725
|
+
3: ServerRetrievalMethod[];
|
|
726
|
+
4: ProtocolInfo;
|
|
727
|
+
}, DeviceEngagementKeys.DeviceRetrievalMethods | DeviceEngagementKeys.ServerRetrievalMethods | DeviceEngagementKeys.ProtocolInfo>, TypedMap<{
|
|
728
|
+
0: string;
|
|
729
|
+
1: Security;
|
|
730
|
+
2: DeviceRetrievalMethod[];
|
|
731
|
+
3: ServerRetrievalMethod[];
|
|
732
|
+
4: ProtocolInfo;
|
|
733
|
+
}, DeviceEngagementKeys.DeviceRetrievalMethods | DeviceEngagementKeys.ServerRetrievalMethods | DeviceEngagementKeys.ProtocolInfo>>>;
|
|
734
|
+
type DeviceEngagementEncodedStructure = z.input<typeof deviceEngagementSchema>;
|
|
735
|
+
type DeviceEngagementDecodedStructure = z.output<typeof deviceEngagementSchema>;
|
|
736
|
+
type DeviceEngagementOptions = {
|
|
737
|
+
version: string;
|
|
738
|
+
security: Security;
|
|
739
|
+
deviceRetrievalMethods?: Array<DeviceRetrievalMethod>;
|
|
740
|
+
serverRetrievalMethods?: Array<ServerRetrievalMethod>;
|
|
741
|
+
protocolInfo?: ProtocolInfo;
|
|
742
|
+
};
|
|
743
|
+
declare class DeviceEngagement extends CborStructure<DeviceEngagementEncodedStructure, DeviceEngagementDecodedStructure> {
|
|
744
|
+
static get encodingSchema(): z.ZodCodec<z.ZodMap<z.ZodUnknown, z.ZodUnknown>, z.ZodCustom<TypedMap<{
|
|
745
|
+
0: string;
|
|
746
|
+
1: Security;
|
|
747
|
+
2: DeviceRetrievalMethod[];
|
|
748
|
+
3: ServerRetrievalMethod[];
|
|
749
|
+
4: ProtocolInfo;
|
|
750
|
+
}, DeviceEngagementKeys.DeviceRetrievalMethods | DeviceEngagementKeys.ServerRetrievalMethods | DeviceEngagementKeys.ProtocolInfo>, TypedMap<{
|
|
751
|
+
0: string;
|
|
752
|
+
1: Security;
|
|
753
|
+
2: DeviceRetrievalMethod[];
|
|
754
|
+
3: ServerRetrievalMethod[];
|
|
755
|
+
4: ProtocolInfo;
|
|
756
|
+
}, DeviceEngagementKeys.DeviceRetrievalMethods | DeviceEngagementKeys.ServerRetrievalMethods | DeviceEngagementKeys.ProtocolInfo>>>;
|
|
757
|
+
get version(): string;
|
|
758
|
+
get security(): Security;
|
|
759
|
+
get deviceRetrievalMethods(): DeviceRetrievalMethod[] | undefined;
|
|
760
|
+
get serverRetrievalMethods(): ServerRetrievalMethod[] | undefined;
|
|
761
|
+
get protocolInfo(): ProtocolInfo | undefined;
|
|
762
|
+
static create(options: DeviceEngagementOptions): DeviceEngagement;
|
|
763
|
+
}
|
|
764
|
+
//#endregion
|
|
765
|
+
//#region src/mdoc/models/e-reader-key.d.ts
|
|
766
|
+
type EReaderKeyDecodedStructure = CoseKeyDecodedStructure;
|
|
767
|
+
type EReaderKeyEncodedStructure = CoseKeyEncodedStructure;
|
|
768
|
+
type EReaderKeyOptions = CoseKeyOptions;
|
|
769
|
+
declare class EReaderKey extends CoseKey {}
|
|
770
|
+
//#endregion
|
|
771
|
+
//#region src/mdoc/models/handover.d.ts
|
|
772
|
+
declare abstract class Handover<EncodedStructure = unknown, DecodedStructure = EncodedStructure> extends CborStructure<EncodedStructure, DecodedStructure> {
|
|
773
|
+
static tryDecodeHandover<T extends Handover<any, any>>(this: {
|
|
774
|
+
new (structure: any): T;
|
|
775
|
+
fromEncodedStructure: (encodedStructure: EncodedStructureType<T>) => {
|
|
776
|
+
decodedStructure: DecodedStructureType<T>;
|
|
777
|
+
};
|
|
778
|
+
}, structure: unknown): T | null;
|
|
779
|
+
/**
|
|
780
|
+
* Whether this handover structure requires a reader key. Can
|
|
781
|
+
* be overridden in extending handover classes.
|
|
782
|
+
*/
|
|
783
|
+
get requiresReaderKey(): boolean;
|
|
784
|
+
/**
|
|
785
|
+
* Whether this handover structure requires device engagement structure. Can
|
|
786
|
+
* be overridden in extending handover classes.
|
|
787
|
+
*/
|
|
788
|
+
get requiresDeviceEngagement(): boolean;
|
|
789
|
+
}
|
|
790
|
+
//#endregion
|
|
791
|
+
//#region src/mdoc/models/oid4vp-dc-api-draft24-handover-info.d.ts
|
|
792
|
+
type Oid4vpDcApiDraft24HandoverInfoOptions = {
|
|
793
|
+
origin: string;
|
|
794
|
+
clientId: string;
|
|
795
|
+
nonce: string;
|
|
796
|
+
};
|
|
797
|
+
//#endregion
|
|
798
|
+
//#region src/mdoc/models/oid4vp-dc-api-handover-info.d.ts
|
|
799
|
+
type Oid4vpDcApiHandoverInfoOptions = {
|
|
800
|
+
origin: string;
|
|
801
|
+
nonce: string;
|
|
802
|
+
jwkThumbprint?: Uint8Array;
|
|
803
|
+
};
|
|
804
|
+
//#endregion
|
|
805
|
+
//#region src/mdoc/models/oid4vp-handover-info.d.ts
|
|
806
|
+
type Oid4vpHandoverInfoOptions = {
|
|
807
|
+
clientId: string;
|
|
808
|
+
nonce: string;
|
|
809
|
+
jwkThumbprint?: Uint8Array;
|
|
810
|
+
responseUri: string;
|
|
811
|
+
};
|
|
812
|
+
//#endregion
|
|
813
|
+
//#region src/mdoc/models/oid4vp-iae-handover-info.d.ts
|
|
814
|
+
type Oid4vpIaeHandoverInfoOptions = {
|
|
815
|
+
interactiveAuthorizationEndpoint: string;
|
|
816
|
+
nonce: string;
|
|
817
|
+
jwkThumbprint?: Uint8Array;
|
|
818
|
+
};
|
|
819
|
+
//#endregion
|
|
820
|
+
//#region src/mdoc/models/session-transcript.d.ts
|
|
821
|
+
declare const sessionTranscriptEncodedSchema: z.ZodTuple<[z.ZodNullable<z.ZodCustom<DataItem<Map<unknown, unknown>>, DataItem<Map<unknown, unknown>>>>, z.ZodNullable<z.ZodCustom<DataItem<Map<unknown, unknown>>, DataItem<Map<unknown, unknown>>>>, z.ZodUnknown], null>;
|
|
822
|
+
declare const sessionTranscriptDecodedSchema: z.ZodObject<{
|
|
823
|
+
deviceEngagement: z.ZodNullable<z.ZodCustom<DeviceEngagement, DeviceEngagement>>;
|
|
824
|
+
eReaderKey: z.ZodNullable<z.ZodCustom<EReaderKey, EReaderKey>>;
|
|
825
|
+
handover: z.ZodCustom<Handover<unknown, unknown>, Handover<unknown, unknown>>;
|
|
826
|
+
}, z.core.$strip>;
|
|
827
|
+
type SessionTranscriptDecodedStructure = z.infer<typeof sessionTranscriptDecodedSchema>;
|
|
828
|
+
type SessionTranscriptEncodedStructure = z.infer<typeof sessionTranscriptEncodedSchema>;
|
|
829
|
+
type SessionTranscriptOptions = {
|
|
830
|
+
deviceEngagement?: DeviceEngagement;
|
|
831
|
+
eReaderKey?: EReaderKey;
|
|
832
|
+
handover: Handover;
|
|
833
|
+
};
|
|
834
|
+
declare class SessionTranscript extends CborStructure<SessionTranscriptEncodedStructure, SessionTranscriptDecodedStructure> {
|
|
835
|
+
static get encodingSchema(): z.ZodCodec<z.ZodTuple<[z.ZodNullable<z.ZodCustom<DataItem<Map<unknown, unknown>>, DataItem<Map<unknown, unknown>>>>, z.ZodNullable<z.ZodCustom<DataItem<Map<unknown, unknown>>, DataItem<Map<unknown, unknown>>>>, z.ZodUnknown], null>, z.ZodObject<{
|
|
836
|
+
deviceEngagement: z.ZodNullable<z.ZodCustom<DeviceEngagement, DeviceEngagement>>;
|
|
837
|
+
eReaderKey: z.ZodNullable<z.ZodCustom<EReaderKey, EReaderKey>>;
|
|
838
|
+
handover: z.ZodCustom<Handover<unknown, unknown>, Handover<unknown, unknown>>;
|
|
839
|
+
}, z.core.$strip>>;
|
|
840
|
+
get deviceEngagement(): DeviceEngagement | null;
|
|
841
|
+
get eReaderKey(): EReaderKey | null;
|
|
842
|
+
get handover(): Handover<unknown, unknown>;
|
|
843
|
+
static create(options: SessionTranscriptOptions): SessionTranscript;
|
|
844
|
+
/**
|
|
845
|
+
* Create a SessionTranscript for QR handover (ISO 18013-5 proximity presentation).
|
|
846
|
+
*
|
|
847
|
+
* For QR handover, exact CBOR bytes matter for session key derivation.
|
|
848
|
+
* Use DeviceEngagement.decode() and EReaderKey.decode() to preserve original bytes -
|
|
849
|
+
* calling encode() on decoded objects will return the identical bytes.
|
|
850
|
+
*/
|
|
851
|
+
static forQrHandover(options: {
|
|
852
|
+
deviceEngagement: DeviceEngagement;
|
|
853
|
+
eReaderKey: EReaderKey;
|
|
854
|
+
}): SessionTranscript;
|
|
855
|
+
static forOid4VpDcApiDraft24(options: Oid4vpDcApiDraft24HandoverInfoOptions, ctx: Pick<MdocContext, 'crypto'>): Promise<SessionTranscript>;
|
|
856
|
+
static forOid4VpDcApi(options: Oid4vpDcApiHandoverInfoOptions, ctx: Pick<MdocContext, 'crypto'>): Promise<SessionTranscript>;
|
|
857
|
+
static forOid4VpIae(options: Oid4vpIaeHandoverInfoOptions, ctx: Pick<MdocContext, 'crypto'>): Promise<SessionTranscript>;
|
|
858
|
+
static forOid4Vp(options: Oid4vpHandoverInfoOptions, ctx: Pick<MdocContext, 'crypto'>): Promise<SessionTranscript>;
|
|
859
|
+
/**
|
|
860
|
+
* Calculate the session transcript bytes as defined in 18013-7 first edition, based
|
|
861
|
+
* on OpenID4VP draft 18.
|
|
862
|
+
*/
|
|
863
|
+
static forOid4VpDraft18(options: {
|
|
864
|
+
clientId: string;
|
|
865
|
+
responseUri: string;
|
|
866
|
+
verifierGeneratedNonce: string;
|
|
867
|
+
mdocGeneratedNonce: string;
|
|
868
|
+
}, ctx: Pick<MdocContext, 'crypto'>): Promise<SessionTranscript>;
|
|
869
|
+
}
|
|
870
|
+
//#endregion
|
|
871
|
+
//#region src/cose/mac0.d.ts
|
|
872
|
+
declare const mac0EncodedSchema: z.ZodTuple<[z.ZodCustom<Uint8Array<ArrayBufferLike>, Uint8Array<ArrayBufferLike>>, z.ZodMap<z.ZodUnknown, z.ZodUnknown>, z.ZodNullable<z.ZodCustom<Uint8Array<ArrayBufferLike>, Uint8Array<ArrayBufferLike>>>, z.ZodCustom<Uint8Array<ArrayBufferLike>, Uint8Array<ArrayBufferLike>>], null>;
|
|
873
|
+
declare const mac0DecodedSchema: z.ZodObject<{
|
|
874
|
+
protectedHeaders: z.ZodCustom<ProtectedHeaders, ProtectedHeaders>;
|
|
875
|
+
unprotectedHeaders: z.ZodCustom<UnprotectedHeaders, UnprotectedHeaders>;
|
|
876
|
+
payload: z.ZodNullable<z.ZodCustom<Uint8Array<ArrayBufferLike>, Uint8Array<ArrayBufferLike>>>;
|
|
877
|
+
tag: z.ZodCustom<Uint8Array<ArrayBufferLike>, Uint8Array<ArrayBufferLike>>;
|
|
878
|
+
}, z.core.$strip>;
|
|
879
|
+
type Mac0EncodedStructure = z.infer<typeof mac0EncodedSchema>;
|
|
880
|
+
type Mac0DecodedStructure = z.infer<typeof mac0DecodedSchema>;
|
|
881
|
+
type Mac0Options = {
|
|
882
|
+
protectedHeaders: ProtectedHeaders | ProtectedHeaderOptions['protectedHeaders'];
|
|
883
|
+
unprotectedHeaders: UnprotectedHeaders | UnprotectedHeaderOptions['unprotectedHeaders'];
|
|
884
|
+
externalAad?: Uint8Array;
|
|
885
|
+
payload?: Uint8Array | null;
|
|
886
|
+
detachedPayload?: Uint8Array;
|
|
887
|
+
privateKey: CoseKey;
|
|
888
|
+
ephemeralKey: CoseKey;
|
|
889
|
+
sessionTranscript: SessionTranscript | Uint8Array;
|
|
890
|
+
};
|
|
891
|
+
declare class Mac0 extends CborStructure<Mac0EncodedStructure, Mac0DecodedStructure> {
|
|
892
|
+
static tag: number;
|
|
893
|
+
static get encodingSchema(): z.ZodCodec<z.ZodTuple<[z.ZodCustom<Uint8Array<ArrayBufferLike>, Uint8Array<ArrayBufferLike>>, z.ZodMap<z.ZodUnknown, z.ZodUnknown>, z.ZodNullable<z.ZodCustom<Uint8Array<ArrayBufferLike>, Uint8Array<ArrayBufferLike>>>, z.ZodCustom<Uint8Array<ArrayBufferLike>, Uint8Array<ArrayBufferLike>>], null>, z.ZodObject<{
|
|
894
|
+
protectedHeaders: z.ZodCustom<ProtectedHeaders, ProtectedHeaders>;
|
|
895
|
+
unprotectedHeaders: z.ZodCustom<UnprotectedHeaders, UnprotectedHeaders>;
|
|
896
|
+
payload: z.ZodNullable<z.ZodCustom<Uint8Array<ArrayBufferLike>, Uint8Array<ArrayBufferLike>>>;
|
|
897
|
+
tag: z.ZodCustom<Uint8Array<ArrayBufferLike>, Uint8Array<ArrayBufferLike>>;
|
|
898
|
+
}, z.core.$strip>>;
|
|
899
|
+
externalAad?: Uint8Array;
|
|
900
|
+
detachedPayload?: Uint8Array;
|
|
901
|
+
get protectedHeaders(): ProtectedHeaders;
|
|
902
|
+
get unprotectedHeaders(): UnprotectedHeaders;
|
|
903
|
+
get payload(): Uint8Array<ArrayBufferLike> | null;
|
|
904
|
+
get tag(): Uint8Array<ArrayBufferLike>;
|
|
905
|
+
get toBeAuthenticated(): Uint8Array<ArrayBufferLike>;
|
|
906
|
+
/**
|
|
907
|
+
* Decodes CBOR bytes into a Sign1 instance.
|
|
908
|
+
* Uses the encodingSchema's decode() method to validate and transform the decoded data.
|
|
909
|
+
*/
|
|
910
|
+
static decode<T extends AnyCborStructure>(this: CborStructureStaticThis<T>, bytes: Uint8Array): T;
|
|
911
|
+
static toBeAuthenticated(options: {
|
|
912
|
+
payload: Uint8Array;
|
|
913
|
+
protectedHeaders: ProtectedHeaders;
|
|
914
|
+
externalAad?: Uint8Array;
|
|
915
|
+
}): Uint8Array<ArrayBufferLike>;
|
|
916
|
+
get signatureAlgorithmName(): MacAlgorithm;
|
|
917
|
+
static create(options: Mac0Options, ctx: Pick<MdocContext, 'crypto' | 'cose'>): Promise<Mac0>;
|
|
918
|
+
}
|
|
919
|
+
//#endregion
|
|
920
|
+
//#region src/cose/sign1.d.ts
|
|
921
|
+
declare const sign1EncodedSchema: z$1.ZodTuple<[z$1.ZodCustom<Uint8Array<ArrayBufferLike>, Uint8Array<ArrayBufferLike>>, z$1.ZodMap<z$1.ZodNumber, z$1.ZodUnknown>, z$1.ZodNullable<z$1.ZodCustom<Uint8Array<ArrayBufferLike>, Uint8Array<ArrayBufferLike>>>, z$1.ZodCustom<Uint8Array<ArrayBufferLike>, Uint8Array<ArrayBufferLike>>], null>;
|
|
922
|
+
declare const sign1DecodedSchema: z$1.ZodObject<{
|
|
923
|
+
protected: z$1.ZodCustom<ProtectedHeaders, ProtectedHeaders>;
|
|
924
|
+
unprotected: z$1.ZodCustom<UnprotectedHeaders, UnprotectedHeaders>;
|
|
925
|
+
payload: z$1.ZodNullable<z$1.ZodCustom<Uint8Array<ArrayBufferLike>, Uint8Array<ArrayBufferLike>>>;
|
|
926
|
+
signature: z$1.ZodCustom<Uint8Array<ArrayBufferLike>, Uint8Array<ArrayBufferLike>>;
|
|
927
|
+
}, z$1.core.$strip>;
|
|
928
|
+
type Sign1EncodedStructure = z$1.infer<typeof sign1EncodedSchema>;
|
|
929
|
+
type Sign1DecodedStructure = z$1.infer<typeof sign1DecodedSchema>;
|
|
930
|
+
type Sign1Options = {
|
|
931
|
+
protectedHeaders?: ProtectedHeaders | ProtectedHeaderOptions['protectedHeaders'];
|
|
932
|
+
unprotectedHeaders?: UnprotectedHeaders | UnprotectedHeaderOptions['unprotectedHeaders'];
|
|
933
|
+
signingKey: CoseKey;
|
|
934
|
+
payload?: Uint8Array | null;
|
|
935
|
+
detachedPayload?: Uint8Array;
|
|
936
|
+
externalAad?: Uint8Array;
|
|
937
|
+
};
|
|
938
|
+
declare class Sign1 extends CborStructure<Sign1EncodedStructure, Sign1DecodedStructure> {
|
|
939
|
+
static tag: number;
|
|
940
|
+
static get encodingSchema(): z$1.ZodCodec<z$1.ZodTuple<[z$1.ZodCustom<Uint8Array<ArrayBufferLike>, Uint8Array<ArrayBufferLike>>, z$1.ZodMap<z$1.ZodNumber, z$1.ZodUnknown>, z$1.ZodNullable<z$1.ZodCustom<Uint8Array<ArrayBufferLike>, Uint8Array<ArrayBufferLike>>>, z$1.ZodCustom<Uint8Array<ArrayBufferLike>, Uint8Array<ArrayBufferLike>>], null>, z$1.ZodObject<{
|
|
941
|
+
protected: z$1.ZodCustom<ProtectedHeaders, ProtectedHeaders>;
|
|
942
|
+
unprotected: z$1.ZodCustom<UnprotectedHeaders, UnprotectedHeaders>;
|
|
943
|
+
payload: z$1.ZodNullable<z$1.ZodCustom<Uint8Array<ArrayBufferLike>, Uint8Array<ArrayBufferLike>>>;
|
|
944
|
+
signature: z$1.ZodCustom<Uint8Array<ArrayBufferLike>, Uint8Array<ArrayBufferLike>>;
|
|
945
|
+
}, z$1.core.$strip>>;
|
|
946
|
+
detachedPayload?: Uint8Array;
|
|
947
|
+
externalAad?: Uint8Array;
|
|
948
|
+
get protectedHeaders(): ProtectedHeaders;
|
|
949
|
+
get unprotectedHeaders(): UnprotectedHeaders;
|
|
950
|
+
get payload(): Uint8Array<ArrayBufferLike> | null;
|
|
951
|
+
get signature(): Uint8Array<ArrayBufferLike>;
|
|
952
|
+
get certificateChain(): Uint8Array<ArrayBufferLike>[];
|
|
953
|
+
get certificate(): Uint8Array<ArrayBufferLike>;
|
|
954
|
+
getIssuingCountry(ctx: Pick<MdocContext, 'x509'>): string;
|
|
955
|
+
getIssuingStateOrProvince(ctx: Pick<MdocContext, 'x509'>): string;
|
|
956
|
+
get toBeSigned(): Uint8Array<ArrayBufferLike>;
|
|
957
|
+
/**
|
|
958
|
+
* Decodes CBOR bytes into a Sign1 instance.
|
|
959
|
+
* Uses the encodingSchema's decode() method to validate and transform the decoded data.
|
|
960
|
+
*/
|
|
961
|
+
static decode<T extends AnyCborStructure>(this: CborStructureStaticThis<T>, bytes: Uint8Array): T;
|
|
962
|
+
static toBeSigned(options: {
|
|
963
|
+
payload: Uint8Array;
|
|
964
|
+
protectedHeaders: ProtectedHeaders;
|
|
965
|
+
externalAad?: Uint8Array;
|
|
966
|
+
}): Uint8Array<ArrayBufferLike>;
|
|
967
|
+
get signatureAlgorithmName(): string;
|
|
968
|
+
get x5chain(): Uint8Array<ArrayBufferLike>[] | undefined;
|
|
969
|
+
verifySignature(options: {
|
|
970
|
+
key?: CoseKey;
|
|
971
|
+
}, ctx: Pick<MdocContext, 'cose' | 'x509'>): Promise<boolean>;
|
|
972
|
+
static create(options: Sign1Options, ctx: Pick<MdocContext, 'cose'>): Promise<Sign1>;
|
|
973
|
+
}
|
|
974
|
+
//#endregion
|
|
975
|
+
//#region src/context.d.ts
|
|
976
|
+
type MaybePromise<T> = Promise<T> | T;
|
|
977
|
+
interface MdocContext {
|
|
978
|
+
crypto: {
|
|
979
|
+
random: (length: number) => Uint8Array;
|
|
980
|
+
digest: (input: {
|
|
981
|
+
digestAlgorithm: DigestAlgorithm;
|
|
982
|
+
bytes: Uint8Array;
|
|
983
|
+
}) => MaybePromise<Uint8Array>;
|
|
984
|
+
calculateEphemeralMacKey: (input: {
|
|
985
|
+
privateKey: Uint8Array;
|
|
986
|
+
publicKey: Uint8Array;
|
|
987
|
+
sessionTranscriptBytes: Uint8Array;
|
|
988
|
+
info: 'EMacKey' | 'SKReader' | 'SKDevice';
|
|
989
|
+
}) => MaybePromise<CoseKey>;
|
|
990
|
+
};
|
|
991
|
+
cose: {
|
|
992
|
+
sign1: {
|
|
993
|
+
sign: (input: {
|
|
994
|
+
toBeSigned: Uint8Array;
|
|
995
|
+
key: CoseKey;
|
|
996
|
+
}) => MaybePromise<Uint8Array>;
|
|
997
|
+
verify(input: {
|
|
998
|
+
key: CoseKey;
|
|
999
|
+
sign1: Sign1;
|
|
1000
|
+
}): MaybePromise<boolean>;
|
|
1001
|
+
};
|
|
1002
|
+
mac0: {
|
|
1003
|
+
sign: (input: {
|
|
1004
|
+
key: CoseKey;
|
|
1005
|
+
toBeAuthenticated: Uint8Array;
|
|
1006
|
+
}) => MaybePromise<Uint8Array>;
|
|
1007
|
+
verify(input: {
|
|
1008
|
+
mac0: Mac0;
|
|
1009
|
+
key: CoseKey;
|
|
1010
|
+
}): MaybePromise<boolean>;
|
|
1011
|
+
};
|
|
1012
|
+
};
|
|
1013
|
+
x509: {
|
|
1014
|
+
getIssuerNameField: (input: {
|
|
1015
|
+
certificate: Uint8Array;
|
|
1016
|
+
field: string;
|
|
1017
|
+
}) => string[];
|
|
1018
|
+
getPublicKey: (input: {
|
|
1019
|
+
certificate: Uint8Array;
|
|
1020
|
+
alg: string;
|
|
1021
|
+
}) => MaybePromise<CoseKey>;
|
|
1022
|
+
verifyCertificateChain: (input: {
|
|
1023
|
+
trustedCertificates: Uint8Array[];
|
|
1024
|
+
x5chain: Uint8Array[];
|
|
1025
|
+
now?: Date;
|
|
1026
|
+
}) => MaybePromise<void>;
|
|
1027
|
+
getCertificateData: (input: {
|
|
1028
|
+
certificate: Uint8Array;
|
|
1029
|
+
}) => MaybePromise<{
|
|
1030
|
+
issuerName: string;
|
|
1031
|
+
subjectName: string;
|
|
1032
|
+
serialNumber: string;
|
|
1033
|
+
thumbprint: string;
|
|
1034
|
+
notBefore: Date;
|
|
1035
|
+
notAfter: Date;
|
|
1036
|
+
pem: string;
|
|
1037
|
+
}>;
|
|
1038
|
+
};
|
|
1039
|
+
}
|
|
1040
|
+
//#endregion
|
|
1041
|
+
//#region src/mdoc/models/data-element-identifier.d.ts
|
|
1042
|
+
type DataElementIdentifier = string;
|
|
1043
|
+
//#endregion
|
|
1044
|
+
//#region src/mdoc/models/data-element-value.d.ts
|
|
1045
|
+
type DataElementValue = unknown;
|
|
1046
|
+
//#endregion
|
|
1047
|
+
//#region src/mdoc/check-callback.d.ts
|
|
1048
|
+
interface VerificationAssessment {
|
|
1049
|
+
status: 'PASSED' | 'FAILED' | 'WARNING';
|
|
1050
|
+
category: 'DOCUMENT_FORMAT' | 'DEVICE_AUTH' | 'ISSUER_AUTH' | 'DATA_INTEGRITY' | 'READER_AUTH';
|
|
1051
|
+
check: string;
|
|
1052
|
+
reason?: string;
|
|
1053
|
+
}
|
|
1054
|
+
type VerificationCallback = (item: VerificationAssessment) => void;
|
|
1055
|
+
declare const defaultVerificationCallback: VerificationCallback;
|
|
1056
|
+
declare const onCategoryCheck: (onCheck: VerificationCallback, category: VerificationAssessment["category"]) => (item: Omit<VerificationAssessment, "category">) => void;
|
|
1057
|
+
//#endregion
|
|
1058
|
+
//#region src/mdoc/models/device-mac.d.ts
|
|
1059
|
+
type DeviceMacEncodedStructure = Mac0EncodedStructure;
|
|
1060
|
+
type DeviceMacDecodedStructure = Mac0DecodedStructure;
|
|
1061
|
+
type DeviceMacOptions = Mac0Options;
|
|
1062
|
+
declare class DeviceMac extends Mac0 {
|
|
1063
|
+
verify(options: {
|
|
1064
|
+
publicKey: CoseKey;
|
|
1065
|
+
privateKey: CoseKey;
|
|
1066
|
+
info?: 'EMacKey' | 'SKReader' | 'SKDevice';
|
|
1067
|
+
sessionTranscript: SessionTranscript | Uint8Array;
|
|
1068
|
+
}, ctx: Pick<MdocContext, 'crypto' | 'cose'>): Promise<boolean>;
|
|
1069
|
+
static create(options: DeviceMacOptions, ctx: Pick<MdocContext, 'cose' | 'crypto'>): Promise<DeviceMac>;
|
|
1070
|
+
}
|
|
1071
|
+
//#endregion
|
|
1072
|
+
//#region src/mdoc/models/device-signature.d.ts
|
|
1073
|
+
type DeviceSignatureEncodedStructure = Sign1EncodedStructure;
|
|
1074
|
+
type DeviceSignatureDecodedStructure = Sign1DecodedStructure;
|
|
1075
|
+
type DeviceSignatureOptions = Sign1Options;
|
|
1076
|
+
declare class DeviceSignature extends Sign1 {
|
|
1077
|
+
static create(options: DeviceSignatureOptions, ctx: Pick<MdocContext, 'cose'>): Promise<DeviceSignature>;
|
|
1078
|
+
}
|
|
1079
|
+
//#endregion
|
|
1080
|
+
//#region src/mdoc/models/device-key.d.ts
|
|
1081
|
+
type DeviceKeyDecodedStructure = CoseKeyDecodedStructure;
|
|
1082
|
+
type DeviceKeyEncodedStructure = CoseKeyEncodedStructure;
|
|
1083
|
+
type DeviceKeyOptions = CoseKeyOptions;
|
|
1084
|
+
declare class DeviceKey extends CoseKey {}
|
|
1085
|
+
//#endregion
|
|
1086
|
+
//#region src/mdoc/models/namespace.d.ts
|
|
1087
|
+
type Namespace = string;
|
|
1088
|
+
//#endregion
|
|
1089
|
+
//#region src/mdoc/models/key-authorizations.d.ts
|
|
1090
|
+
declare const keyAuthorizationsSchema: z.ZodCodec<z.ZodMap<z.ZodUnknown, z.ZodUnknown>, z.ZodCustom<TypedMap<{
|
|
1091
|
+
nameSpaces: string[];
|
|
1092
|
+
dataElements: Map<string, string[]>;
|
|
1093
|
+
}, "nameSpaces" | "dataElements">, TypedMap<{
|
|
1094
|
+
nameSpaces: string[];
|
|
1095
|
+
dataElements: Map<string, string[]>;
|
|
1096
|
+
}, "nameSpaces" | "dataElements">>>;
|
|
1097
|
+
type KeyAuthorizationsEncodedStructure = z.input<typeof keyAuthorizationsSchema>;
|
|
1098
|
+
type KeyAuthorizationsDecodedStructure = z.output<typeof keyAuthorizationsSchema>;
|
|
1099
|
+
type KeyAuthorizationsOptions = {
|
|
1100
|
+
namespaces?: Array<Namespace>;
|
|
1101
|
+
dataElements?: Map<Namespace, Array<DataElementIdentifier>>;
|
|
1102
|
+
};
|
|
1103
|
+
declare class KeyAuthorizations extends CborStructure<KeyAuthorizationsEncodedStructure, KeyAuthorizationsDecodedStructure> {
|
|
1104
|
+
static get encodingSchema(): z.ZodCodec<z.ZodMap<z.ZodUnknown, z.ZodUnknown>, z.ZodCustom<TypedMap<{
|
|
1105
|
+
nameSpaces: string[];
|
|
1106
|
+
dataElements: Map<string, string[]>;
|
|
1107
|
+
}, "nameSpaces" | "dataElements">, TypedMap<{
|
|
1108
|
+
nameSpaces: string[];
|
|
1109
|
+
dataElements: Map<string, string[]>;
|
|
1110
|
+
}, "nameSpaces" | "dataElements">>>;
|
|
1111
|
+
get namespaces(): string[] | undefined;
|
|
1112
|
+
get dataElements(): Map<string, string[]> | undefined;
|
|
1113
|
+
static create(options: KeyAuthorizationsOptions): KeyAuthorizations;
|
|
1114
|
+
}
|
|
1115
|
+
//#endregion
|
|
1116
|
+
//#region src/mdoc/models/key-info.d.ts
|
|
1117
|
+
declare const keyInfoSchema: z.ZodMap<z.ZodNumber, z.ZodUnknown>;
|
|
1118
|
+
type KeyInfoEncodedStructure = z.input<typeof keyInfoSchema>;
|
|
1119
|
+
type KeyInfoDecodedStructure = z.output<typeof keyInfoSchema>;
|
|
1120
|
+
type KeyInfoOptions = {
|
|
1121
|
+
keyInfo: Map<number, unknown>;
|
|
1122
|
+
};
|
|
1123
|
+
declare class KeyInfo extends CborStructure<KeyInfoEncodedStructure, KeyInfoDecodedStructure> {
|
|
1124
|
+
static get encodingSchema(): z.ZodMap<z.ZodNumber, z.ZodUnknown>;
|
|
1125
|
+
get keyInfo(): Map<number, unknown>;
|
|
1126
|
+
static create(options: KeyInfoOptions): KeyInfo;
|
|
1127
|
+
}
|
|
1128
|
+
//#endregion
|
|
1129
|
+
//#region src/mdoc/models/device-key-info.d.ts
|
|
1130
|
+
declare const deviceKeyInfoSchema: z.ZodCodec<z.ZodMap<z.ZodUnknown, z.ZodUnknown>, z.ZodCustom<TypedMap<{
|
|
1131
|
+
deviceKey: DeviceKey;
|
|
1132
|
+
keyAuthorizations: KeyAuthorizations;
|
|
1133
|
+
keyInfo: KeyInfo;
|
|
1134
|
+
}, "keyAuthorizations" | "keyInfo">, TypedMap<{
|
|
1135
|
+
deviceKey: DeviceKey;
|
|
1136
|
+
keyAuthorizations: KeyAuthorizations;
|
|
1137
|
+
keyInfo: KeyInfo;
|
|
1138
|
+
}, "keyAuthorizations" | "keyInfo">>>;
|
|
1139
|
+
type DeviceKeyInfoDecodedStructure = z.output<typeof deviceKeyInfoSchema>;
|
|
1140
|
+
type DeviceKeyInfoEncodedStructure = z.input<typeof deviceKeyInfoSchema>;
|
|
1141
|
+
type DeviceKeyInfoOptions = {
|
|
1142
|
+
deviceKey: DeviceKey;
|
|
1143
|
+
keyAuthorizations?: KeyAuthorizations;
|
|
1144
|
+
keyInfo?: KeyInfo;
|
|
1145
|
+
};
|
|
1146
|
+
declare class DeviceKeyInfo extends CborStructure<DeviceKeyInfoEncodedStructure, DeviceKeyInfoDecodedStructure> {
|
|
1147
|
+
static get encodingSchema(): z.ZodCodec<z.ZodMap<z.ZodUnknown, z.ZodUnknown>, z.ZodCustom<TypedMap<{
|
|
1148
|
+
deviceKey: DeviceKey;
|
|
1149
|
+
keyAuthorizations: KeyAuthorizations;
|
|
1150
|
+
keyInfo: KeyInfo;
|
|
1151
|
+
}, "keyAuthorizations" | "keyInfo">, TypedMap<{
|
|
1152
|
+
deviceKey: DeviceKey;
|
|
1153
|
+
keyAuthorizations: KeyAuthorizations;
|
|
1154
|
+
keyInfo: KeyInfo;
|
|
1155
|
+
}, "keyAuthorizations" | "keyInfo">>>;
|
|
1156
|
+
get deviceKey(): DeviceKey;
|
|
1157
|
+
get keyAuthorizations(): KeyAuthorizations | undefined;
|
|
1158
|
+
get keyInfo(): KeyInfo | undefined;
|
|
1159
|
+
static create(options: DeviceKeyInfoOptions): DeviceKeyInfo;
|
|
1160
|
+
}
|
|
1161
|
+
//#endregion
|
|
1162
|
+
//#region src/mdoc/models/doctype.d.ts
|
|
1163
|
+
type DocType = string;
|
|
1164
|
+
//#endregion
|
|
1165
|
+
//#region src/mdoc/models/validity-info.d.ts
|
|
1166
|
+
declare const validityInfoSchema: z.ZodCodec<z.ZodMap<z.ZodUnknown, z.ZodUnknown>, z.ZodCustom<TypedMap<{
|
|
1167
|
+
signed: Date;
|
|
1168
|
+
validFrom: Date;
|
|
1169
|
+
validUntil: Date;
|
|
1170
|
+
expectedUpdate: Date;
|
|
1171
|
+
}, "expectedUpdate">, TypedMap<{
|
|
1172
|
+
signed: Date;
|
|
1173
|
+
validFrom: Date;
|
|
1174
|
+
validUntil: Date;
|
|
1175
|
+
expectedUpdate: Date;
|
|
1176
|
+
}, "expectedUpdate">>>;
|
|
1177
|
+
type ValidityInfoEncodedStructure = z.input<typeof validityInfoSchema>;
|
|
1178
|
+
type ValidityInfoDecodedStructure = z.output<typeof validityInfoSchema>;
|
|
1179
|
+
type ValidityInfoOptions = {
|
|
1180
|
+
signed: Date;
|
|
1181
|
+
validFrom: Date;
|
|
1182
|
+
validUntil: Date;
|
|
1183
|
+
expectedUpdate?: Date;
|
|
1184
|
+
};
|
|
1185
|
+
declare class ValidityInfo extends CborStructure<ValidityInfoEncodedStructure, ValidityInfoDecodedStructure> {
|
|
1186
|
+
static get encodingSchema(): z.ZodCodec<z.ZodMap<z.ZodUnknown, z.ZodUnknown>, z.ZodCustom<TypedMap<{
|
|
1187
|
+
signed: Date;
|
|
1188
|
+
validFrom: Date;
|
|
1189
|
+
validUntil: Date;
|
|
1190
|
+
expectedUpdate: Date;
|
|
1191
|
+
}, "expectedUpdate">, TypedMap<{
|
|
1192
|
+
signed: Date;
|
|
1193
|
+
validFrom: Date;
|
|
1194
|
+
validUntil: Date;
|
|
1195
|
+
expectedUpdate: Date;
|
|
1196
|
+
}, "expectedUpdate">>>;
|
|
1197
|
+
get signed(): Date;
|
|
1198
|
+
get validFrom(): Date;
|
|
1199
|
+
get validUntil(): Date;
|
|
1200
|
+
get expectedUpdate(): Date | undefined;
|
|
1201
|
+
isSignedBetweenDates(notBefore: Date, notAfter: Date, skewSeconds?: number): boolean;
|
|
1202
|
+
isValidUntilAfterNow(now?: Date, skewSeconds?: number): boolean;
|
|
1203
|
+
isValidFromBeforeNow(now?: Date, skewSeconds?: number): boolean;
|
|
1204
|
+
static create(options: ValidityInfoOptions): ValidityInfo;
|
|
1205
|
+
}
|
|
1206
|
+
//#endregion
|
|
1207
|
+
//#region src/mdoc/models/digest-id.d.ts
|
|
1208
|
+
type DigestId = number;
|
|
1209
|
+
//#endregion
|
|
1210
|
+
//#region src/mdoc/models/value-digests.d.ts
|
|
1211
|
+
declare const valueDigestsSchema: z.ZodMap<z.ZodString, z.ZodMap<z.ZodNumber, z.ZodCustom<Uint8Array<ArrayBufferLike>, Uint8Array<ArrayBufferLike>>>>;
|
|
1212
|
+
type ValueDigestsStructure = z.infer<typeof valueDigestsSchema>;
|
|
1213
|
+
type ValueDigestOptions = {
|
|
1214
|
+
digests: ValueDigestsStructure;
|
|
1215
|
+
};
|
|
1216
|
+
declare class ValueDigests extends CborStructure<ValueDigestsStructure> {
|
|
1217
|
+
static get encodingSchema(): z.ZodMap<z.ZodString, z.ZodMap<z.ZodNumber, z.ZodCustom<Uint8Array<ArrayBufferLike>, Uint8Array<ArrayBufferLike>>>>;
|
|
1218
|
+
get valueDigests(): Map<string, Map<number, Uint8Array<ArrayBufferLike>>>;
|
|
1219
|
+
static create(options: ValueDigestOptions): ValueDigests;
|
|
1220
|
+
getDigestForNamespace(namespace: Namespace, digestId: DigestId): Uint8Array<ArrayBufferLike> | undefined;
|
|
1221
|
+
hasDigestForNamespace(namespace: Namespace, digestId: DigestId): boolean;
|
|
1222
|
+
getNamespaces(): Namespace[];
|
|
1223
|
+
getDigestIdsForNamespace(namespace: Namespace): DigestId[];
|
|
1224
|
+
}
|
|
1225
|
+
//#endregion
|
|
1226
|
+
//#region src/mdoc/models/mobile-security-object.d.ts
|
|
1227
|
+
declare const mobileSecurityObjectSchema: z.ZodCodec<z.ZodMap<z.ZodUnknown, z.ZodUnknown>, z.ZodCustom<TypedMap<{
|
|
1228
|
+
version: "1.0";
|
|
1229
|
+
docType: string;
|
|
1230
|
+
digestAlgorithm: "SHA-256" | "SHA-384" | "SHA-512";
|
|
1231
|
+
valueDigests: ValueDigests;
|
|
1232
|
+
deviceKeyInfo: DeviceKeyInfo;
|
|
1233
|
+
validityInfo: ValidityInfo;
|
|
1234
|
+
}, never>, TypedMap<{
|
|
1235
|
+
version: "1.0";
|
|
1236
|
+
docType: string;
|
|
1237
|
+
digestAlgorithm: "SHA-256" | "SHA-384" | "SHA-512";
|
|
1238
|
+
valueDigests: ValueDigests;
|
|
1239
|
+
deviceKeyInfo: DeviceKeyInfo;
|
|
1240
|
+
validityInfo: ValidityInfo;
|
|
1241
|
+
}, never>>>;
|
|
1242
|
+
type MobileSecurityObjectDecodedStructure = z.output<typeof mobileSecurityObjectSchema>;
|
|
1243
|
+
type MobileSecurityObjectEncodedStructure = z.input<typeof mobileSecurityObjectSchema>;
|
|
1244
|
+
type MobileSecurityObjectOptions = {
|
|
1245
|
+
version?: '1.0';
|
|
1246
|
+
digestAlgorithm: DigestAlgorithm;
|
|
1247
|
+
docType: DocType;
|
|
1248
|
+
valueDigests: ValueDigests;
|
|
1249
|
+
validityInfo: ValidityInfo;
|
|
1250
|
+
deviceKeyInfo: DeviceKeyInfo;
|
|
1251
|
+
};
|
|
1252
|
+
declare class MobileSecurityObject extends CborStructure<MobileSecurityObjectEncodedStructure, MobileSecurityObjectDecodedStructure> {
|
|
1253
|
+
static get encodingSchema(): z.ZodCodec<z.ZodMap<z.ZodUnknown, z.ZodUnknown>, z.ZodCustom<TypedMap<{
|
|
1254
|
+
version: "1.0";
|
|
1255
|
+
docType: string;
|
|
1256
|
+
digestAlgorithm: "SHA-256" | "SHA-384" | "SHA-512";
|
|
1257
|
+
valueDigests: ValueDigests;
|
|
1258
|
+
deviceKeyInfo: DeviceKeyInfo;
|
|
1259
|
+
validityInfo: ValidityInfo;
|
|
1260
|
+
}, never>, TypedMap<{
|
|
1261
|
+
version: "1.0";
|
|
1262
|
+
docType: string;
|
|
1263
|
+
digestAlgorithm: "SHA-256" | "SHA-384" | "SHA-512";
|
|
1264
|
+
valueDigests: ValueDigests;
|
|
1265
|
+
deviceKeyInfo: DeviceKeyInfo;
|
|
1266
|
+
validityInfo: ValidityInfo;
|
|
1267
|
+
}, never>>>;
|
|
1268
|
+
get version(): "1.0";
|
|
1269
|
+
get digestAlgorithm(): "SHA-256" | "SHA-384" | "SHA-512";
|
|
1270
|
+
get docType(): string;
|
|
1271
|
+
get validityInfo(): ValidityInfo;
|
|
1272
|
+
get valueDigests(): ValueDigests;
|
|
1273
|
+
get deviceKeyInfo(): DeviceKeyInfo;
|
|
1274
|
+
static create(options: MobileSecurityObjectOptions): MobileSecurityObject;
|
|
1275
|
+
}
|
|
1276
|
+
//#endregion
|
|
1277
|
+
//#region src/mdoc/models/issuer-auth.d.ts
|
|
1278
|
+
type IssuerAuthEncodedStructure = Sign1EncodedStructure;
|
|
1279
|
+
type IssuerAuthOptions = Omit<Sign1Options, 'payload'> & {
|
|
1280
|
+
payload?: Sign1Options['payload'] | MobileSecurityObject;
|
|
1281
|
+
};
|
|
1282
|
+
declare class IssuerAuth extends Sign1 {
|
|
1283
|
+
static create(options: IssuerAuthOptions, ctx: Pick<MdocContext, 'cose'>): Promise<IssuerAuth>;
|
|
1284
|
+
get mobileSecurityObject(): MobileSecurityObject;
|
|
1285
|
+
verify(options: {
|
|
1286
|
+
verificationCallback?: VerificationCallback;
|
|
1287
|
+
now?: Date;
|
|
1288
|
+
trustedCertificates?: Array<Uint8Array>;
|
|
1289
|
+
disableCertificateChainValidation?: boolean;
|
|
1290
|
+
skewSeconds?: number;
|
|
1291
|
+
}, ctx: Pick<MdocContext, 'x509' | 'cose'>): Promise<void>;
|
|
1292
|
+
}
|
|
1293
|
+
//#endregion
|
|
1294
|
+
//#region src/mdoc/models/issuer-signed-item.d.ts
|
|
1295
|
+
declare const issuerSignedItemSchema: z.ZodCodec<z.ZodMap<z.ZodUnknown, z.ZodUnknown>, z.ZodCustom<TypedMap<{
|
|
1296
|
+
digestID: number;
|
|
1297
|
+
random: Uint8Array<ArrayBufferLike>;
|
|
1298
|
+
elementIdentifier: string;
|
|
1299
|
+
elementValue: unknown;
|
|
1300
|
+
}, never>, TypedMap<{
|
|
1301
|
+
digestID: number;
|
|
1302
|
+
random: Uint8Array<ArrayBufferLike>;
|
|
1303
|
+
elementIdentifier: string;
|
|
1304
|
+
elementValue: unknown;
|
|
1305
|
+
}, never>>>;
|
|
1306
|
+
type IssuerSignedItemEncodedStructure = z.input<typeof issuerSignedItemSchema>;
|
|
1307
|
+
type IssuerSignedItemDecodedStructure = z.output<typeof issuerSignedItemSchema>;
|
|
1308
|
+
type IssuerSignedItemOptions = {
|
|
1309
|
+
digestId: number;
|
|
1310
|
+
random: Uint8Array;
|
|
1311
|
+
elementIdentifier: DataElementIdentifier;
|
|
1312
|
+
elementValue: DataElementValue;
|
|
1313
|
+
};
|
|
1314
|
+
declare class IssuerSignedItem extends CborStructure<IssuerSignedItemEncodedStructure, IssuerSignedItemDecodedStructure> {
|
|
1315
|
+
static get encodingSchema(): z.ZodCodec<z.ZodMap<z.ZodUnknown, z.ZodUnknown>, z.ZodCustom<TypedMap<{
|
|
1316
|
+
digestID: number;
|
|
1317
|
+
random: Uint8Array<ArrayBufferLike>;
|
|
1318
|
+
elementIdentifier: string;
|
|
1319
|
+
elementValue: unknown;
|
|
1320
|
+
}, never>, TypedMap<{
|
|
1321
|
+
digestID: number;
|
|
1322
|
+
random: Uint8Array<ArrayBufferLike>;
|
|
1323
|
+
elementIdentifier: string;
|
|
1324
|
+
elementValue: unknown;
|
|
1325
|
+
}, never>>>;
|
|
1326
|
+
get random(): Uint8Array<ArrayBufferLike>;
|
|
1327
|
+
get elementIdentifier(): string;
|
|
1328
|
+
get elementValue(): unknown;
|
|
1329
|
+
get digestId(): number;
|
|
1330
|
+
isValid(namespace: Namespace, issuerAuth: IssuerAuth, ctx: Pick<MdocContext, 'crypto'>): Promise<boolean>;
|
|
1331
|
+
matchCertificate(issuerAuth: IssuerAuth, ctx: Pick<MdocContext, 'x509'>): boolean;
|
|
1332
|
+
static fromOptions(options: IssuerSignedItemOptions): IssuerSignedItem;
|
|
1333
|
+
}
|
|
1334
|
+
//#endregion
|
|
1335
|
+
//#region src/mdoc/models/device-signed-items.d.ts
|
|
1336
|
+
declare const deviceSignedItemsSchema: z.ZodMap<z.ZodString, z.ZodUnknown>;
|
|
1337
|
+
type DeviceSignedItemsStructure = z.infer<typeof deviceSignedItemsSchema>;
|
|
1338
|
+
type DeviceSignedItemsOptions = {
|
|
1339
|
+
deviceSignedItems: Map<DataElementIdentifier, DataElementValue>;
|
|
1340
|
+
};
|
|
1341
|
+
declare class DeviceSignedItems extends CborStructure<DeviceSignedItemsStructure> {
|
|
1342
|
+
static get encodingSchema(): z.ZodMap<z.ZodString, z.ZodUnknown>;
|
|
1343
|
+
get deviceSignedItems(): Map<string, unknown>;
|
|
1344
|
+
static create(options: DeviceSignedItemsOptions): DeviceSignedItems;
|
|
1345
|
+
}
|
|
1346
|
+
//#endregion
|
|
1347
|
+
//#region src/mdoc/models/device-namespaces.d.ts
|
|
1348
|
+
declare const deviceNamespacesEncodedSchema: z.ZodMap<z.ZodString, z.ZodMap<z.ZodString, z.ZodUnknown>>;
|
|
1349
|
+
declare const deviceNamespacesDecodedSchema: z.ZodMap<z.ZodString, z.ZodCustom<DeviceSignedItems, DeviceSignedItems>>;
|
|
1350
|
+
type DeviceNamespacesDecodedStructure = z.infer<typeof deviceNamespacesDecodedSchema>;
|
|
1351
|
+
type DeviceNamespacesEncodedStructure = z.infer<typeof deviceNamespacesEncodedSchema>;
|
|
1352
|
+
type DeviceNamespacesOptions = {
|
|
1353
|
+
deviceNamespaces: Map<Namespace, DeviceSignedItems>;
|
|
1354
|
+
};
|
|
1355
|
+
declare class DeviceNamespaces extends CborStructure<DeviceNamespacesEncodedStructure, DeviceNamespacesDecodedStructure> {
|
|
1356
|
+
static get encodingSchema(): z.ZodCodec<z.ZodMap<z.ZodString, z.ZodMap<z.ZodString, z.ZodUnknown>>, z.ZodMap<z.ZodString, z.ZodCustom<DeviceSignedItems, DeviceSignedItems>>>;
|
|
1357
|
+
get deviceNamespaces(): Map<string, DeviceSignedItems>;
|
|
1358
|
+
static create(options: DeviceNamespacesOptions): DeviceNamespaces;
|
|
1359
|
+
}
|
|
1360
|
+
//#endregion
|
|
1361
|
+
//#region src/mdoc/models/device-signed.d.ts
|
|
1362
|
+
declare const deviceSignedSchema: z.ZodCodec<z.ZodMap<z.ZodUnknown, z.ZodUnknown>, z.ZodCustom<TypedMap<{
|
|
1363
|
+
nameSpaces: DeviceNamespaces;
|
|
1364
|
+
deviceAuth: DeviceAuth;
|
|
1365
|
+
}, never>, TypedMap<{
|
|
1366
|
+
nameSpaces: DeviceNamespaces;
|
|
1367
|
+
deviceAuth: DeviceAuth;
|
|
1368
|
+
}, never>>>;
|
|
1369
|
+
type DeviceSignedDecodedStructure = z.output<typeof deviceSignedSchema>;
|
|
1370
|
+
type DeviceSignedEncodedStructure = z.input<typeof deviceSignedSchema>;
|
|
1371
|
+
type DeviceSignedOptions = {
|
|
1372
|
+
deviceNamespaces: DeviceNamespaces;
|
|
1373
|
+
deviceAuth: DeviceAuth;
|
|
1374
|
+
};
|
|
1375
|
+
declare class DeviceSigned extends CborStructure<DeviceSignedEncodedStructure, DeviceSignedDecodedStructure> {
|
|
1376
|
+
static get encodingSchema(): z.ZodCodec<z.ZodMap<z.ZodUnknown, z.ZodUnknown>, z.ZodCustom<TypedMap<{
|
|
1377
|
+
nameSpaces: DeviceNamespaces;
|
|
1378
|
+
deviceAuth: DeviceAuth;
|
|
1379
|
+
}, never>, TypedMap<{
|
|
1380
|
+
nameSpaces: DeviceNamespaces;
|
|
1381
|
+
deviceAuth: DeviceAuth;
|
|
1382
|
+
}, never>>>;
|
|
1383
|
+
get deviceNamespaces(): DeviceNamespaces;
|
|
1384
|
+
get deviceAuth(): DeviceAuth;
|
|
1385
|
+
static create(options: DeviceSignedOptions): DeviceSigned;
|
|
1386
|
+
}
|
|
1387
|
+
//#endregion
|
|
1388
|
+
//#region src/mdoc/models/error-code.d.ts
|
|
1389
|
+
type ErrorCode = number;
|
|
1390
|
+
//#endregion
|
|
1391
|
+
//#region src/mdoc/models/error-items.d.ts
|
|
1392
|
+
declare const errorItemsSchema: z$1.ZodMap<z$1.ZodString, z$1.ZodNumber>;
|
|
1393
|
+
type ErrorItemsStructure = Map<DataElementIdentifier, ErrorCode>;
|
|
1394
|
+
type ErrorItemsOptions = {
|
|
1395
|
+
errorItems: ErrorItemsStructure;
|
|
1396
|
+
};
|
|
1397
|
+
declare class ErrorItems extends CborStructure<ErrorItemsStructure> {
|
|
1398
|
+
static get encodingSchema(): z$1.ZodMap<z$1.ZodString, z$1.ZodNumber>;
|
|
1399
|
+
static create(options: ErrorItemsOptions): ErrorItems;
|
|
1400
|
+
}
|
|
1401
|
+
//#endregion
|
|
1402
|
+
//#region src/mdoc/models/issuer-namespaces.d.ts
|
|
1403
|
+
declare const issuerNamespacesEncodedSchema: z$1.ZodMap<z$1.ZodString, z$1.ZodArray<z$1.ZodCustom<DataItem<unknown>, DataItem<unknown>>>>;
|
|
1404
|
+
declare const issuerNamespacesDecodedSchema: z$1.ZodMap<z$1.ZodString, z$1.ZodArray<z$1.ZodCustom<IssuerSignedItem, IssuerSignedItem>>>;
|
|
1405
|
+
type IssuerNamespacesEncodedStructure = z$1.infer<typeof issuerNamespacesEncodedSchema>;
|
|
1406
|
+
type IssuerNamespacesDecodedStructure = z$1.infer<typeof issuerNamespacesDecodedSchema>;
|
|
1407
|
+
type IssuerNamespacesOptions = {
|
|
1408
|
+
issuerNamespaces: IssuerNamespacesDecodedStructure;
|
|
1409
|
+
};
|
|
1410
|
+
declare class IssuerNamespaces extends CborStructure<IssuerNamespacesEncodedStructure, IssuerNamespacesDecodedStructure> {
|
|
1411
|
+
static get encodingSchema(): z$1.ZodCodec<z$1.ZodMap<z$1.ZodString, z$1.ZodArray<z$1.ZodCustom<DataItem<unknown>, DataItem<unknown>>>>, z$1.ZodMap<z$1.ZodString, z$1.ZodArray<z$1.ZodCustom<IssuerSignedItem, IssuerSignedItem>>>>;
|
|
1412
|
+
get issuerNamespaces(): Map<string, IssuerSignedItem[]>;
|
|
1413
|
+
getIssuerNamespace(namespace: string): IssuerSignedItem[] | undefined;
|
|
1414
|
+
setIssuerNamespace(namespace: string, issuerSignedItems: IssuerSignedItem[]): Map<string, IssuerSignedItem[]>;
|
|
1415
|
+
static create(options: IssuerNamespacesOptions): IssuerNamespaces;
|
|
1416
|
+
}
|
|
1417
|
+
//#endregion
|
|
1418
|
+
//#region src/mdoc/models/issuer-signed.d.ts
|
|
1419
|
+
declare const issuerSignedSchema: z.ZodCodec<z.ZodMap<z.ZodUnknown, z.ZodUnknown>, z.ZodCustom<TypedMap<{
|
|
1420
|
+
nameSpaces: IssuerNamespaces;
|
|
1421
|
+
issuerAuth: IssuerAuth;
|
|
1422
|
+
}, never>, TypedMap<{
|
|
1423
|
+
nameSpaces: IssuerNamespaces;
|
|
1424
|
+
issuerAuth: IssuerAuth;
|
|
1425
|
+
}, never>>>;
|
|
1426
|
+
type IssuerSignedDecodedStructure = z.output<typeof issuerSignedSchema>;
|
|
1427
|
+
type IssuerSignedEncodedStructure = z.input<typeof issuerSignedSchema>;
|
|
1428
|
+
type IssuerSignedOptions = {
|
|
1429
|
+
issuerNamespaces?: IssuerNamespaces;
|
|
1430
|
+
issuerAuth: IssuerAuth;
|
|
1431
|
+
};
|
|
1432
|
+
declare class IssuerSigned extends CborStructure<IssuerSignedEncodedStructure, IssuerSignedDecodedStructure> {
|
|
1433
|
+
static get encodingSchema(): z.ZodCodec<z.ZodMap<z.ZodUnknown, z.ZodUnknown>, z.ZodCustom<TypedMap<{
|
|
1434
|
+
nameSpaces: IssuerNamespaces;
|
|
1435
|
+
issuerAuth: IssuerAuth;
|
|
1436
|
+
}, never>, TypedMap<{
|
|
1437
|
+
nameSpaces: IssuerNamespaces;
|
|
1438
|
+
issuerAuth: IssuerAuth;
|
|
1439
|
+
}, never>>>;
|
|
1440
|
+
get issuerNamespaces(): IssuerNamespaces;
|
|
1441
|
+
get issuerAuth(): IssuerAuth;
|
|
1442
|
+
getIssuerNamespace(namespace: Namespace): IssuerSignedItem[] | undefined;
|
|
1443
|
+
getPrettyClaims(namespace: Namespace): {} | undefined;
|
|
1444
|
+
get encodedForOid4Vci(): string;
|
|
1445
|
+
static fromEncodedForOid4Vci(encoded: string): IssuerSigned;
|
|
1446
|
+
verify(options: {
|
|
1447
|
+
verificationCallback?: VerificationCallback;
|
|
1448
|
+
}, ctx: Pick<MdocContext, 'x509' | 'crypto'>): Promise<void>;
|
|
1449
|
+
static create(options: IssuerSignedOptions): IssuerSigned;
|
|
1450
|
+
}
|
|
1451
|
+
//#endregion
|
|
1452
|
+
//#region src/mdoc/models/document.d.ts
|
|
1453
|
+
declare const documentSchema: z.ZodCodec<z.ZodMap<z.ZodUnknown, z.ZodUnknown>, z.ZodCustom<TypedMap<{
|
|
1454
|
+
errors: Map<string, unknown>;
|
|
1455
|
+
docType: string;
|
|
1456
|
+
issuerSigned: IssuerSigned;
|
|
1457
|
+
deviceSigned: DeviceSigned;
|
|
1458
|
+
}, "errors">, TypedMap<{
|
|
1459
|
+
errors: Map<string, unknown>;
|
|
1460
|
+
docType: string;
|
|
1461
|
+
issuerSigned: IssuerSigned;
|
|
1462
|
+
deviceSigned: DeviceSigned;
|
|
1463
|
+
}, "errors">>>;
|
|
1464
|
+
type DocumentDecodedStructure = z.output<typeof documentSchema>;
|
|
1465
|
+
type DocumentEncodedStructure = z.input<typeof documentSchema>;
|
|
1466
|
+
type DocumentOptions = {
|
|
1467
|
+
docType: DocType;
|
|
1468
|
+
issuerSigned: IssuerSigned;
|
|
1469
|
+
deviceSigned: DeviceSigned;
|
|
1470
|
+
errors?: Map<Namespace, ErrorItems>;
|
|
1471
|
+
};
|
|
1472
|
+
declare class Document extends CborStructure<DocumentEncodedStructure, DocumentDecodedStructure> {
|
|
1473
|
+
static get encodingSchema(): z.ZodCodec<z.ZodMap<z.ZodUnknown, z.ZodUnknown>, z.ZodCustom<TypedMap<{
|
|
1474
|
+
errors: Map<string, unknown>;
|
|
1475
|
+
docType: string;
|
|
1476
|
+
issuerSigned: IssuerSigned;
|
|
1477
|
+
deviceSigned: DeviceSigned;
|
|
1478
|
+
}, "errors">, TypedMap<{
|
|
1479
|
+
errors: Map<string, unknown>;
|
|
1480
|
+
docType: string;
|
|
1481
|
+
issuerSigned: IssuerSigned;
|
|
1482
|
+
deviceSigned: DeviceSigned;
|
|
1483
|
+
}, "errors">>>;
|
|
1484
|
+
get docType(): string;
|
|
1485
|
+
get issuerSigned(): IssuerSigned;
|
|
1486
|
+
get deviceSigned(): DeviceSigned;
|
|
1487
|
+
get errors(): Map<string, unknown> | undefined;
|
|
1488
|
+
getIssuerNamespace(namespace: Namespace): IssuerSignedItem[] | undefined;
|
|
1489
|
+
static create(options: DocumentOptions): Document;
|
|
1490
|
+
}
|
|
1491
|
+
//#endregion
|
|
1492
|
+
//#region src/mdoc/models/device-auth.d.ts
|
|
1493
|
+
declare const deviceAuthSchema: z.ZodCodec<z.ZodMap<z.ZodUnknown, z.ZodUnknown>, z.ZodCustom<TypedMap<{
|
|
1494
|
+
deviceSignature: DeviceSignature;
|
|
1495
|
+
deviceMac: DeviceMac;
|
|
1496
|
+
}, "deviceSignature" | "deviceMac">, TypedMap<{
|
|
1497
|
+
deviceSignature: DeviceSignature;
|
|
1498
|
+
deviceMac: DeviceMac;
|
|
1499
|
+
}, "deviceSignature" | "deviceMac">>>;
|
|
1500
|
+
type DeviceAuthDecodedStructure = z.output<typeof deviceAuthSchema>;
|
|
1501
|
+
type DeviceAuthEncodedStructure = z.input<typeof deviceAuthSchema>;
|
|
1502
|
+
type DeviceAuthOptions = {
|
|
1503
|
+
deviceSignature?: DeviceSignature;
|
|
1504
|
+
deviceMac?: DeviceMac;
|
|
1505
|
+
};
|
|
1506
|
+
declare class DeviceAuth extends CborStructure<DeviceAuthEncodedStructure, DeviceAuthDecodedStructure> {
|
|
1507
|
+
static get encodingSchema(): z.ZodCodec<z.ZodMap<z.ZodUnknown, z.ZodUnknown>, z.ZodCustom<TypedMap<{
|
|
1508
|
+
deviceSignature: DeviceSignature;
|
|
1509
|
+
deviceMac: DeviceMac;
|
|
1510
|
+
}, "deviceSignature" | "deviceMac">, TypedMap<{
|
|
1511
|
+
deviceSignature: DeviceSignature;
|
|
1512
|
+
deviceMac: DeviceMac;
|
|
1513
|
+
}, "deviceSignature" | "deviceMac">>>;
|
|
1514
|
+
get deviceSignature(): DeviceSignature | undefined;
|
|
1515
|
+
get deviceMac(): DeviceMac | undefined;
|
|
1516
|
+
verify(options: {
|
|
1517
|
+
document: Document;
|
|
1518
|
+
verificationCallback?: VerificationCallback;
|
|
1519
|
+
ephemeralMacPrivateKey?: CoseKey;
|
|
1520
|
+
sessionTranscript: SessionTranscript | Uint8Array;
|
|
1521
|
+
}, ctx: Pick<MdocContext, 'crypto' | 'cose'>): Promise<void>;
|
|
1522
|
+
static create(options: DeviceAuthOptions): DeviceAuth;
|
|
1523
|
+
}
|
|
1524
|
+
//#endregion
|
|
1525
|
+
//#region src/mdoc/models/device-authentication.d.ts
|
|
1526
|
+
declare const deviceAuthenticationEncodedSchema: z.ZodTuple<[z.ZodLiteral<"DeviceAuthentication">, z.ZodTuple<[z.ZodNullable<z.ZodCustom<DataItem<Map<unknown, unknown>>, DataItem<Map<unknown, unknown>>>>, z.ZodNullable<z.ZodCustom<DataItem<Map<unknown, unknown>>, DataItem<Map<unknown, unknown>>>>, z.ZodUnknown], null>, z.ZodString, z.ZodCustom<DataItem<Map<string, Map<string, unknown>>>, DataItem<Map<string, Map<string, unknown>>>>], null>;
|
|
1527
|
+
declare const deviceAuthenticationDecodedSchema: z.ZodObject<{
|
|
1528
|
+
sessionTranscript: z.ZodCustom<SessionTranscript, SessionTranscript>;
|
|
1529
|
+
docType: z.ZodString;
|
|
1530
|
+
deviceNamespaces: z.ZodCustom<DeviceNamespaces, DeviceNamespaces>;
|
|
1531
|
+
}, z.core.$strip>;
|
|
1532
|
+
type DeviceAuthenticationDecodedStructure = z.infer<typeof deviceAuthenticationDecodedSchema>;
|
|
1533
|
+
type DeviceAuthenticationEncodedStructure = z.infer<typeof deviceAuthenticationEncodedSchema>;
|
|
1534
|
+
type DeviceAuthenticationOptions = {
|
|
1535
|
+
sessionTranscript: SessionTranscript | Uint8Array;
|
|
1536
|
+
docType: DocType;
|
|
1537
|
+
deviceNamespaces: DeviceNamespaces;
|
|
1538
|
+
};
|
|
1539
|
+
declare class DeviceAuthentication extends CborStructure<DeviceAuthenticationEncodedStructure, DeviceAuthenticationDecodedStructure> {
|
|
1540
|
+
static get encodingSchema(): z.ZodCodec<z.ZodTuple<[z.ZodLiteral<"DeviceAuthentication">, z.ZodTuple<[z.ZodNullable<z.ZodCustom<DataItem<Map<unknown, unknown>>, DataItem<Map<unknown, unknown>>>>, z.ZodNullable<z.ZodCustom<DataItem<Map<unknown, unknown>>, DataItem<Map<unknown, unknown>>>>, z.ZodUnknown], null>, z.ZodString, z.ZodCustom<DataItem<Map<string, Map<string, unknown>>>, DataItem<Map<string, Map<string, unknown>>>>], null>, z.ZodObject<{
|
|
1541
|
+
sessionTranscript: z.ZodCustom<SessionTranscript, SessionTranscript>;
|
|
1542
|
+
docType: z.ZodString;
|
|
1543
|
+
deviceNamespaces: z.ZodCustom<DeviceNamespaces, DeviceNamespaces>;
|
|
1544
|
+
}, z.core.$strip>>;
|
|
1545
|
+
get sessionTranscript(): SessionTranscript;
|
|
1546
|
+
get docType(): string;
|
|
1547
|
+
get deviceNamespaces(): DeviceNamespaces;
|
|
1548
|
+
static create(options: DeviceAuthenticationOptions): DeviceAuthentication;
|
|
1549
|
+
}
|
|
1550
|
+
//#endregion
|
|
1551
|
+
//#region src/mdoc/models/intent-to-retain.d.ts
|
|
1552
|
+
type IntentToRetain = boolean;
|
|
1553
|
+
//#endregion
|
|
1554
|
+
//#region src/mdoc/models/items-request.d.ts
|
|
1555
|
+
declare const namespacesSchema: z.ZodMap<z.ZodString, z.ZodMap<z.ZodString, z.ZodBoolean>>;
|
|
1556
|
+
declare const itemsRequestSchema: z.ZodCodec<z.ZodMap<z.ZodUnknown, z.ZodUnknown>, z.ZodCustom<TypedMap<{
|
|
1557
|
+
docType: string;
|
|
1558
|
+
nameSpaces: Map<string, Map<string, boolean>>;
|
|
1559
|
+
}, never>, TypedMap<{
|
|
1560
|
+
docType: string;
|
|
1561
|
+
nameSpaces: Map<string, Map<string, boolean>>;
|
|
1562
|
+
}, never>>>;
|
|
1563
|
+
type ItemsRequestEncodedStructure = z.input<typeof itemsRequestSchema>;
|
|
1564
|
+
type ItemsRequestDecodedStructure = z.output<typeof itemsRequestSchema>;
|
|
1565
|
+
type NamespacesStructure = z.infer<typeof namespacesSchema>;
|
|
1566
|
+
type ItemsRequestOptions = {
|
|
1567
|
+
docType: DocType;
|
|
1568
|
+
namespaces: NamespacesStructure | Record<Namespace, Record<DataElementIdentifier, IntentToRetain>>;
|
|
1569
|
+
};
|
|
1570
|
+
declare class ItemsRequest extends CborStructure<ItemsRequestEncodedStructure, ItemsRequestDecodedStructure> {
|
|
1571
|
+
static get encodingSchema(): z.ZodCodec<z.ZodMap<z.ZodUnknown, z.ZodUnknown>, z.ZodCustom<TypedMap<{
|
|
1572
|
+
docType: string;
|
|
1573
|
+
nameSpaces: Map<string, Map<string, boolean>>;
|
|
1574
|
+
}, never>, TypedMap<{
|
|
1575
|
+
docType: string;
|
|
1576
|
+
nameSpaces: Map<string, Map<string, boolean>>;
|
|
1577
|
+
}, never>>>;
|
|
1578
|
+
get docType(): string;
|
|
1579
|
+
get namespaces(): Map<string, Map<string, boolean>>;
|
|
1580
|
+
static create(options: ItemsRequestOptions): ItemsRequest;
|
|
1581
|
+
}
|
|
1582
|
+
//#endregion
|
|
1583
|
+
//#region src/mdoc/models/reader-authentication.d.ts
|
|
1584
|
+
declare const readerAuthenticationEncodedSchema: z.ZodTuple<[z.ZodLiteral<"ReaderAuthentication">, z.ZodTuple<[z.ZodNullable<z.ZodCustom<DataItem<Map<unknown, unknown>>, DataItem<Map<unknown, unknown>>>>, z.ZodNullable<z.ZodCustom<DataItem<Map<unknown, unknown>>, DataItem<Map<unknown, unknown>>>>, z.ZodUnknown], null>, z.ZodCustom<DataItem<Map<unknown, unknown>>, DataItem<Map<unknown, unknown>>>], null>;
|
|
1585
|
+
declare const readerAuthenticationDecodedSchema: z.ZodObject<{
|
|
1586
|
+
sessionTranscript: z.ZodCustom<SessionTranscript, SessionTranscript>;
|
|
1587
|
+
itemsRequest: z.ZodCustom<ItemsRequest, ItemsRequest>;
|
|
1588
|
+
}, z.core.$strip>;
|
|
1589
|
+
type ReaderAuthenticationDecodedStructure = z.infer<typeof readerAuthenticationDecodedSchema>;
|
|
1590
|
+
type ReaderAuthenticationEncodedStructure = z.infer<typeof readerAuthenticationEncodedSchema>;
|
|
1591
|
+
type ReaderAuthenticationOptions = {
|
|
1592
|
+
sessionTranscript: SessionTranscript;
|
|
1593
|
+
itemsRequest: ItemsRequest;
|
|
1594
|
+
};
|
|
1595
|
+
declare class ReaderAuthentication extends CborStructure<ReaderAuthenticationEncodedStructure, ReaderAuthenticationDecodedStructure> {
|
|
1596
|
+
static get encodingSchema(): z.ZodCodec<z.ZodTuple<[z.ZodLiteral<"ReaderAuthentication">, z.ZodTuple<[z.ZodNullable<z.ZodCustom<DataItem<Map<unknown, unknown>>, DataItem<Map<unknown, unknown>>>>, z.ZodNullable<z.ZodCustom<DataItem<Map<unknown, unknown>>, DataItem<Map<unknown, unknown>>>>, z.ZodUnknown], null>, z.ZodCustom<DataItem<Map<unknown, unknown>>, DataItem<Map<unknown, unknown>>>], null>, z.ZodObject<{
|
|
1597
|
+
sessionTranscript: z.ZodCustom<SessionTranscript, SessionTranscript>;
|
|
1598
|
+
itemsRequest: z.ZodCustom<ItemsRequest, ItemsRequest>;
|
|
1599
|
+
}, z.core.$strip>>;
|
|
1600
|
+
get sessionTranscript(): SessionTranscript;
|
|
1601
|
+
get itemsRequest(): ItemsRequest;
|
|
1602
|
+
static create(options: ReaderAuthenticationOptions): ReaderAuthentication;
|
|
1603
|
+
}
|
|
1604
|
+
//#endregion
|
|
1605
|
+
//#region src/mdoc/models/reader-auth.d.ts
|
|
1606
|
+
type ReaderAuthEncodedStructure = Sign1EncodedStructure;
|
|
1607
|
+
type ReaderAuthDecodedStructure = Sign1DecodedStructure;
|
|
1608
|
+
type ReaderAuthOptions = Sign1Options;
|
|
1609
|
+
declare class ReaderAuth extends Sign1 {
|
|
1610
|
+
verify(options: {
|
|
1611
|
+
readerAuthentication: ReaderAuthentication | ReaderAuthenticationOptions;
|
|
1612
|
+
verificationCallback?: VerificationCallback;
|
|
1613
|
+
}, ctx: Pick<MdocContext, 'cose' | 'x509'>): Promise<void>;
|
|
1614
|
+
static create(options: ReaderAuthOptions, ctx: Pick<MdocContext, 'cose'>): Promise<ReaderAuth>;
|
|
1615
|
+
}
|
|
1616
|
+
//#endregion
|
|
1617
|
+
//#region src/mdoc/models/doc-request.d.ts
|
|
1618
|
+
declare const docRequestSchema: z.ZodCodec<z.ZodMap<z.ZodUnknown, z.ZodUnknown>, z.ZodCustom<TypedMap<{
|
|
1619
|
+
itemsRequest: ItemsRequest;
|
|
1620
|
+
readerAuth: ReaderAuth;
|
|
1621
|
+
}, "readerAuth">, TypedMap<{
|
|
1622
|
+
itemsRequest: ItemsRequest;
|
|
1623
|
+
readerAuth: ReaderAuth;
|
|
1624
|
+
}, "readerAuth">>>;
|
|
1625
|
+
type DocRequestDecodedStructure = z.output<typeof docRequestSchema>;
|
|
1626
|
+
type DocRequestEncodedStructure = z.input<typeof docRequestSchema>;
|
|
1627
|
+
type DocRequestOptions = {
|
|
1628
|
+
itemsRequest: ItemsRequest;
|
|
1629
|
+
readerAuth?: ReaderAuth;
|
|
1630
|
+
};
|
|
1631
|
+
declare class DocRequest extends CborStructure<DocRequestEncodedStructure, DocRequestDecodedStructure> {
|
|
1632
|
+
static get encodingSchema(): z.ZodCodec<z.ZodMap<z.ZodUnknown, z.ZodUnknown>, z.ZodCustom<TypedMap<{
|
|
1633
|
+
itemsRequest: ItemsRequest;
|
|
1634
|
+
readerAuth: ReaderAuth;
|
|
1635
|
+
}, "readerAuth">, TypedMap<{
|
|
1636
|
+
itemsRequest: ItemsRequest;
|
|
1637
|
+
readerAuth: ReaderAuth;
|
|
1638
|
+
}, "readerAuth">>>;
|
|
1639
|
+
get itemsRequest(): ItemsRequest;
|
|
1640
|
+
get readerAuth(): ReaderAuth | undefined;
|
|
1641
|
+
static create(options: DocRequestOptions): DocRequest;
|
|
1642
|
+
}
|
|
1643
|
+
//#endregion
|
|
1644
|
+
//#region src/mdoc/models/device-request.d.ts
|
|
1645
|
+
declare const deviceRequestSchema: z.ZodCodec<z.ZodMap<z.ZodUnknown, z.ZodUnknown>, z.ZodCustom<TypedMap<{
|
|
1646
|
+
version: string;
|
|
1647
|
+
docRequests: DocRequest[];
|
|
1648
|
+
}, never>, TypedMap<{
|
|
1649
|
+
version: string;
|
|
1650
|
+
docRequests: DocRequest[];
|
|
1651
|
+
}, never>>>;
|
|
1652
|
+
type DeviceRequestDecodedStructure = z.output<typeof deviceRequestSchema>;
|
|
1653
|
+
type DeviceRequestEncodedStructure = z.input<typeof deviceRequestSchema>;
|
|
1654
|
+
type DeviceRequestOptions = {
|
|
1655
|
+
version?: string;
|
|
1656
|
+
docRequests: Array<DocRequest>;
|
|
1657
|
+
};
|
|
1658
|
+
declare class DeviceRequest extends CborStructure<DeviceRequestEncodedStructure, DeviceRequestDecodedStructure> {
|
|
1659
|
+
static get encodingSchema(): z.ZodCodec<z.ZodMap<z.ZodUnknown, z.ZodUnknown>, z.ZodCustom<TypedMap<{
|
|
1660
|
+
version: string;
|
|
1661
|
+
docRequests: DocRequest[];
|
|
1662
|
+
}, never>, TypedMap<{
|
|
1663
|
+
version: string;
|
|
1664
|
+
docRequests: DocRequest[];
|
|
1665
|
+
}, never>>>;
|
|
1666
|
+
get version(): string;
|
|
1667
|
+
get docRequests(): DocRequest[];
|
|
1668
|
+
static create(options: DeviceRequestOptions): DeviceRequest;
|
|
1669
|
+
}
|
|
1670
|
+
//#endregion
|
|
1671
|
+
//#region src/mdoc/models/document-error.d.ts
|
|
1672
|
+
declare const documentErrorSchema: z.ZodMap<z.ZodString, z.ZodNumber>;
|
|
1673
|
+
type DocumentErrorStructure = z.infer<typeof documentErrorSchema>;
|
|
1674
|
+
type DocumentErrorOptions = {
|
|
1675
|
+
documentError: DocumentErrorStructure;
|
|
1676
|
+
};
|
|
1677
|
+
declare class DocumentError extends CborStructure<DocumentErrorStructure> {
|
|
1678
|
+
static get encodingSchema(): z.ZodMap<z.ZodString, z.ZodNumber>;
|
|
1679
|
+
/**
|
|
1680
|
+
* Map where keys are namespaces and values are error codes
|
|
1681
|
+
*/
|
|
1682
|
+
get documentError(): Map<string, number>;
|
|
1683
|
+
static create(options: DocumentErrorOptions): DocumentError;
|
|
1684
|
+
}
|
|
1685
|
+
//#endregion
|
|
1686
|
+
//#region src/mdoc/models/device-response.d.ts
|
|
1687
|
+
declare const deviceResponseEncodedSchema: z.ZodCodec<z.ZodMap<z.ZodUnknown, z.ZodUnknown>, z.ZodCustom<TypedMap<{
|
|
1688
|
+
version: string;
|
|
1689
|
+
status: number;
|
|
1690
|
+
documents: unknown[];
|
|
1691
|
+
documentErrors: unknown[];
|
|
1692
|
+
}, "documents" | "documentErrors">, TypedMap<{
|
|
1693
|
+
version: string;
|
|
1694
|
+
status: number;
|
|
1695
|
+
documents: unknown[];
|
|
1696
|
+
documentErrors: unknown[];
|
|
1697
|
+
}, "documents" | "documentErrors">>>;
|
|
1698
|
+
declare const deviceResponseDecodedSchema: z.ZodCodec<z.ZodMap<z.ZodUnknown, z.ZodUnknown>, z.ZodCustom<TypedMap<{
|
|
1699
|
+
version: string;
|
|
1700
|
+
status: number;
|
|
1701
|
+
documents: Document[];
|
|
1702
|
+
documentErrors: DocumentError[];
|
|
1703
|
+
}, "documents" | "documentErrors">, TypedMap<{
|
|
1704
|
+
version: string;
|
|
1705
|
+
status: number;
|
|
1706
|
+
documents: Document[];
|
|
1707
|
+
documentErrors: DocumentError[];
|
|
1708
|
+
}, "documents" | "documentErrors">>>;
|
|
1709
|
+
type DeviceResponseEncodedStructure = z.input<typeof deviceResponseEncodedSchema>;
|
|
1710
|
+
type DeviceResponseDecodedStructure = z.output<typeof deviceResponseDecodedSchema>;
|
|
1711
|
+
type DeviceResponseOptions = {
|
|
1712
|
+
version?: string;
|
|
1713
|
+
documents?: Array<Document>;
|
|
1714
|
+
documentErrors?: Array<DocumentError>;
|
|
1715
|
+
status?: number;
|
|
1716
|
+
};
|
|
1717
|
+
declare class DeviceResponse extends CborStructure<DeviceResponseEncodedStructure, DeviceResponseDecodedStructure> {
|
|
1718
|
+
static get encodingSchema(): z.ZodCodec<z.ZodMap<z.ZodUnknown, z.ZodUnknown>, z.ZodCustom<TypedMap<{
|
|
1719
|
+
version: string;
|
|
1720
|
+
status: number;
|
|
1721
|
+
documents: Document[];
|
|
1722
|
+
documentErrors: DocumentError[];
|
|
1723
|
+
}, "documents" | "documentErrors">, TypedMap<{
|
|
1724
|
+
version: string;
|
|
1725
|
+
status: number;
|
|
1726
|
+
documents: Document[];
|
|
1727
|
+
documentErrors: DocumentError[];
|
|
1728
|
+
}, "documents" | "documentErrors">>>;
|
|
1729
|
+
get version(): string;
|
|
1730
|
+
get documents(): Document[] | undefined;
|
|
1731
|
+
get documentErrors(): DocumentError[] | undefined;
|
|
1732
|
+
get status(): number;
|
|
1733
|
+
verify(options: {
|
|
1734
|
+
deviceRequest?: DeviceRequest;
|
|
1735
|
+
sessionTranscript: SessionTranscript | Uint8Array;
|
|
1736
|
+
ephemeralReaderKey?: CoseKey;
|
|
1737
|
+
disableCertificateChainValidation?: boolean;
|
|
1738
|
+
trustedCertificates: Uint8Array[];
|
|
1739
|
+
now?: Date;
|
|
1740
|
+
onCheck?: VerificationCallback;
|
|
1741
|
+
skewSeconds?: number;
|
|
1742
|
+
}, ctx: Pick<MdocContext, 'cose' | 'x509' | 'crypto'>): Promise<void>;
|
|
1743
|
+
get encodedForOid4Vp(): string;
|
|
1744
|
+
static fromEncodedForOid4Vp(encoded: string): DeviceResponse;
|
|
1745
|
+
private static create;
|
|
1746
|
+
static createWithDeviceRequest(options: {
|
|
1747
|
+
deviceRequest: DeviceRequest;
|
|
1748
|
+
sessionTranscript: SessionTranscript | Uint8Array;
|
|
1749
|
+
issuerSigned: Array<IssuerSigned>;
|
|
1750
|
+
deviceNamespaces?: DeviceNamespaces;
|
|
1751
|
+
mac?: {
|
|
1752
|
+
ephemeralKey: CoseKey;
|
|
1753
|
+
signingKey: CoseKey;
|
|
1754
|
+
};
|
|
1755
|
+
signature?: {
|
|
1756
|
+
signingKey: CoseKey;
|
|
1757
|
+
};
|
|
1758
|
+
}, ctx: Pick<MdocContext, 'crypto' | 'cose'>): Promise<DeviceResponse>;
|
|
1759
|
+
static createSimple(options: DeviceResponseOptions): DeviceResponse;
|
|
1760
|
+
}
|
|
1761
|
+
//#endregion
|
|
1762
|
+
//#region src/mdoc/models/digest.d.ts
|
|
1763
|
+
type Digest = Uint8Array;
|
|
1764
|
+
//#endregion
|
|
1765
|
+
//#region src/mdoc/models/errors.d.ts
|
|
1766
|
+
declare const errorsEncodedSchema: z$1.ZodMap<z$1.ZodString, z$1.ZodMap<z$1.ZodString, z$1.ZodNumber>>;
|
|
1767
|
+
declare const errorsDecodedSchema: z$1.ZodMap<z$1.ZodString, z$1.ZodCustom<ErrorItems, ErrorItems>>;
|
|
1768
|
+
type ErrorsEncodedStructure = z$1.infer<typeof errorsEncodedSchema>;
|
|
1769
|
+
type ErrorsDecodedStructure = z$1.infer<typeof errorsDecodedSchema>;
|
|
1770
|
+
type ErrorsOptions = {
|
|
1771
|
+
errors: ErrorsDecodedStructure;
|
|
1772
|
+
};
|
|
1773
|
+
declare class Errors extends CborStructure<ErrorsEncodedStructure, ErrorsDecodedStructure> {
|
|
1774
|
+
static get encodingSchema(): z$1.ZodCodec<z$1.ZodMap<z$1.ZodString, z$1.ZodMap<z$1.ZodString, z$1.ZodNumber>>, z$1.ZodMap<z$1.ZodString, z$1.ZodCustom<ErrorItems, ErrorItems>>>;
|
|
1775
|
+
}
|
|
1776
|
+
//#endregion
|
|
1777
|
+
//#region src/mdoc/models/nfc-handover.d.ts
|
|
1778
|
+
declare const nfcHandoverEncodedSchema: z$1.ZodTuple<[z$1.ZodCustom<Uint8Array<ArrayBufferLike>, Uint8Array<ArrayBufferLike>>, z$1.ZodNullable<z$1.ZodCustom<Uint8Array<ArrayBufferLike>, Uint8Array<ArrayBufferLike>>>], null>;
|
|
1779
|
+
declare const nfcHandoverDecodedSchema: z$1.ZodObject<{
|
|
1780
|
+
selectMessage: z$1.ZodCustom<Uint8Array<ArrayBufferLike>, Uint8Array<ArrayBufferLike>>;
|
|
1781
|
+
requestMessage: z$1.ZodNullable<z$1.ZodCustom<Uint8Array<ArrayBufferLike>, Uint8Array<ArrayBufferLike>>>;
|
|
1782
|
+
}, z$1.core.$strip>;
|
|
1783
|
+
type NfcHandoverEncodedStructure = z$1.infer<typeof nfcHandoverEncodedSchema>;
|
|
1784
|
+
type NfcHandoverDecodedStructure = z$1.infer<typeof nfcHandoverDecodedSchema>;
|
|
1785
|
+
type NfcHandoverOptions = {
|
|
1786
|
+
selectMessage: Uint8Array;
|
|
1787
|
+
requestMessage?: Uint8Array;
|
|
1788
|
+
};
|
|
1789
|
+
declare class NfcHandover extends Handover<NfcHandoverEncodedStructure, NfcHandoverDecodedStructure> {
|
|
1790
|
+
static get encodingSchema(): z$1.ZodCodec<z$1.ZodTuple<[z$1.ZodCustom<Uint8Array<ArrayBufferLike>, Uint8Array<ArrayBufferLike>>, z$1.ZodNullable<z$1.ZodCustom<Uint8Array<ArrayBufferLike>, Uint8Array<ArrayBufferLike>>>], null>, z$1.ZodObject<{
|
|
1791
|
+
selectMessage: z$1.ZodCustom<Uint8Array<ArrayBufferLike>, Uint8Array<ArrayBufferLike>>;
|
|
1792
|
+
requestMessage: z$1.ZodNullable<z$1.ZodCustom<Uint8Array<ArrayBufferLike>, Uint8Array<ArrayBufferLike>>>;
|
|
1793
|
+
}, z$1.core.$strip>>;
|
|
1794
|
+
get selectMessage(): Uint8Array<ArrayBufferLike>;
|
|
1795
|
+
get requestMessage(): Uint8Array<ArrayBufferLike> | null;
|
|
1796
|
+
static create(options: NfcHandoverOptions): NfcHandover;
|
|
1797
|
+
get requiresReaderKey(): boolean;
|
|
1798
|
+
get requiresDeviceEngagement(): boolean;
|
|
1799
|
+
}
|
|
1800
|
+
//#endregion
|
|
1801
|
+
//#region src/mdoc/models/qr-handover.d.ts
|
|
1802
|
+
declare const qrHandoverSchema: z$1.ZodNull;
|
|
1803
|
+
type QrHandoverStructure = z$1.infer<typeof qrHandoverSchema>;
|
|
1804
|
+
declare class QrHandover extends Handover<QrHandoverStructure> {
|
|
1805
|
+
static get encodingSchema(): z$1.ZodNull;
|
|
1806
|
+
get requiresReaderKey(): boolean;
|
|
1807
|
+
get requiresDeviceEngagement(): boolean;
|
|
1808
|
+
static create(): QrHandover;
|
|
1809
|
+
}
|
|
1810
|
+
//#endregion
|
|
1811
|
+
//#region src/mdoc/builders/device-signed-builder.d.ts
|
|
1812
|
+
declare class DeviceSignedBuilder {
|
|
1813
|
+
private docType;
|
|
1814
|
+
private namespaces;
|
|
1815
|
+
private ctx;
|
|
1816
|
+
constructor(docType: DocType, ctx: Pick<MdocContext, 'cose' | 'crypto'>);
|
|
1817
|
+
addDeviceNamespace(namespace: Namespace, value: Record<string, unknown>): this;
|
|
1818
|
+
sign(options: {
|
|
1819
|
+
signingKey: CoseKey;
|
|
1820
|
+
algorithm: SignatureAlgorithm;
|
|
1821
|
+
sessionTranscript: SessionTranscript;
|
|
1822
|
+
derCertificate: string;
|
|
1823
|
+
}): Promise<DeviceSigned>;
|
|
1824
|
+
tag(options: {
|
|
1825
|
+
publicKey: CoseKey;
|
|
1826
|
+
privateKey: CoseKey;
|
|
1827
|
+
sessionTranscript: SessionTranscript;
|
|
1828
|
+
algorithm: MacAlgorithm;
|
|
1829
|
+
derCertificate: string;
|
|
1830
|
+
}): Promise<DeviceSigned>;
|
|
1831
|
+
}
|
|
1832
|
+
//#endregion
|
|
1833
|
+
//#region src/mdoc/builders/issuer-signed-builder.d.ts
|
|
1834
|
+
declare class IssuerSignedBuilder {
|
|
1835
|
+
private docType;
|
|
1836
|
+
private namespaces;
|
|
1837
|
+
private ctx;
|
|
1838
|
+
constructor(docType: DocType, ctx: Pick<MdocContext, 'cose' | 'crypto'>);
|
|
1839
|
+
addIssuerNamespace(namespace: Namespace, values: Record<string, unknown> | Map<string, unknown>): this;
|
|
1840
|
+
private convertIssuerNamespacesIntoValueDigests;
|
|
1841
|
+
sign(options: {
|
|
1842
|
+
signingKey: CoseKey;
|
|
1843
|
+
algorithm: SignatureAlgorithm;
|
|
1844
|
+
digestAlgorithm: DigestAlgorithm;
|
|
1845
|
+
validityInfo: ValidityInfo | ValidityInfoOptions;
|
|
1846
|
+
deviceKeyInfo: DeviceKeyInfo | DeviceKeyInfoOptions;
|
|
1847
|
+
certificate: Uint8Array;
|
|
1848
|
+
}): Promise<IssuerSigned>;
|
|
1849
|
+
}
|
|
1850
|
+
//#endregion
|
|
1851
|
+
//#region src/mdoc/errors.d.ts
|
|
1852
|
+
declare class MdlError extends Error {
|
|
1853
|
+
constructor(message?: string);
|
|
1854
|
+
}
|
|
1855
|
+
declare class MdlParseError extends MdlError {}
|
|
1856
|
+
declare class PresentationDefinitionOrDocRequestsAreRequiredError extends MdlError {}
|
|
1857
|
+
declare class SessionTranscriptOrSessionTranscriptBytesAreRequiredError extends MdlError {}
|
|
1858
|
+
declare class DuplicateNamespaceInIssuerNamespacesError extends MdlError {}
|
|
1859
|
+
declare class DuplicateDocumentInDeviceResponseError extends MdlError {}
|
|
1860
|
+
declare class EitherSignatureOrMacMustBeProvidedError extends MdlError {}
|
|
1861
|
+
//#endregion
|
|
1862
|
+
//#region src/holder.d.ts
|
|
1863
|
+
declare class Holder {
|
|
1864
|
+
/**
|
|
1865
|
+
*
|
|
1866
|
+
* string should be base64url encoded as defined in openid4vci Draft 15
|
|
1867
|
+
*
|
|
1868
|
+
*/
|
|
1869
|
+
static verifyIssuerSigned(options: {
|
|
1870
|
+
issuerSigned: Uint8Array | string | IssuerSigned;
|
|
1871
|
+
verificationCallback?: VerificationCallback;
|
|
1872
|
+
now?: Date;
|
|
1873
|
+
disableCertificateChainValidation?: boolean;
|
|
1874
|
+
trustedCertificates?: Array<Uint8Array>;
|
|
1875
|
+
skewSeconds?: number;
|
|
1876
|
+
}, ctx: Pick<MdocContext, 'cose' | 'x509'>): Promise<void>;
|
|
1877
|
+
static verifyDeviceRequest(options: {
|
|
1878
|
+
deviceRequest: Uint8Array | DeviceRequest;
|
|
1879
|
+
sessionTranscript: Uint8Array | SessionTranscript;
|
|
1880
|
+
verificationCallback?: VerificationCallback;
|
|
1881
|
+
}, ctx: Pick<MdocContext, 'cose' | 'x509'>): Promise<void>;
|
|
1882
|
+
static createDeviceResponseForDeviceRequest(options: {
|
|
1883
|
+
deviceRequest: DeviceRequest;
|
|
1884
|
+
sessionTranscript: SessionTranscript | Uint8Array;
|
|
1885
|
+
issuerSigned: Array<IssuerSigned>;
|
|
1886
|
+
deviceNamespaces?: DeviceNamespaces;
|
|
1887
|
+
mac?: {
|
|
1888
|
+
ephemeralKey: CoseKey;
|
|
1889
|
+
signingKey: CoseKey;
|
|
1890
|
+
};
|
|
1891
|
+
signature?: {
|
|
1892
|
+
signingKey: CoseKey;
|
|
1893
|
+
};
|
|
1894
|
+
}, context: Pick<MdocContext, 'cose' | 'crypto'>): Promise<DeviceResponse>;
|
|
1895
|
+
}
|
|
1896
|
+
//#endregion
|
|
1897
|
+
//#region src/issuer.d.ts
|
|
1898
|
+
declare class Issuer {
|
|
1899
|
+
private isb;
|
|
1900
|
+
constructor(docType: DocType, ctx: Pick<MdocContext, 'cose' | 'crypto'>);
|
|
1901
|
+
addIssuerNamespace(namespace: Namespace, value: Record<string | number, unknown>): this;
|
|
1902
|
+
sign(options: {
|
|
1903
|
+
signingKey: CoseKey | Record<string | number, unknown>;
|
|
1904
|
+
algorithm: SignatureAlgorithm;
|
|
1905
|
+
digestAlgorithm: DigestAlgorithm;
|
|
1906
|
+
validityInfo: ValidityInfo | ValidityInfoOptions;
|
|
1907
|
+
deviceKeyInfo: DeviceKeyInfo | DeviceKeyInfoOptions;
|
|
1908
|
+
certificate: Uint8Array;
|
|
1909
|
+
}): Promise<IssuerSigned>;
|
|
1910
|
+
}
|
|
1911
|
+
//#endregion
|
|
1912
|
+
//#region src/verifier.d.ts
|
|
1913
|
+
declare class Verifier {
|
|
1914
|
+
static verifyDeviceResponse(options: {
|
|
1915
|
+
deviceRequest?: DeviceRequest;
|
|
1916
|
+
deviceResponse: Uint8Array | DeviceResponse;
|
|
1917
|
+
sessionTranscript: SessionTranscript | Uint8Array;
|
|
1918
|
+
ephemeralReaderKey?: CoseKey;
|
|
1919
|
+
disableCertificateChainValidation?: boolean;
|
|
1920
|
+
trustedCertificates: Uint8Array[];
|
|
1921
|
+
now?: Date;
|
|
1922
|
+
onCheck?: VerificationCallback;
|
|
1923
|
+
skewSeconds?: number;
|
|
1924
|
+
}, ctx: Pick<MdocContext, 'cose' | 'x509' | 'crypto'>): Promise<void>;
|
|
1925
|
+
}
|
|
1926
|
+
//#endregion
|
|
1927
|
+
export { BleOptions, BleOptionsDecodedStructure, BleOptionsEncodedStructure, BleOptionsOptions, CoseCertificateNotFoundError, CoseDNotDefinedError, CoseEphemeralMacKeyIsRequiredError, CoseInvalidAlgorithmError, CoseInvalidKtyForRawError, CoseInvalidSignatureError, CoseInvalidTypeForKeyError, CoseInvalidValueForKtyError, CoseKNotDefinedError, CoseKey, CoseKeyDecodedStructure, CoseKeyEncodedStructure, CoseKeyOptions, CoseKeyParameter, CoseKeyTypeNotSupportedForPrivateKeyExtractionError, CosePayloadInvalidStructureError, CosePayloadMustBeDefinedError, CosePayloadMustBeNullError, CoseUnsupportedMacError, CoseXNotDefinedError, CoseYNotDefinedError, Curve, DataElementIdentifier, DataElementValue, DataItem, DateOnly, DeviceAuth, DeviceAuthDecodedStructure, DeviceAuthEncodedStructure, DeviceAuthOptions, DeviceAuthentication, DeviceAuthenticationDecodedStructure, DeviceAuthenticationEncodedStructure, DeviceAuthenticationOptions, DeviceEngagement, DeviceEngagementDecodedStructure, DeviceEngagementEncodedStructure, DeviceEngagementOptions, DeviceKey, DeviceKeyDecodedStructure, DeviceKeyEncodedStructure, DeviceKeyInfo, DeviceKeyInfoDecodedStructure, DeviceKeyInfoEncodedStructure, DeviceKeyInfoOptions, DeviceKeyOptions, DeviceMac, DeviceMacDecodedStructure, DeviceMacEncodedStructure, DeviceMacOptions, DeviceNamespaces, DeviceNamespacesDecodedStructure, DeviceNamespacesEncodedStructure, DeviceNamespacesOptions, DeviceRequest, DeviceRequestDecodedStructure, DeviceRequestEncodedStructure, DeviceRequestOptions, DeviceResponse, DeviceResponseDecodedStructure, DeviceResponseEncodedStructure, DeviceResponseOptions, DeviceRetrievalMethod, DeviceRetrievalMethodDecodedStructure, DeviceRetrievalMethodEncodedStructure, DeviceRetrievalMethodOptions, DeviceRetrievalMethodType, DeviceSignature, DeviceSignatureDecodedStructure, DeviceSignatureEncodedStructure, DeviceSignatureOptions, DeviceSigned, DeviceSignedBuilder, DeviceSignedDecodedStructure, DeviceSignedEncodedStructure, DeviceSignedItems, DeviceSignedItemsOptions, DeviceSignedItemsStructure, DeviceSignedOptions, Digest, DigestAlgorithm, DigestId, DocRequest, DocRequestDecodedStructure, DocRequestEncodedStructure, DocRequestOptions, DocType, Document, DocumentDecodedStructure, DocumentEncodedStructure, DocumentError, DocumentErrorOptions, DocumentErrorStructure, DocumentOptions, DuplicateDocumentInDeviceResponseError, DuplicateNamespaceInIssuerNamespacesError, EDeviceKey, EDeviceKeyDecodedStructure, EDeviceKeyEncodedStructure, EDeviceKeyOptions, EReaderKey, EReaderKeyDecodedStructure, EReaderKeyEncodedStructure, EReaderKeyOptions, EitherSignatureOrMacMustBeProvidedError, EncryptionAlgorithm, ErrorCode, ErrorItems, ErrorItemsOptions, ErrorItemsStructure, Errors, ErrorsDecodedStructure, ErrorsEncodedStructure, ErrorsOptions, Header, Holder, IntentToRetain, Issuer, IssuerAuth, IssuerAuthEncodedStructure, IssuerAuthOptions, IssuerNamespaces, IssuerNamespacesDecodedStructure, IssuerNamespacesEncodedStructure, IssuerNamespacesOptions, IssuerSigned, IssuerSignedBuilder, IssuerSignedDecodedStructure, IssuerSignedEncodedStructure, IssuerSignedItem, IssuerSignedItemDecodedStructure, IssuerSignedItemEncodedStructure, IssuerSignedItemOptions, IssuerSignedOptions, ItemsRequest, ItemsRequestDecodedStructure, ItemsRequestEncodedStructure, ItemsRequestOptions, KeyAuthorizations, KeyAuthorizationsDecodedStructure, KeyAuthorizationsEncodedStructure, KeyAuthorizationsOptions, KeyInfo, KeyInfoDecodedStructure, KeyInfoEncodedStructure, KeyInfoOptions, KeyOps, KeyType, Mac0, Mac0DecodedStructure, Mac0EncodedStructure, Mac0Options, MacAlgorithm, MdlError, MdlParseError, MdocContext, MobileSecurityObject, MobileSecurityObjectDecodedStructure, MobileSecurityObjectEncodedStructure, MobileSecurityObjectOptions, Namespace, NfcHandover, NfcHandoverDecodedStructure, NfcHandoverEncodedStructure, NfcHandoverOptions, NfcOptions, NfcOptionsDecodedStructure, NfcOptionsEncodedStructure, NfcOptionsOptions, Oidc, OidcDecodedStructure, OidcEncodedStructure, OidcOptions, PresentationDefinitionOrDocRequestsAreRequiredError, ProtectedHeaderOptions, ProtectedHeaders, ProtectedHeadersDecodedStructure, ProtectedHeadersEncodedStructure, ProtocolInfo, ProtocolInfoStructure, QrHandover, QrHandoverStructure, ReaderAuth, ReaderAuthDecodedStructure, ReaderAuthEncodedStructure, ReaderAuthOptions, RetrievalOptions, Security, SecurityDecodedStructure, SecurityEncodedStructure, SecurityOptions, ServerRetrievalMethod, ServerRetrievalMethodDecodedStructure, ServerRetrievalMethodEncodedStructure, ServerRetrievalMethodOptions, SessionTranscript, SessionTranscriptDecodedStructure, SessionTranscriptEncodedStructure, SessionTranscriptOptions, SessionTranscriptOrSessionTranscriptBytesAreRequiredError, Sign1, Sign1DecodedStructure, Sign1EncodedStructure, Sign1Options, SignatureAlgorithm, TypedMap, UnprotectedHeaderOptions, UnprotectedHeaders, UnprotectedHeadersStructure, ValidityInfo, ValidityInfoDecodedStructure, ValidityInfoEncodedStructure, ValidityInfoOptions, ValueDigestOptions, ValueDigests, ValueDigestsStructure, VerificationAssessment, VerificationCallback, Verifier, WebApi, WebApiDecodedStructure, WebApiEncodedStructure, WebApiOptions, WifiOptions, WifiOptionsDecodedStructure, WifiOptionsEncodedStructure, WifiOptionsOptions, base64, base64url, bytesToString, cborDecode, cborEncode, compareBytes, concatBytes, coseKeyToJwk, coseOptionsJwkMap, defaultVerificationCallback, deviceSignedItemsSchema, errorItemsSchema, hex, issuerNamespacesDecodedSchema, issuerNamespacesEncodedSchema, issuerSignedItemSchema, jwkCoseOptionsMap, jwkToCoseKey, onCategoryCheck, protectedHeadersDecodedStructure, protectedHeadersEncodedStructure, sessionTranscriptEncodedSchema, stringToBytes, typedMap, unprotectedHeadersStructure };
|
|
1928
|
+
//# sourceMappingURL=index.d.mts.map
|