@sphereon/ssi-sdk.kms-rest-client 0.34.1-feature.IDK.11.48
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 +201 -0
- package/dist/index.cjs +2083 -0
- package/dist/index.cjs.map +1 -0
- package/dist/index.d.cts +1468 -0
- package/dist/index.d.ts +1468 -0
- package/dist/index.js +2063 -0
- package/dist/index.js.map +1 -0
- package/package.json +60 -0
- package/plugin.schema.json +1123 -0
- package/src/agent/KmsRestClient.ts +468 -0
- package/src/index.ts +7 -0
- package/src/models/AwsAssumeRoleCredentials.ts +98 -0
- package/src/models/AwsClientConfiguration.ts +72 -0
- package/src/models/AwsKmsSetting.ts +126 -0
- package/src/models/AwsStaticCredentials.ts +98 -0
- package/src/models/AwsWebIdentityTokenCredentials.ts +99 -0
- package/src/models/AzureClientSecretCredentialOpts.ts +90 -0
- package/src/models/AzureCredentialOpts.ts +70 -0
- package/src/models/AzureKeyVaultSetting.ts +112 -0
- package/src/models/CoseKey.ts +145 -0
- package/src/models/CoseKeyPair.ts +79 -0
- package/src/models/CoseKeyType.ts +55 -0
- package/src/models/CreateKeyProvider.ts +115 -0
- package/src/models/CreateRawSignature.ts +80 -0
- package/src/models/CreateRawSignatureResponse.ts +65 -0
- package/src/models/CreateSimpleSignature.ts +100 -0
- package/src/models/CryptoAlg.ts +55 -0
- package/src/models/Curve.ts +59 -0
- package/src/models/DigestAlg.ts +58 -0
- package/src/models/ErrorResponse.ts +82 -0
- package/src/models/GenerateKey.ts +106 -0
- package/src/models/GenerateKeyGlobal.ts +114 -0
- package/src/models/GenerateKeyResponse.ts +71 -0
- package/src/models/GetKeyResponse.ts +71 -0
- package/src/models/IdentifierMethod.ts +56 -0
- package/src/models/JoseKeyPair.ts +79 -0
- package/src/models/Jwk.ts +248 -0
- package/src/models/JwkKeyType.ts +55 -0
- package/src/models/JwkUse.ts +53 -0
- package/src/models/KeyEncoding.ts +53 -0
- package/src/models/KeyInfo.ts +164 -0
- package/src/models/KeyOperations.ts +59 -0
- package/src/models/KeyProvider.ts +82 -0
- package/src/models/KeyProviderResponse.ts +82 -0
- package/src/models/KeyProviderType.ts +54 -0
- package/src/models/KeyResolver.ts +92 -0
- package/src/models/KeyType.ts +54 -0
- package/src/models/KeyVisibility.ts +53 -0
- package/src/models/ListKeyProvidersResponse.ts +71 -0
- package/src/models/ListKeysResponse.ts +71 -0
- package/src/models/ListResolversResponse.ts +71 -0
- package/src/models/LookupMode.ts +54 -0
- package/src/models/ManagedKeyInfo.ts +167 -0
- package/src/models/ManagedKeyPair.ts +111 -0
- package/src/models/MaskGenFunction.ts +52 -0
- package/src/models/ProviderCapabilities.ts +122 -0
- package/src/models/ResolvePublicKey.ts +102 -0
- package/src/models/ResolvedKeyInfo.ts +165 -0
- package/src/models/Resolver.ts +92 -0
- package/src/models/SignInput.ts +92 -0
- package/src/models/SignOutput.ts +79 -0
- package/src/models/Signature.ts +103 -0
- package/src/models/SignatureAlgorithm.ts +63 -0
- package/src/models/StoreKey.ts +79 -0
- package/src/models/StoreKeyResponse.ts +71 -0
- package/src/models/UpdateKeyProvider.ts +99 -0
- package/src/models/VerifyRawSignature.ts +89 -0
- package/src/models/VerifyRawSignatureResponse.ts +65 -0
- package/src/models/VerifySimpleSignature.ts +85 -0
- package/src/models/index.ts +60 -0
- package/src/types/IKmsRestClient.ts +133 -0
package/dist/index.cjs
ADDED
|
@@ -0,0 +1,2083 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
|
|
7
|
+
var __commonJS = (cb, mod) => function __require() {
|
|
8
|
+
return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
|
|
9
|
+
};
|
|
10
|
+
var __export = (target, all) => {
|
|
11
|
+
for (var name in all)
|
|
12
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
13
|
+
};
|
|
14
|
+
var __copyProps = (to, from, except, desc) => {
|
|
15
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
16
|
+
for (let key of __getOwnPropNames(from))
|
|
17
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
18
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
19
|
+
}
|
|
20
|
+
return to;
|
|
21
|
+
};
|
|
22
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
23
|
+
|
|
24
|
+
// plugin.schema.json
|
|
25
|
+
var require_plugin_schema = __commonJS({
|
|
26
|
+
"plugin.schema.json"(exports, module2) {
|
|
27
|
+
module2.exports = {
|
|
28
|
+
IKmsRestClient: {
|
|
29
|
+
components: {
|
|
30
|
+
schemas: {
|
|
31
|
+
KmsCreateRawSignatureArgs: {
|
|
32
|
+
type: "object",
|
|
33
|
+
additionalProperties: false,
|
|
34
|
+
properties: {
|
|
35
|
+
keyInfo: {
|
|
36
|
+
$ref: "#/components/schemas/KeyInfo"
|
|
37
|
+
},
|
|
38
|
+
input: {
|
|
39
|
+
type: "string"
|
|
40
|
+
},
|
|
41
|
+
baseUrl: {
|
|
42
|
+
type: "string"
|
|
43
|
+
}
|
|
44
|
+
},
|
|
45
|
+
required: [
|
|
46
|
+
"input",
|
|
47
|
+
"keyInfo"
|
|
48
|
+
]
|
|
49
|
+
},
|
|
50
|
+
KeyInfo: {
|
|
51
|
+
type: "object",
|
|
52
|
+
properties: {
|
|
53
|
+
kid: {
|
|
54
|
+
type: "string",
|
|
55
|
+
description: "Unique identifier for the cryptographic key. Can be null if the key identifier is not provided."
|
|
56
|
+
},
|
|
57
|
+
key: {
|
|
58
|
+
$ref: "#/components/schemas/Jwk"
|
|
59
|
+
},
|
|
60
|
+
signatureAlgorithm: {
|
|
61
|
+
$ref: "#/components/schemas/SignatureAlgorithm"
|
|
62
|
+
},
|
|
63
|
+
keyVisibility: {
|
|
64
|
+
$ref: "#/components/schemas/KeyVisibility"
|
|
65
|
+
},
|
|
66
|
+
x5c: {
|
|
67
|
+
type: "array",
|
|
68
|
+
items: {
|
|
69
|
+
type: "string"
|
|
70
|
+
},
|
|
71
|
+
description: "X.509 certificate chain associated with the key."
|
|
72
|
+
},
|
|
73
|
+
alias: {
|
|
74
|
+
type: "string",
|
|
75
|
+
description: "A reference or alias to the key in the Key Management Service (KMS)."
|
|
76
|
+
},
|
|
77
|
+
providerId: {
|
|
78
|
+
type: "string",
|
|
79
|
+
description: "The Key Management System (KMS) identifier associated with the key."
|
|
80
|
+
},
|
|
81
|
+
keyType: {
|
|
82
|
+
$ref: "#/components/schemas/KeyType"
|
|
83
|
+
},
|
|
84
|
+
keyEncoding: {
|
|
85
|
+
$ref: "#/components/schemas/KeyEncoding"
|
|
86
|
+
},
|
|
87
|
+
opts: {
|
|
88
|
+
type: "object",
|
|
89
|
+
additionalProperties: {
|
|
90
|
+
type: "string"
|
|
91
|
+
},
|
|
92
|
+
description: "Additional configuration options as key-value pairs."
|
|
93
|
+
}
|
|
94
|
+
},
|
|
95
|
+
additionalProperties: false,
|
|
96
|
+
description: "Information about a cryptographic key, providing metadata and configuration details necessary for cryptographic operations."
|
|
97
|
+
},
|
|
98
|
+
Jwk: {
|
|
99
|
+
type: "object",
|
|
100
|
+
properties: {
|
|
101
|
+
kty: {
|
|
102
|
+
$ref: "#/components/schemas/JwkKeyType"
|
|
103
|
+
},
|
|
104
|
+
kid: {
|
|
105
|
+
type: "string",
|
|
106
|
+
description: "Key identifier used to uniquely identify the key."
|
|
107
|
+
},
|
|
108
|
+
alg: {
|
|
109
|
+
type: "string",
|
|
110
|
+
description: "The algorithm intended for use with the key (JWA algorithm name)."
|
|
111
|
+
},
|
|
112
|
+
use: {
|
|
113
|
+
$ref: "#/components/schemas/JwkUse"
|
|
114
|
+
},
|
|
115
|
+
keyOps: {
|
|
116
|
+
type: "array",
|
|
117
|
+
items: {
|
|
118
|
+
$ref: "#/components/schemas/KeyOperations"
|
|
119
|
+
},
|
|
120
|
+
description: "The allowed cryptographic operations for the key."
|
|
121
|
+
},
|
|
122
|
+
crv: {
|
|
123
|
+
$ref: "#/components/schemas/Curve"
|
|
124
|
+
},
|
|
125
|
+
x: {
|
|
126
|
+
type: "string",
|
|
127
|
+
description: "The x coordinate for elliptic curve keys (base64url-encoded)."
|
|
128
|
+
},
|
|
129
|
+
y: {
|
|
130
|
+
type: "string",
|
|
131
|
+
description: "The y coordinate for elliptic curve keys (base64url-encoded)."
|
|
132
|
+
},
|
|
133
|
+
d: {
|
|
134
|
+
type: "string",
|
|
135
|
+
description: "The private key parameter (base64url-encoded)."
|
|
136
|
+
},
|
|
137
|
+
n: {
|
|
138
|
+
type: "string",
|
|
139
|
+
description: "The modulus value for RSA keys (base64url-encoded)."
|
|
140
|
+
},
|
|
141
|
+
e: {
|
|
142
|
+
type: "string",
|
|
143
|
+
description: "The public exponent for RSA keys (base64url-encoded)."
|
|
144
|
+
},
|
|
145
|
+
p: {
|
|
146
|
+
type: "string",
|
|
147
|
+
description: "The first prime factor for RSA private keys (base64url-encoded)."
|
|
148
|
+
},
|
|
149
|
+
q: {
|
|
150
|
+
type: "string",
|
|
151
|
+
description: "The second prime factor for RSA private keys (base64url-encoded)."
|
|
152
|
+
},
|
|
153
|
+
dp: {
|
|
154
|
+
type: "string",
|
|
155
|
+
description: "The first factor CRT exponent for RSA private keys (base64url-encoded)."
|
|
156
|
+
},
|
|
157
|
+
dq: {
|
|
158
|
+
type: "string",
|
|
159
|
+
description: "The second factor CRT exponent for RSA private keys (base64url-encoded)."
|
|
160
|
+
},
|
|
161
|
+
qi: {
|
|
162
|
+
type: "string",
|
|
163
|
+
description: "The first CRT coefficient for RSA private keys (base64url-encoded)."
|
|
164
|
+
},
|
|
165
|
+
k: {
|
|
166
|
+
type: "string",
|
|
167
|
+
description: "The symmetric key value (base64url-encoded)."
|
|
168
|
+
},
|
|
169
|
+
x5c: {
|
|
170
|
+
type: "array",
|
|
171
|
+
items: {
|
|
172
|
+
type: "string"
|
|
173
|
+
},
|
|
174
|
+
description: "X.509 certificate chain as base64-encoded DER certificates."
|
|
175
|
+
},
|
|
176
|
+
x5t: {
|
|
177
|
+
type: "string",
|
|
178
|
+
description: "X.509 certificate SHA-1 thumbprint (base64url-encoded)."
|
|
179
|
+
},
|
|
180
|
+
x5u: {
|
|
181
|
+
type: "string",
|
|
182
|
+
description: "URL pointing to X.509 certificate or certificate chain."
|
|
183
|
+
},
|
|
184
|
+
x5tS256: {
|
|
185
|
+
type: "string",
|
|
186
|
+
description: "X.509 certificate SHA-256 thumbprint (base64url-encoded)."
|
|
187
|
+
}
|
|
188
|
+
},
|
|
189
|
+
required: [
|
|
190
|
+
"kty"
|
|
191
|
+
],
|
|
192
|
+
additionalProperties: false,
|
|
193
|
+
description: "Represents a JSON Web Key (JWK) as defined by the JSON Web Key specification."
|
|
194
|
+
},
|
|
195
|
+
JwkKeyType: {
|
|
196
|
+
type: "string",
|
|
197
|
+
enum: [
|
|
198
|
+
"EC",
|
|
199
|
+
"RSA",
|
|
200
|
+
"OKP",
|
|
201
|
+
"oct"
|
|
202
|
+
],
|
|
203
|
+
description: "JSON Web Key (JWK) key type parameter identifying the cryptographic algorithm family."
|
|
204
|
+
},
|
|
205
|
+
JwkUse: {
|
|
206
|
+
type: "string",
|
|
207
|
+
enum: [
|
|
208
|
+
"sig",
|
|
209
|
+
"enc"
|
|
210
|
+
],
|
|
211
|
+
description: "Intended use of the key (signing or encryption)."
|
|
212
|
+
},
|
|
213
|
+
KeyOperations: {
|
|
214
|
+
type: "string",
|
|
215
|
+
enum: [
|
|
216
|
+
"sign",
|
|
217
|
+
"verify",
|
|
218
|
+
"encrypt",
|
|
219
|
+
"decrypt",
|
|
220
|
+
"wrapKey",
|
|
221
|
+
"unwrapKey",
|
|
222
|
+
"deriveKey",
|
|
223
|
+
"deriveBits"
|
|
224
|
+
],
|
|
225
|
+
description: "Specific operations the key is intended for."
|
|
226
|
+
},
|
|
227
|
+
Curve: {
|
|
228
|
+
type: "string",
|
|
229
|
+
enum: [
|
|
230
|
+
"P-256",
|
|
231
|
+
"P-384",
|
|
232
|
+
"P-521",
|
|
233
|
+
"secp256k1",
|
|
234
|
+
"Ed25519",
|
|
235
|
+
"Ed448",
|
|
236
|
+
"X25519",
|
|
237
|
+
"X448"
|
|
238
|
+
],
|
|
239
|
+
description: "Elliptic curve identifier."
|
|
240
|
+
},
|
|
241
|
+
SignatureAlgorithm: {
|
|
242
|
+
type: "string",
|
|
243
|
+
enum: [
|
|
244
|
+
"ED25519",
|
|
245
|
+
"ECDSA_SHA256",
|
|
246
|
+
"ECDSA_SHA384",
|
|
247
|
+
"ECDSA_SHA512",
|
|
248
|
+
"ES256K",
|
|
249
|
+
"ECKA_DH_SHA256",
|
|
250
|
+
"HMAC_SHA256",
|
|
251
|
+
"HMAC_SHA384",
|
|
252
|
+
"HMAC_SHA512",
|
|
253
|
+
"RSA_SSA_PSS_SHA256_MGF1",
|
|
254
|
+
"RSA_SSA_PSS_SHA384_MGF1",
|
|
255
|
+
"RSA_SSA_PSS_SHA512_MGF1"
|
|
256
|
+
],
|
|
257
|
+
description: "Cryptographic signature algorithm identifier."
|
|
258
|
+
},
|
|
259
|
+
KeyVisibility: {
|
|
260
|
+
type: "string",
|
|
261
|
+
enum: [
|
|
262
|
+
"PUBLIC",
|
|
263
|
+
"PRIVATE"
|
|
264
|
+
],
|
|
265
|
+
description: "Indicates the visibility status of a cryptographic key."
|
|
266
|
+
},
|
|
267
|
+
KeyType: {
|
|
268
|
+
type: "string",
|
|
269
|
+
enum: [
|
|
270
|
+
"OKP",
|
|
271
|
+
"EC",
|
|
272
|
+
"RSA"
|
|
273
|
+
],
|
|
274
|
+
description: "Cryptographic key type identifier."
|
|
275
|
+
},
|
|
276
|
+
KeyEncoding: {
|
|
277
|
+
type: "string",
|
|
278
|
+
enum: [
|
|
279
|
+
"COSE",
|
|
280
|
+
"JOSE"
|
|
281
|
+
],
|
|
282
|
+
description: "The encoding format of the cryptographic key."
|
|
283
|
+
},
|
|
284
|
+
CreateRawSignatureResponse: {
|
|
285
|
+
type: "object",
|
|
286
|
+
properties: {
|
|
287
|
+
signature: {
|
|
288
|
+
type: "string",
|
|
289
|
+
description: "The created signature encoded as a base64 string."
|
|
290
|
+
}
|
|
291
|
+
},
|
|
292
|
+
required: [
|
|
293
|
+
"signature"
|
|
294
|
+
],
|
|
295
|
+
additionalProperties: false,
|
|
296
|
+
description: "Response body containing the created signature."
|
|
297
|
+
},
|
|
298
|
+
KmsDeleteKeyArgs: {
|
|
299
|
+
type: "object",
|
|
300
|
+
properties: {
|
|
301
|
+
baseUrl: {
|
|
302
|
+
type: "string"
|
|
303
|
+
},
|
|
304
|
+
aliasOrKid: {
|
|
305
|
+
type: "string"
|
|
306
|
+
}
|
|
307
|
+
},
|
|
308
|
+
additionalProperties: false
|
|
309
|
+
},
|
|
310
|
+
KmsGenerateKeyArgs: {
|
|
311
|
+
type: "object",
|
|
312
|
+
additionalProperties: false,
|
|
313
|
+
properties: {
|
|
314
|
+
alias: {
|
|
315
|
+
type: "string",
|
|
316
|
+
description: "Alias for the generated key."
|
|
317
|
+
},
|
|
318
|
+
use: {
|
|
319
|
+
$ref: "#/components/schemas/JwkUse"
|
|
320
|
+
},
|
|
321
|
+
keyOperations: {
|
|
322
|
+
type: "array",
|
|
323
|
+
items: {
|
|
324
|
+
$ref: "#/components/schemas/KeyOperations"
|
|
325
|
+
}
|
|
326
|
+
},
|
|
327
|
+
alg: {
|
|
328
|
+
$ref: "#/components/schemas/SignatureAlgorithm"
|
|
329
|
+
},
|
|
330
|
+
providerId: {
|
|
331
|
+
type: "string",
|
|
332
|
+
description: "Optional provider ID. If not specified, the default provider will be used."
|
|
333
|
+
},
|
|
334
|
+
baseUrl: {
|
|
335
|
+
type: "string"
|
|
336
|
+
}
|
|
337
|
+
}
|
|
338
|
+
},
|
|
339
|
+
ManagedKeyPair: {
|
|
340
|
+
type: "object",
|
|
341
|
+
properties: {
|
|
342
|
+
kid: {
|
|
343
|
+
type: "string",
|
|
344
|
+
description: "Key identifier, may be null."
|
|
345
|
+
},
|
|
346
|
+
providerId: {
|
|
347
|
+
type: "string",
|
|
348
|
+
description: "Key Management System identifier."
|
|
349
|
+
},
|
|
350
|
+
alias: {
|
|
351
|
+
type: "string",
|
|
352
|
+
description: "Reference to the key in the KMS."
|
|
353
|
+
},
|
|
354
|
+
cose: {
|
|
355
|
+
$ref: "#/components/schemas/CoseKeyPair"
|
|
356
|
+
},
|
|
357
|
+
jose: {
|
|
358
|
+
$ref: "#/components/schemas/JoseKeyPair"
|
|
359
|
+
}
|
|
360
|
+
},
|
|
361
|
+
required: [
|
|
362
|
+
"providerId",
|
|
363
|
+
"alias",
|
|
364
|
+
"cose",
|
|
365
|
+
"jose"
|
|
366
|
+
],
|
|
367
|
+
additionalProperties: false,
|
|
368
|
+
description: "Represents a key pair used by a crypto provider, encapsulating both JOSE and COSE key pairs."
|
|
369
|
+
},
|
|
370
|
+
CoseKeyPair: {
|
|
371
|
+
type: "object",
|
|
372
|
+
properties: {
|
|
373
|
+
privateCoseKey: {
|
|
374
|
+
$ref: "#/components/schemas/CoseKey"
|
|
375
|
+
},
|
|
376
|
+
publicCoseKey: {
|
|
377
|
+
$ref: "#/components/schemas/CoseKey"
|
|
378
|
+
}
|
|
379
|
+
},
|
|
380
|
+
required: [
|
|
381
|
+
"publicCoseKey"
|
|
382
|
+
],
|
|
383
|
+
additionalProperties: false,
|
|
384
|
+
description: "Represents a cryptographic key pair for COSE (CBOR Object Signing and Encryption) operations."
|
|
385
|
+
},
|
|
386
|
+
CoseKey: {
|
|
387
|
+
type: "object",
|
|
388
|
+
properties: {
|
|
389
|
+
kty: {
|
|
390
|
+
$ref: "#/components/schemas/CoseKeyType"
|
|
391
|
+
},
|
|
392
|
+
kid: {
|
|
393
|
+
type: "string",
|
|
394
|
+
description: "Key identifier (base64url-encoded byte string)."
|
|
395
|
+
},
|
|
396
|
+
alg: {
|
|
397
|
+
type: "number",
|
|
398
|
+
description: "The COSE algorithm identifier (e.g., -7=ES256, -35=ES384, -36=ES512, -8=EdDSA)."
|
|
399
|
+
},
|
|
400
|
+
keyOps: {
|
|
401
|
+
type: "array",
|
|
402
|
+
items: {
|
|
403
|
+
type: "number"
|
|
404
|
+
},
|
|
405
|
+
description: "The allowed COSE key operations (1=sign, 2=verify, 3=encrypt, 4=decrypt, etc.)."
|
|
406
|
+
},
|
|
407
|
+
baseIV: {
|
|
408
|
+
type: "string",
|
|
409
|
+
description: "Base initialization vector (base64url-encoded)."
|
|
410
|
+
},
|
|
411
|
+
crv: {
|
|
412
|
+
type: "number",
|
|
413
|
+
description: "The COSE curve identifier (1=P-256, 2=P-384, 3=P-521, 8=secp256k1, 6=Ed25519, etc.)."
|
|
414
|
+
},
|
|
415
|
+
x: {
|
|
416
|
+
type: "string",
|
|
417
|
+
description: "The x coordinate (base64url-encoded byte string)."
|
|
418
|
+
},
|
|
419
|
+
y: {
|
|
420
|
+
type: "string",
|
|
421
|
+
description: "The y coordinate (base64url-encoded byte string)."
|
|
422
|
+
},
|
|
423
|
+
d: {
|
|
424
|
+
type: "string",
|
|
425
|
+
description: "The private key parameter (base64url-encoded byte string)."
|
|
426
|
+
},
|
|
427
|
+
x5chain: {
|
|
428
|
+
type: "array",
|
|
429
|
+
items: {
|
|
430
|
+
type: "string"
|
|
431
|
+
},
|
|
432
|
+
description: "X.509 certificate chain as base64-encoded certificates."
|
|
433
|
+
}
|
|
434
|
+
},
|
|
435
|
+
required: [
|
|
436
|
+
"kty"
|
|
437
|
+
],
|
|
438
|
+
additionalProperties: false,
|
|
439
|
+
description: "Represents a COSE (CBOR Object Signing and Encryption) key in JSON format."
|
|
440
|
+
},
|
|
441
|
+
CoseKeyType: {
|
|
442
|
+
type: "number",
|
|
443
|
+
enum: [
|
|
444
|
+
1,
|
|
445
|
+
2,
|
|
446
|
+
3,
|
|
447
|
+
4
|
|
448
|
+
],
|
|
449
|
+
description: "COSE key type parameter. 1=OKP (Octet Key Pair), 2=EC2 (Elliptic Curve), 3=RSA, 4=Symmetric."
|
|
450
|
+
},
|
|
451
|
+
JoseKeyPair: {
|
|
452
|
+
type: "object",
|
|
453
|
+
properties: {
|
|
454
|
+
privateJwk: {
|
|
455
|
+
$ref: "#/components/schemas/Jwk"
|
|
456
|
+
},
|
|
457
|
+
publicJwk: {
|
|
458
|
+
$ref: "#/components/schemas/Jwk"
|
|
459
|
+
}
|
|
460
|
+
},
|
|
461
|
+
required: [
|
|
462
|
+
"publicJwk"
|
|
463
|
+
],
|
|
464
|
+
additionalProperties: false,
|
|
465
|
+
description: "Data class representing a cryptographic key pair used with JOSE (JSON Object Signing and Encryption)."
|
|
466
|
+
},
|
|
467
|
+
KmsGetKeyArgs: {
|
|
468
|
+
type: "object",
|
|
469
|
+
properties: {
|
|
470
|
+
baseUrl: {
|
|
471
|
+
type: "string"
|
|
472
|
+
},
|
|
473
|
+
aliasOrKid: {
|
|
474
|
+
type: "string"
|
|
475
|
+
}
|
|
476
|
+
},
|
|
477
|
+
required: [
|
|
478
|
+
"aliasOrKid"
|
|
479
|
+
],
|
|
480
|
+
additionalProperties: false
|
|
481
|
+
},
|
|
482
|
+
ManagedKeyInfo: {
|
|
483
|
+
type: "object",
|
|
484
|
+
properties: {
|
|
485
|
+
kid: {
|
|
486
|
+
type: "string",
|
|
487
|
+
description: "Unique identifier for the cryptographic key. Can be null if the key identifier is not provided."
|
|
488
|
+
},
|
|
489
|
+
key: {
|
|
490
|
+
$ref: "#/components/schemas/Jwk"
|
|
491
|
+
},
|
|
492
|
+
signatureAlgorithm: {
|
|
493
|
+
$ref: "#/components/schemas/SignatureAlgorithm"
|
|
494
|
+
},
|
|
495
|
+
keyVisibility: {
|
|
496
|
+
$ref: "#/components/schemas/KeyVisibility"
|
|
497
|
+
},
|
|
498
|
+
x5c: {
|
|
499
|
+
type: "array",
|
|
500
|
+
items: {
|
|
501
|
+
type: "string"
|
|
502
|
+
},
|
|
503
|
+
description: "X.509 certificate chain associated with the key."
|
|
504
|
+
},
|
|
505
|
+
alias: {
|
|
506
|
+
type: "string",
|
|
507
|
+
description: "A reference or alias to the key in the Key Management Service (KMS)."
|
|
508
|
+
},
|
|
509
|
+
providerId: {
|
|
510
|
+
type: "string",
|
|
511
|
+
description: "The Key Management System (KMS) identifier associated with the key."
|
|
512
|
+
},
|
|
513
|
+
keyType: {
|
|
514
|
+
$ref: "#/components/schemas/KeyType"
|
|
515
|
+
},
|
|
516
|
+
keyEncoding: {
|
|
517
|
+
$ref: "#/components/schemas/KeyEncoding"
|
|
518
|
+
},
|
|
519
|
+
opts: {
|
|
520
|
+
type: "object",
|
|
521
|
+
additionalProperties: {
|
|
522
|
+
type: "string"
|
|
523
|
+
},
|
|
524
|
+
description: "Additional configuration options as key-value pairs."
|
|
525
|
+
}
|
|
526
|
+
},
|
|
527
|
+
required: [
|
|
528
|
+
"key",
|
|
529
|
+
"alias",
|
|
530
|
+
"providerId"
|
|
531
|
+
],
|
|
532
|
+
additionalProperties: false,
|
|
533
|
+
description: "Represents a managed cryptographic key information that is guaranteed to be present and resolved, part of a KMS providing concrete access to the key."
|
|
534
|
+
},
|
|
535
|
+
KmsGetKeyProviderArgs: {
|
|
536
|
+
type: "object",
|
|
537
|
+
properties: {
|
|
538
|
+
baseUrl: {
|
|
539
|
+
type: "string"
|
|
540
|
+
},
|
|
541
|
+
providerId: {
|
|
542
|
+
type: "string"
|
|
543
|
+
}
|
|
544
|
+
},
|
|
545
|
+
additionalProperties: false
|
|
546
|
+
},
|
|
547
|
+
KeyProviderResponse: {
|
|
548
|
+
type: "object",
|
|
549
|
+
properties: {
|
|
550
|
+
providerId: {
|
|
551
|
+
type: "string",
|
|
552
|
+
description: "The unique identifier assigned to the Key Provider instance upon creation."
|
|
553
|
+
},
|
|
554
|
+
type: {
|
|
555
|
+
$ref: "#/components/schemas/KeyProviderType"
|
|
556
|
+
}
|
|
557
|
+
},
|
|
558
|
+
required: [
|
|
559
|
+
"providerId",
|
|
560
|
+
"type"
|
|
561
|
+
],
|
|
562
|
+
additionalProperties: false,
|
|
563
|
+
description: "Response body containing the details of a Key Provider instance."
|
|
564
|
+
},
|
|
565
|
+
KeyProviderType: {
|
|
566
|
+
type: "string",
|
|
567
|
+
enum: [
|
|
568
|
+
"SOFTWARE",
|
|
569
|
+
"AZURE_KEYVAULT",
|
|
570
|
+
"AWS_KMS"
|
|
571
|
+
],
|
|
572
|
+
description: "The type of Key Provider. Determines the required configuration settings. - AZURE_KEYVAULT: Microsoft Azure Key Vault or Managed HSM. - AWS_KMS: Amazon Web Services Key Management Service."
|
|
573
|
+
},
|
|
574
|
+
kmsGetResolverArgs: {
|
|
575
|
+
type: "object",
|
|
576
|
+
properties: {
|
|
577
|
+
baseUrl: {
|
|
578
|
+
type: "string"
|
|
579
|
+
},
|
|
580
|
+
resolverId: {
|
|
581
|
+
type: "string"
|
|
582
|
+
}
|
|
583
|
+
},
|
|
584
|
+
required: [
|
|
585
|
+
"resolverId"
|
|
586
|
+
],
|
|
587
|
+
additionalProperties: false
|
|
588
|
+
},
|
|
589
|
+
Resolver: {
|
|
590
|
+
type: "object",
|
|
591
|
+
properties: {
|
|
592
|
+
resolverId: {
|
|
593
|
+
type: "string",
|
|
594
|
+
description: "Unique identifier for the resolver."
|
|
595
|
+
},
|
|
596
|
+
supportedIdentifierMethods: {
|
|
597
|
+
type: "array",
|
|
598
|
+
items: {
|
|
599
|
+
$ref: "#/components/schemas/IdentifierMethod"
|
|
600
|
+
},
|
|
601
|
+
description: "List of identifier methods supported by this resolver."
|
|
602
|
+
},
|
|
603
|
+
supportedKeyTypes: {
|
|
604
|
+
type: "array",
|
|
605
|
+
items: {
|
|
606
|
+
$ref: "#/components/schemas/KeyType"
|
|
607
|
+
},
|
|
608
|
+
description: "List of key types supported by this resolver."
|
|
609
|
+
}
|
|
610
|
+
},
|
|
611
|
+
required: [
|
|
612
|
+
"resolverId"
|
|
613
|
+
],
|
|
614
|
+
additionalProperties: false,
|
|
615
|
+
description: "Represents a key resolver configuration."
|
|
616
|
+
},
|
|
617
|
+
IdentifierMethod: {
|
|
618
|
+
type: "string",
|
|
619
|
+
enum: [
|
|
620
|
+
"JWK",
|
|
621
|
+
"KID",
|
|
622
|
+
"COSE_KEY",
|
|
623
|
+
"X5C",
|
|
624
|
+
"DID"
|
|
625
|
+
],
|
|
626
|
+
description: "Method used to identify cryptographic keys."
|
|
627
|
+
},
|
|
628
|
+
KmsIsValidRawSignatureArgs: {
|
|
629
|
+
type: "object",
|
|
630
|
+
additionalProperties: false,
|
|
631
|
+
properties: {
|
|
632
|
+
keyInfo: {
|
|
633
|
+
$ref: "#/components/schemas/KeyInfo"
|
|
634
|
+
},
|
|
635
|
+
input: {
|
|
636
|
+
type: "string"
|
|
637
|
+
},
|
|
638
|
+
signature: {
|
|
639
|
+
type: "string"
|
|
640
|
+
},
|
|
641
|
+
baseUrl: {
|
|
642
|
+
type: "string"
|
|
643
|
+
}
|
|
644
|
+
},
|
|
645
|
+
required: [
|
|
646
|
+
"input",
|
|
647
|
+
"keyInfo",
|
|
648
|
+
"signature"
|
|
649
|
+
]
|
|
650
|
+
},
|
|
651
|
+
VerifyRawSignatureResponse: {
|
|
652
|
+
type: "object",
|
|
653
|
+
properties: {
|
|
654
|
+
isValid: {
|
|
655
|
+
type: "boolean",
|
|
656
|
+
description: "Indicates whether the signature is valid or not."
|
|
657
|
+
}
|
|
658
|
+
},
|
|
659
|
+
required: [
|
|
660
|
+
"isValid"
|
|
661
|
+
],
|
|
662
|
+
additionalProperties: false,
|
|
663
|
+
description: "Response body containing the details of the signature verification."
|
|
664
|
+
},
|
|
665
|
+
KmsListKeyProvidersArgs: {
|
|
666
|
+
type: "object",
|
|
667
|
+
properties: {
|
|
668
|
+
baseUrl: {
|
|
669
|
+
type: "string"
|
|
670
|
+
}
|
|
671
|
+
},
|
|
672
|
+
additionalProperties: false
|
|
673
|
+
},
|
|
674
|
+
ListKeyProvidersResponse: {
|
|
675
|
+
type: "object",
|
|
676
|
+
properties: {
|
|
677
|
+
providers: {
|
|
678
|
+
type: "array",
|
|
679
|
+
items: {
|
|
680
|
+
$ref: "#/components/schemas/KeyProvider"
|
|
681
|
+
}
|
|
682
|
+
}
|
|
683
|
+
},
|
|
684
|
+
required: [
|
|
685
|
+
"providers"
|
|
686
|
+
],
|
|
687
|
+
additionalProperties: false,
|
|
688
|
+
description: "Response body containing the details of a Key Provider instance."
|
|
689
|
+
},
|
|
690
|
+
KeyProvider: {
|
|
691
|
+
type: "object",
|
|
692
|
+
properties: {
|
|
693
|
+
providerId: {
|
|
694
|
+
type: "string",
|
|
695
|
+
description: "The unique identifier assigned to the Key Provider instance upon creation."
|
|
696
|
+
},
|
|
697
|
+
type: {
|
|
698
|
+
$ref: "#/components/schemas/KeyProviderType"
|
|
699
|
+
}
|
|
700
|
+
},
|
|
701
|
+
required: [
|
|
702
|
+
"providerId",
|
|
703
|
+
"type"
|
|
704
|
+
],
|
|
705
|
+
additionalProperties: false,
|
|
706
|
+
description: "Response body containing the details of a Key Provider instance."
|
|
707
|
+
},
|
|
708
|
+
KmsListKeysArgs: {
|
|
709
|
+
type: "object",
|
|
710
|
+
properties: {
|
|
711
|
+
baseUrl: {
|
|
712
|
+
type: "string"
|
|
713
|
+
},
|
|
714
|
+
providerId: {
|
|
715
|
+
type: "string"
|
|
716
|
+
}
|
|
717
|
+
},
|
|
718
|
+
additionalProperties: false
|
|
719
|
+
},
|
|
720
|
+
ListKeysResponse: {
|
|
721
|
+
type: "object",
|
|
722
|
+
properties: {
|
|
723
|
+
keyInfos: {
|
|
724
|
+
type: "array",
|
|
725
|
+
items: {
|
|
726
|
+
$ref: "#/components/schemas/ManagedKeyInfo"
|
|
727
|
+
}
|
|
728
|
+
}
|
|
729
|
+
},
|
|
730
|
+
required: [
|
|
731
|
+
"keyInfos"
|
|
732
|
+
],
|
|
733
|
+
additionalProperties: false,
|
|
734
|
+
description: "Response body containing all the managed keys."
|
|
735
|
+
},
|
|
736
|
+
KmsListResolversArgs: {
|
|
737
|
+
type: "object",
|
|
738
|
+
properties: {
|
|
739
|
+
baseUrl: {
|
|
740
|
+
type: "string"
|
|
741
|
+
}
|
|
742
|
+
},
|
|
743
|
+
additionalProperties: false
|
|
744
|
+
},
|
|
745
|
+
ListResolversResponse: {
|
|
746
|
+
type: "object",
|
|
747
|
+
properties: {
|
|
748
|
+
resolvers: {
|
|
749
|
+
type: "array",
|
|
750
|
+
items: {
|
|
751
|
+
$ref: "#/components/schemas/Resolver"
|
|
752
|
+
}
|
|
753
|
+
}
|
|
754
|
+
},
|
|
755
|
+
required: [
|
|
756
|
+
"resolvers"
|
|
757
|
+
],
|
|
758
|
+
additionalProperties: false,
|
|
759
|
+
description: "Response body containing all the resolvers."
|
|
760
|
+
},
|
|
761
|
+
KmsProviderDeleteKeyArgs: {
|
|
762
|
+
type: "object",
|
|
763
|
+
properties: {
|
|
764
|
+
baseUrl: {
|
|
765
|
+
type: "string"
|
|
766
|
+
},
|
|
767
|
+
providerId: {
|
|
768
|
+
type: "string"
|
|
769
|
+
},
|
|
770
|
+
aliasOrKid: {
|
|
771
|
+
type: "string"
|
|
772
|
+
}
|
|
773
|
+
},
|
|
774
|
+
required: [
|
|
775
|
+
"providerId",
|
|
776
|
+
"aliasOrKid"
|
|
777
|
+
],
|
|
778
|
+
additionalProperties: false
|
|
779
|
+
},
|
|
780
|
+
KmsProviderGenerateKey: {
|
|
781
|
+
type: "object",
|
|
782
|
+
additionalProperties: false,
|
|
783
|
+
properties: {
|
|
784
|
+
alias: {
|
|
785
|
+
type: "string",
|
|
786
|
+
description: "Alias for the generated key."
|
|
787
|
+
},
|
|
788
|
+
use: {
|
|
789
|
+
$ref: "#/components/schemas/JwkUse"
|
|
790
|
+
},
|
|
791
|
+
keyOperations: {
|
|
792
|
+
type: "array",
|
|
793
|
+
items: {
|
|
794
|
+
$ref: "#/components/schemas/KeyOperations"
|
|
795
|
+
}
|
|
796
|
+
},
|
|
797
|
+
alg: {
|
|
798
|
+
$ref: "#/components/schemas/SignatureAlgorithm"
|
|
799
|
+
},
|
|
800
|
+
baseUrl: {
|
|
801
|
+
type: "string"
|
|
802
|
+
},
|
|
803
|
+
providerId: {
|
|
804
|
+
type: "string"
|
|
805
|
+
}
|
|
806
|
+
},
|
|
807
|
+
required: [
|
|
808
|
+
"providerId"
|
|
809
|
+
]
|
|
810
|
+
},
|
|
811
|
+
KmsProviderGetKeyArgs: {
|
|
812
|
+
type: "object",
|
|
813
|
+
properties: {
|
|
814
|
+
baseUrl: {
|
|
815
|
+
type: "string"
|
|
816
|
+
},
|
|
817
|
+
providerId: {
|
|
818
|
+
type: "string"
|
|
819
|
+
},
|
|
820
|
+
aliasOrKid: {
|
|
821
|
+
type: "string"
|
|
822
|
+
}
|
|
823
|
+
},
|
|
824
|
+
required: [
|
|
825
|
+
"providerId",
|
|
826
|
+
"aliasOrKid"
|
|
827
|
+
],
|
|
828
|
+
additionalProperties: false
|
|
829
|
+
},
|
|
830
|
+
KmsProviderListKeysArgs: {
|
|
831
|
+
type: "object",
|
|
832
|
+
properties: {
|
|
833
|
+
baseUrl: {
|
|
834
|
+
type: "string"
|
|
835
|
+
},
|
|
836
|
+
providerId: {
|
|
837
|
+
type: "string"
|
|
838
|
+
}
|
|
839
|
+
},
|
|
840
|
+
required: [
|
|
841
|
+
"providerId"
|
|
842
|
+
],
|
|
843
|
+
additionalProperties: false
|
|
844
|
+
},
|
|
845
|
+
KmsProviderStoreKey: {
|
|
846
|
+
type: "object",
|
|
847
|
+
additionalProperties: false,
|
|
848
|
+
properties: {
|
|
849
|
+
keyInfo: {
|
|
850
|
+
$ref: "#/components/schemas/ResolvedKeyInfo"
|
|
851
|
+
},
|
|
852
|
+
certChain: {
|
|
853
|
+
type: "array",
|
|
854
|
+
items: {
|
|
855
|
+
type: "string"
|
|
856
|
+
},
|
|
857
|
+
description: "X.509 certificate chain as base64-encoded DER certificates."
|
|
858
|
+
},
|
|
859
|
+
baseUrl: {
|
|
860
|
+
type: "string"
|
|
861
|
+
},
|
|
862
|
+
providerId: {
|
|
863
|
+
type: "string"
|
|
864
|
+
}
|
|
865
|
+
},
|
|
866
|
+
required: [
|
|
867
|
+
"keyInfo",
|
|
868
|
+
"providerId"
|
|
869
|
+
]
|
|
870
|
+
},
|
|
871
|
+
ResolvedKeyInfo: {
|
|
872
|
+
type: "object",
|
|
873
|
+
properties: {
|
|
874
|
+
kid: {
|
|
875
|
+
type: "string",
|
|
876
|
+
description: "Unique identifier for the cryptographic key. Can be null if the key identifier is not provided."
|
|
877
|
+
},
|
|
878
|
+
key: {
|
|
879
|
+
$ref: "#/components/schemas/Jwk"
|
|
880
|
+
},
|
|
881
|
+
signatureAlgorithm: {
|
|
882
|
+
$ref: "#/components/schemas/SignatureAlgorithm"
|
|
883
|
+
},
|
|
884
|
+
keyVisibility: {
|
|
885
|
+
$ref: "#/components/schemas/KeyVisibility"
|
|
886
|
+
},
|
|
887
|
+
x5c: {
|
|
888
|
+
type: "array",
|
|
889
|
+
items: {
|
|
890
|
+
type: "string"
|
|
891
|
+
},
|
|
892
|
+
description: "X.509 certificate chain associated with the key."
|
|
893
|
+
},
|
|
894
|
+
alias: {
|
|
895
|
+
type: "string",
|
|
896
|
+
description: "A reference or alias to the key in the Key Management Service (KMS)."
|
|
897
|
+
},
|
|
898
|
+
providerId: {
|
|
899
|
+
type: "string",
|
|
900
|
+
description: "The Key Management System (KMS) identifier associated with the key."
|
|
901
|
+
},
|
|
902
|
+
keyType: {
|
|
903
|
+
$ref: "#/components/schemas/KeyType"
|
|
904
|
+
},
|
|
905
|
+
keyEncoding: {
|
|
906
|
+
$ref: "#/components/schemas/KeyEncoding"
|
|
907
|
+
},
|
|
908
|
+
opts: {
|
|
909
|
+
type: "object",
|
|
910
|
+
additionalProperties: {
|
|
911
|
+
type: "string"
|
|
912
|
+
},
|
|
913
|
+
description: "Additional configuration options as key-value pairs."
|
|
914
|
+
}
|
|
915
|
+
},
|
|
916
|
+
required: [
|
|
917
|
+
"key"
|
|
918
|
+
],
|
|
919
|
+
additionalProperties: false,
|
|
920
|
+
description: "Represents a resolved cryptographic key information where the key is guaranteed to be present and resolved, providing concrete access to the key."
|
|
921
|
+
},
|
|
922
|
+
KmsResolveKeyArgs: {
|
|
923
|
+
type: "object",
|
|
924
|
+
additionalProperties: false,
|
|
925
|
+
properties: {
|
|
926
|
+
keyInfo: {
|
|
927
|
+
$ref: "#/components/schemas/KeyInfo"
|
|
928
|
+
},
|
|
929
|
+
identifierMethod: {
|
|
930
|
+
$ref: "#/components/schemas/IdentifierMethod"
|
|
931
|
+
},
|
|
932
|
+
trustedCerts: {
|
|
933
|
+
type: "array",
|
|
934
|
+
items: {
|
|
935
|
+
type: "string"
|
|
936
|
+
},
|
|
937
|
+
description: "Optional array of trusted certificates (base64-encoded) that may be used in the resolution process."
|
|
938
|
+
},
|
|
939
|
+
verifyX509CertificateChain: {
|
|
940
|
+
type: "boolean",
|
|
941
|
+
description: "Optional boolean indicating whether the X.509 certificate chain should be verified."
|
|
942
|
+
},
|
|
943
|
+
baseUrl: {
|
|
944
|
+
type: "string"
|
|
945
|
+
},
|
|
946
|
+
resolverId: {
|
|
947
|
+
$ref: "#/components/schemas/String"
|
|
948
|
+
}
|
|
949
|
+
},
|
|
950
|
+
required: [
|
|
951
|
+
"keyInfo",
|
|
952
|
+
"resolverId"
|
|
953
|
+
]
|
|
954
|
+
},
|
|
955
|
+
String: {
|
|
956
|
+
type: "object",
|
|
957
|
+
properties: {
|
|
958
|
+
length: {
|
|
959
|
+
type: "number"
|
|
960
|
+
}
|
|
961
|
+
},
|
|
962
|
+
required: [
|
|
963
|
+
"length"
|
|
964
|
+
],
|
|
965
|
+
additionalProperties: {
|
|
966
|
+
type: "string"
|
|
967
|
+
}
|
|
968
|
+
},
|
|
969
|
+
KmsStoreKeyArgs: {
|
|
970
|
+
type: "object",
|
|
971
|
+
additionalProperties: false,
|
|
972
|
+
properties: {
|
|
973
|
+
keyInfo: {
|
|
974
|
+
$ref: "#/components/schemas/ResolvedKeyInfo"
|
|
975
|
+
},
|
|
976
|
+
certChain: {
|
|
977
|
+
type: "array",
|
|
978
|
+
items: {
|
|
979
|
+
type: "string"
|
|
980
|
+
},
|
|
981
|
+
description: "X.509 certificate chain as base64-encoded DER certificates."
|
|
982
|
+
},
|
|
983
|
+
baseUrl: {
|
|
984
|
+
type: "string"
|
|
985
|
+
}
|
|
986
|
+
},
|
|
987
|
+
required: [
|
|
988
|
+
"keyInfo"
|
|
989
|
+
]
|
|
990
|
+
}
|
|
991
|
+
},
|
|
992
|
+
methods: {
|
|
993
|
+
kmsCreateRawSignature: {
|
|
994
|
+
description: "",
|
|
995
|
+
arguments: {
|
|
996
|
+
$ref: "#/components/schemas/KmsCreateRawSignatureArgs"
|
|
997
|
+
},
|
|
998
|
+
returnType: {
|
|
999
|
+
$ref: "#/components/schemas/CreateRawSignatureResponse"
|
|
1000
|
+
}
|
|
1001
|
+
},
|
|
1002
|
+
kmsDeleteKey: {
|
|
1003
|
+
description: "",
|
|
1004
|
+
arguments: {
|
|
1005
|
+
$ref: "#/components/schemas/KmsDeleteKeyArgs"
|
|
1006
|
+
},
|
|
1007
|
+
returnType: {
|
|
1008
|
+
type: "boolean"
|
|
1009
|
+
}
|
|
1010
|
+
},
|
|
1011
|
+
kmsGenerateKey: {
|
|
1012
|
+
description: "",
|
|
1013
|
+
arguments: {
|
|
1014
|
+
$ref: "#/components/schemas/KmsGenerateKeyArgs"
|
|
1015
|
+
},
|
|
1016
|
+
returnType: {
|
|
1017
|
+
$ref: "#/components/schemas/ManagedKeyPair"
|
|
1018
|
+
}
|
|
1019
|
+
},
|
|
1020
|
+
kmsGetKey: {
|
|
1021
|
+
description: "",
|
|
1022
|
+
arguments: {
|
|
1023
|
+
$ref: "#/components/schemas/KmsGetKeyArgs"
|
|
1024
|
+
},
|
|
1025
|
+
returnType: {
|
|
1026
|
+
$ref: "#/components/schemas/ManagedKeyInfo"
|
|
1027
|
+
}
|
|
1028
|
+
},
|
|
1029
|
+
kmsGetKeyProvider: {
|
|
1030
|
+
description: "",
|
|
1031
|
+
arguments: {
|
|
1032
|
+
$ref: "#/components/schemas/KmsGetKeyProviderArgs"
|
|
1033
|
+
},
|
|
1034
|
+
returnType: {
|
|
1035
|
+
$ref: "#/components/schemas/KeyProviderResponse"
|
|
1036
|
+
}
|
|
1037
|
+
},
|
|
1038
|
+
kmsGetResolver: {
|
|
1039
|
+
description: "",
|
|
1040
|
+
arguments: {
|
|
1041
|
+
$ref: "#/components/schemas/kmsGetResolverArgs"
|
|
1042
|
+
},
|
|
1043
|
+
returnType: {
|
|
1044
|
+
$ref: "#/components/schemas/Resolver"
|
|
1045
|
+
}
|
|
1046
|
+
},
|
|
1047
|
+
kmsIsValidRawSignature: {
|
|
1048
|
+
description: "",
|
|
1049
|
+
arguments: {
|
|
1050
|
+
$ref: "#/components/schemas/KmsIsValidRawSignatureArgs"
|
|
1051
|
+
},
|
|
1052
|
+
returnType: {
|
|
1053
|
+
$ref: "#/components/schemas/VerifyRawSignatureResponse"
|
|
1054
|
+
}
|
|
1055
|
+
},
|
|
1056
|
+
kmsListKeyProviders: {
|
|
1057
|
+
description: "",
|
|
1058
|
+
arguments: {
|
|
1059
|
+
$ref: "#/components/schemas/KmsListKeyProvidersArgs"
|
|
1060
|
+
},
|
|
1061
|
+
returnType: {
|
|
1062
|
+
$ref: "#/components/schemas/ListKeyProvidersResponse"
|
|
1063
|
+
}
|
|
1064
|
+
},
|
|
1065
|
+
kmsListKeys: {
|
|
1066
|
+
description: "",
|
|
1067
|
+
arguments: {
|
|
1068
|
+
$ref: "#/components/schemas/KmsListKeysArgs"
|
|
1069
|
+
},
|
|
1070
|
+
returnType: {
|
|
1071
|
+
$ref: "#/components/schemas/ListKeysResponse"
|
|
1072
|
+
}
|
|
1073
|
+
},
|
|
1074
|
+
kmsListResolvers: {
|
|
1075
|
+
description: "",
|
|
1076
|
+
arguments: {
|
|
1077
|
+
$ref: "#/components/schemas/KmsListResolversArgs"
|
|
1078
|
+
},
|
|
1079
|
+
returnType: {
|
|
1080
|
+
$ref: "#/components/schemas/ListResolversResponse"
|
|
1081
|
+
}
|
|
1082
|
+
},
|
|
1083
|
+
kmsProviderDeleteKey: {
|
|
1084
|
+
description: "",
|
|
1085
|
+
arguments: {
|
|
1086
|
+
$ref: "#/components/schemas/KmsProviderDeleteKeyArgs"
|
|
1087
|
+
},
|
|
1088
|
+
returnType: {
|
|
1089
|
+
type: "boolean"
|
|
1090
|
+
}
|
|
1091
|
+
},
|
|
1092
|
+
kmsProviderGenerateKey: {
|
|
1093
|
+
description: "",
|
|
1094
|
+
arguments: {
|
|
1095
|
+
$ref: "#/components/schemas/KmsProviderGenerateKey"
|
|
1096
|
+
},
|
|
1097
|
+
returnType: {
|
|
1098
|
+
$ref: "#/components/schemas/ManagedKeyPair"
|
|
1099
|
+
}
|
|
1100
|
+
},
|
|
1101
|
+
kmsProviderGetKey: {
|
|
1102
|
+
description: "",
|
|
1103
|
+
arguments: {
|
|
1104
|
+
$ref: "#/components/schemas/KmsProviderGetKeyArgs"
|
|
1105
|
+
},
|
|
1106
|
+
returnType: {
|
|
1107
|
+
$ref: "#/components/schemas/ManagedKeyInfo"
|
|
1108
|
+
}
|
|
1109
|
+
},
|
|
1110
|
+
kmsProviderListKeys: {
|
|
1111
|
+
description: "",
|
|
1112
|
+
arguments: {
|
|
1113
|
+
$ref: "#/components/schemas/KmsProviderListKeysArgs"
|
|
1114
|
+
},
|
|
1115
|
+
returnType: {
|
|
1116
|
+
$ref: "#/components/schemas/ListKeysResponse"
|
|
1117
|
+
}
|
|
1118
|
+
},
|
|
1119
|
+
kmsProviderStoreKey: {
|
|
1120
|
+
description: "",
|
|
1121
|
+
arguments: {
|
|
1122
|
+
$ref: "#/components/schemas/KmsProviderStoreKey"
|
|
1123
|
+
},
|
|
1124
|
+
returnType: {
|
|
1125
|
+
$ref: "#/components/schemas/ManagedKeyInfo"
|
|
1126
|
+
}
|
|
1127
|
+
},
|
|
1128
|
+
kmsResolveKey: {
|
|
1129
|
+
description: "",
|
|
1130
|
+
arguments: {
|
|
1131
|
+
$ref: "#/components/schemas/KmsResolveKeyArgs"
|
|
1132
|
+
},
|
|
1133
|
+
returnType: {
|
|
1134
|
+
$ref: "#/components/schemas/ResolvedKeyInfo"
|
|
1135
|
+
}
|
|
1136
|
+
},
|
|
1137
|
+
kmsStoreKey: {
|
|
1138
|
+
description: "",
|
|
1139
|
+
arguments: {
|
|
1140
|
+
$ref: "#/components/schemas/KmsStoreKeyArgs"
|
|
1141
|
+
},
|
|
1142
|
+
returnType: {
|
|
1143
|
+
$ref: "#/components/schemas/ManagedKeyInfo"
|
|
1144
|
+
}
|
|
1145
|
+
}
|
|
1146
|
+
}
|
|
1147
|
+
}
|
|
1148
|
+
}
|
|
1149
|
+
};
|
|
1150
|
+
}
|
|
1151
|
+
});
|
|
1152
|
+
|
|
1153
|
+
// src/index.ts
|
|
1154
|
+
var index_exports = {};
|
|
1155
|
+
__export(index_exports, {
|
|
1156
|
+
KmsRestClient: () => KmsRestClient,
|
|
1157
|
+
schema: () => schema
|
|
1158
|
+
});
|
|
1159
|
+
module.exports = __toCommonJS(index_exports);
|
|
1160
|
+
|
|
1161
|
+
// src/agent/KmsRestClient.ts
|
|
1162
|
+
var import_ssi_types = require("@sphereon/ssi-types");
|
|
1163
|
+
var import_cross_fetch = require("cross-fetch");
|
|
1164
|
+
|
|
1165
|
+
// src/models/CoseKeyType.ts
|
|
1166
|
+
function CoseKeyTypeFromJSON(json) {
|
|
1167
|
+
return CoseKeyTypeFromJSONTyped(json, false);
|
|
1168
|
+
}
|
|
1169
|
+
__name(CoseKeyTypeFromJSON, "CoseKeyTypeFromJSON");
|
|
1170
|
+
function CoseKeyTypeFromJSONTyped(json, ignoreDiscriminator) {
|
|
1171
|
+
return json;
|
|
1172
|
+
}
|
|
1173
|
+
__name(CoseKeyTypeFromJSONTyped, "CoseKeyTypeFromJSONTyped");
|
|
1174
|
+
|
|
1175
|
+
// src/models/CoseKey.ts
|
|
1176
|
+
function CoseKeyFromJSON(json) {
|
|
1177
|
+
return CoseKeyFromJSONTyped(json, false);
|
|
1178
|
+
}
|
|
1179
|
+
__name(CoseKeyFromJSON, "CoseKeyFromJSON");
|
|
1180
|
+
function CoseKeyFromJSONTyped(json, ignoreDiscriminator) {
|
|
1181
|
+
if (json == null) {
|
|
1182
|
+
return json;
|
|
1183
|
+
}
|
|
1184
|
+
return {
|
|
1185
|
+
"kty": CoseKeyTypeFromJSON(json["kty"]),
|
|
1186
|
+
"kid": json["kid"] == null ? void 0 : json["kid"],
|
|
1187
|
+
"alg": json["alg"] == null ? void 0 : json["alg"],
|
|
1188
|
+
"keyOps": json["key_ops"] == null ? void 0 : json["key_ops"],
|
|
1189
|
+
"baseIV": json["baseIV"] == null ? void 0 : json["baseIV"],
|
|
1190
|
+
"crv": json["crv"] == null ? void 0 : json["crv"],
|
|
1191
|
+
"x": json["x"] == null ? void 0 : json["x"],
|
|
1192
|
+
"y": json["y"] == null ? void 0 : json["y"],
|
|
1193
|
+
"d": json["d"] == null ? void 0 : json["d"],
|
|
1194
|
+
"x5chain": json["x5chain"] == null ? void 0 : json["x5chain"]
|
|
1195
|
+
};
|
|
1196
|
+
}
|
|
1197
|
+
__name(CoseKeyFromJSONTyped, "CoseKeyFromJSONTyped");
|
|
1198
|
+
|
|
1199
|
+
// src/models/CoseKeyPair.ts
|
|
1200
|
+
function CoseKeyPairFromJSON(json) {
|
|
1201
|
+
return CoseKeyPairFromJSONTyped(json, false);
|
|
1202
|
+
}
|
|
1203
|
+
__name(CoseKeyPairFromJSON, "CoseKeyPairFromJSON");
|
|
1204
|
+
function CoseKeyPairFromJSONTyped(json, ignoreDiscriminator) {
|
|
1205
|
+
if (json == null) {
|
|
1206
|
+
return json;
|
|
1207
|
+
}
|
|
1208
|
+
return {
|
|
1209
|
+
"privateCoseKey": json["privateCoseKey"] == null ? void 0 : CoseKeyFromJSON(json["privateCoseKey"]),
|
|
1210
|
+
"publicCoseKey": CoseKeyFromJSON(json["publicCoseKey"])
|
|
1211
|
+
};
|
|
1212
|
+
}
|
|
1213
|
+
__name(CoseKeyPairFromJSONTyped, "CoseKeyPairFromJSONTyped");
|
|
1214
|
+
|
|
1215
|
+
// src/models/KeyProviderType.ts
|
|
1216
|
+
function KeyProviderTypeFromJSON(json) {
|
|
1217
|
+
return KeyProviderTypeFromJSONTyped(json, false);
|
|
1218
|
+
}
|
|
1219
|
+
__name(KeyProviderTypeFromJSON, "KeyProviderTypeFromJSON");
|
|
1220
|
+
function KeyProviderTypeFromJSONTyped(json, ignoreDiscriminator) {
|
|
1221
|
+
return json;
|
|
1222
|
+
}
|
|
1223
|
+
__name(KeyProviderTypeFromJSONTyped, "KeyProviderTypeFromJSONTyped");
|
|
1224
|
+
|
|
1225
|
+
// src/models/KeyType.ts
|
|
1226
|
+
function KeyTypeFromJSON(json) {
|
|
1227
|
+
return KeyTypeFromJSONTyped(json, false);
|
|
1228
|
+
}
|
|
1229
|
+
__name(KeyTypeFromJSON, "KeyTypeFromJSON");
|
|
1230
|
+
function KeyTypeFromJSONTyped(json, ignoreDiscriminator) {
|
|
1231
|
+
return json;
|
|
1232
|
+
}
|
|
1233
|
+
__name(KeyTypeFromJSONTyped, "KeyTypeFromJSONTyped");
|
|
1234
|
+
function KeyTypeToJSON(value) {
|
|
1235
|
+
return value;
|
|
1236
|
+
}
|
|
1237
|
+
__name(KeyTypeToJSON, "KeyTypeToJSON");
|
|
1238
|
+
|
|
1239
|
+
// src/models/KeyVisibility.ts
|
|
1240
|
+
function KeyVisibilityFromJSON(json) {
|
|
1241
|
+
return KeyVisibilityFromJSONTyped(json, false);
|
|
1242
|
+
}
|
|
1243
|
+
__name(KeyVisibilityFromJSON, "KeyVisibilityFromJSON");
|
|
1244
|
+
function KeyVisibilityFromJSONTyped(json, ignoreDiscriminator) {
|
|
1245
|
+
return json;
|
|
1246
|
+
}
|
|
1247
|
+
__name(KeyVisibilityFromJSONTyped, "KeyVisibilityFromJSONTyped");
|
|
1248
|
+
function KeyVisibilityToJSON(value) {
|
|
1249
|
+
return value;
|
|
1250
|
+
}
|
|
1251
|
+
__name(KeyVisibilityToJSON, "KeyVisibilityToJSON");
|
|
1252
|
+
|
|
1253
|
+
// src/models/SignatureAlgorithm.ts
|
|
1254
|
+
function SignatureAlgorithmFromJSON(json) {
|
|
1255
|
+
return SignatureAlgorithmFromJSONTyped(json, false);
|
|
1256
|
+
}
|
|
1257
|
+
__name(SignatureAlgorithmFromJSON, "SignatureAlgorithmFromJSON");
|
|
1258
|
+
function SignatureAlgorithmFromJSONTyped(json, ignoreDiscriminator) {
|
|
1259
|
+
return json;
|
|
1260
|
+
}
|
|
1261
|
+
__name(SignatureAlgorithmFromJSONTyped, "SignatureAlgorithmFromJSONTyped");
|
|
1262
|
+
function SignatureAlgorithmToJSON(value) {
|
|
1263
|
+
return value;
|
|
1264
|
+
}
|
|
1265
|
+
__name(SignatureAlgorithmToJSON, "SignatureAlgorithmToJSON");
|
|
1266
|
+
|
|
1267
|
+
// src/models/KeyEncoding.ts
|
|
1268
|
+
function KeyEncodingFromJSON(json) {
|
|
1269
|
+
return KeyEncodingFromJSONTyped(json, false);
|
|
1270
|
+
}
|
|
1271
|
+
__name(KeyEncodingFromJSON, "KeyEncodingFromJSON");
|
|
1272
|
+
function KeyEncodingFromJSONTyped(json, ignoreDiscriminator) {
|
|
1273
|
+
return json;
|
|
1274
|
+
}
|
|
1275
|
+
__name(KeyEncodingFromJSONTyped, "KeyEncodingFromJSONTyped");
|
|
1276
|
+
function KeyEncodingToJSON(value) {
|
|
1277
|
+
return value;
|
|
1278
|
+
}
|
|
1279
|
+
__name(KeyEncodingToJSON, "KeyEncodingToJSON");
|
|
1280
|
+
|
|
1281
|
+
// src/models/Curve.ts
|
|
1282
|
+
function CurveFromJSON(json) {
|
|
1283
|
+
return CurveFromJSONTyped(json, false);
|
|
1284
|
+
}
|
|
1285
|
+
__name(CurveFromJSON, "CurveFromJSON");
|
|
1286
|
+
function CurveFromJSONTyped(json, ignoreDiscriminator) {
|
|
1287
|
+
return json;
|
|
1288
|
+
}
|
|
1289
|
+
__name(CurveFromJSONTyped, "CurveFromJSONTyped");
|
|
1290
|
+
function CurveToJSON(value) {
|
|
1291
|
+
return value;
|
|
1292
|
+
}
|
|
1293
|
+
__name(CurveToJSON, "CurveToJSON");
|
|
1294
|
+
|
|
1295
|
+
// src/models/KeyOperations.ts
|
|
1296
|
+
function KeyOperationsFromJSON(json) {
|
|
1297
|
+
return KeyOperationsFromJSONTyped(json, false);
|
|
1298
|
+
}
|
|
1299
|
+
__name(KeyOperationsFromJSON, "KeyOperationsFromJSON");
|
|
1300
|
+
function KeyOperationsFromJSONTyped(json, ignoreDiscriminator) {
|
|
1301
|
+
return json;
|
|
1302
|
+
}
|
|
1303
|
+
__name(KeyOperationsFromJSONTyped, "KeyOperationsFromJSONTyped");
|
|
1304
|
+
function KeyOperationsToJSON(value) {
|
|
1305
|
+
return value;
|
|
1306
|
+
}
|
|
1307
|
+
__name(KeyOperationsToJSON, "KeyOperationsToJSON");
|
|
1308
|
+
|
|
1309
|
+
// src/models/JwkUse.ts
|
|
1310
|
+
function JwkUseFromJSON(json) {
|
|
1311
|
+
return JwkUseFromJSONTyped(json, false);
|
|
1312
|
+
}
|
|
1313
|
+
__name(JwkUseFromJSON, "JwkUseFromJSON");
|
|
1314
|
+
function JwkUseFromJSONTyped(json, ignoreDiscriminator) {
|
|
1315
|
+
return json;
|
|
1316
|
+
}
|
|
1317
|
+
__name(JwkUseFromJSONTyped, "JwkUseFromJSONTyped");
|
|
1318
|
+
function JwkUseToJSON(value) {
|
|
1319
|
+
return value;
|
|
1320
|
+
}
|
|
1321
|
+
__name(JwkUseToJSON, "JwkUseToJSON");
|
|
1322
|
+
|
|
1323
|
+
// src/models/JwkKeyType.ts
|
|
1324
|
+
function JwkKeyTypeFromJSON(json) {
|
|
1325
|
+
return JwkKeyTypeFromJSONTyped(json, false);
|
|
1326
|
+
}
|
|
1327
|
+
__name(JwkKeyTypeFromJSON, "JwkKeyTypeFromJSON");
|
|
1328
|
+
function JwkKeyTypeFromJSONTyped(json, ignoreDiscriminator) {
|
|
1329
|
+
return json;
|
|
1330
|
+
}
|
|
1331
|
+
__name(JwkKeyTypeFromJSONTyped, "JwkKeyTypeFromJSONTyped");
|
|
1332
|
+
function JwkKeyTypeToJSON(value) {
|
|
1333
|
+
return value;
|
|
1334
|
+
}
|
|
1335
|
+
__name(JwkKeyTypeToJSON, "JwkKeyTypeToJSON");
|
|
1336
|
+
|
|
1337
|
+
// src/models/Jwk.ts
|
|
1338
|
+
function JwkFromJSON(json) {
|
|
1339
|
+
return JwkFromJSONTyped(json, false);
|
|
1340
|
+
}
|
|
1341
|
+
__name(JwkFromJSON, "JwkFromJSON");
|
|
1342
|
+
function JwkFromJSONTyped(json, ignoreDiscriminator) {
|
|
1343
|
+
if (json == null) {
|
|
1344
|
+
return json;
|
|
1345
|
+
}
|
|
1346
|
+
return {
|
|
1347
|
+
"kty": JwkKeyTypeFromJSON(json["kty"]),
|
|
1348
|
+
"kid": json["kid"] == null ? void 0 : json["kid"],
|
|
1349
|
+
"alg": json["alg"] == null ? void 0 : json["alg"],
|
|
1350
|
+
"use": json["use"] == null ? void 0 : JwkUseFromJSON(json["use"]),
|
|
1351
|
+
"keyOps": json["key_ops"] == null ? void 0 : json["key_ops"].map(KeyOperationsFromJSON),
|
|
1352
|
+
"crv": json["crv"] == null ? void 0 : CurveFromJSON(json["crv"]),
|
|
1353
|
+
"x": json["x"] == null ? void 0 : json["x"],
|
|
1354
|
+
"y": json["y"] == null ? void 0 : json["y"],
|
|
1355
|
+
"d": json["d"] == null ? void 0 : json["d"],
|
|
1356
|
+
"n": json["n"] == null ? void 0 : json["n"],
|
|
1357
|
+
"e": json["e"] == null ? void 0 : json["e"],
|
|
1358
|
+
"p": json["p"] == null ? void 0 : json["p"],
|
|
1359
|
+
"q": json["q"] == null ? void 0 : json["q"],
|
|
1360
|
+
"dp": json["dp"] == null ? void 0 : json["dp"],
|
|
1361
|
+
"dq": json["dq"] == null ? void 0 : json["dq"],
|
|
1362
|
+
"qi": json["qi"] == null ? void 0 : json["qi"],
|
|
1363
|
+
"k": json["k"] == null ? void 0 : json["k"],
|
|
1364
|
+
"x5c": json["x5c"] == null ? void 0 : json["x5c"],
|
|
1365
|
+
"x5t": json["x5t"] == null ? void 0 : json["x5t"],
|
|
1366
|
+
"x5u": json["x5u"] == null ? void 0 : json["x5u"],
|
|
1367
|
+
"x5tS256": json["x5t#S256"] == null ? void 0 : json["x5t#S256"]
|
|
1368
|
+
};
|
|
1369
|
+
}
|
|
1370
|
+
__name(JwkFromJSONTyped, "JwkFromJSONTyped");
|
|
1371
|
+
function JwkToJSON(json) {
|
|
1372
|
+
return JwkToJSONTyped(json, false);
|
|
1373
|
+
}
|
|
1374
|
+
__name(JwkToJSON, "JwkToJSON");
|
|
1375
|
+
function JwkToJSONTyped(value, ignoreDiscriminator = false) {
|
|
1376
|
+
if (value == null) {
|
|
1377
|
+
return value;
|
|
1378
|
+
}
|
|
1379
|
+
return {
|
|
1380
|
+
"kty": JwkKeyTypeToJSON(value["kty"]),
|
|
1381
|
+
"kid": value["kid"],
|
|
1382
|
+
"alg": value["alg"],
|
|
1383
|
+
"use": JwkUseToJSON(value["use"]),
|
|
1384
|
+
"key_ops": value["keyOps"] == null ? void 0 : value["keyOps"].map(KeyOperationsToJSON),
|
|
1385
|
+
"crv": CurveToJSON(value["crv"]),
|
|
1386
|
+
"x": value["x"],
|
|
1387
|
+
"y": value["y"],
|
|
1388
|
+
"d": value["d"],
|
|
1389
|
+
"n": value["n"],
|
|
1390
|
+
"e": value["e"],
|
|
1391
|
+
"p": value["p"],
|
|
1392
|
+
"q": value["q"],
|
|
1393
|
+
"dp": value["dp"],
|
|
1394
|
+
"dq": value["dq"],
|
|
1395
|
+
"qi": value["qi"],
|
|
1396
|
+
"k": value["k"],
|
|
1397
|
+
"x5c": value["x5c"],
|
|
1398
|
+
"x5t": value["x5t"],
|
|
1399
|
+
"x5u": value["x5u"],
|
|
1400
|
+
"x5t#S256": value["x5tS256"]
|
|
1401
|
+
};
|
|
1402
|
+
}
|
|
1403
|
+
__name(JwkToJSONTyped, "JwkToJSONTyped");
|
|
1404
|
+
|
|
1405
|
+
// src/models/KeyInfo.ts
|
|
1406
|
+
function KeyInfoToJSON(json) {
|
|
1407
|
+
return KeyInfoToJSONTyped(json, false);
|
|
1408
|
+
}
|
|
1409
|
+
__name(KeyInfoToJSON, "KeyInfoToJSON");
|
|
1410
|
+
function KeyInfoToJSONTyped(value, ignoreDiscriminator = false) {
|
|
1411
|
+
if (value == null) {
|
|
1412
|
+
return value;
|
|
1413
|
+
}
|
|
1414
|
+
return {
|
|
1415
|
+
"kid": value["kid"],
|
|
1416
|
+
"key": JwkToJSON(value["key"]),
|
|
1417
|
+
"signatureAlgorithm": SignatureAlgorithmToJSON(value["signatureAlgorithm"]),
|
|
1418
|
+
"keyVisibility": KeyVisibilityToJSON(value["keyVisibility"]),
|
|
1419
|
+
"x5c": value["x5c"],
|
|
1420
|
+
"alias": value["alias"],
|
|
1421
|
+
"providerId": value["providerId"],
|
|
1422
|
+
"keyType": KeyTypeToJSON(value["keyType"]),
|
|
1423
|
+
"keyEncoding": KeyEncodingToJSON(value["keyEncoding"]),
|
|
1424
|
+
"opts": value["opts"]
|
|
1425
|
+
};
|
|
1426
|
+
}
|
|
1427
|
+
__name(KeyInfoToJSONTyped, "KeyInfoToJSONTyped");
|
|
1428
|
+
|
|
1429
|
+
// src/models/CreateRawSignature.ts
|
|
1430
|
+
function CreateRawSignatureToJSONTyped(value, ignoreDiscriminator = false) {
|
|
1431
|
+
if (value == null) {
|
|
1432
|
+
return value;
|
|
1433
|
+
}
|
|
1434
|
+
return {
|
|
1435
|
+
"keyInfo": KeyInfoToJSON(value["keyInfo"]),
|
|
1436
|
+
"input": value["input"]
|
|
1437
|
+
};
|
|
1438
|
+
}
|
|
1439
|
+
__name(CreateRawSignatureToJSONTyped, "CreateRawSignatureToJSONTyped");
|
|
1440
|
+
|
|
1441
|
+
// src/models/CreateRawSignatureResponse.ts
|
|
1442
|
+
function CreateRawSignatureResponseFromJSONTyped(json, ignoreDiscriminator) {
|
|
1443
|
+
if (json == null) {
|
|
1444
|
+
return json;
|
|
1445
|
+
}
|
|
1446
|
+
return {
|
|
1447
|
+
"signature": json["signature"]
|
|
1448
|
+
};
|
|
1449
|
+
}
|
|
1450
|
+
__name(CreateRawSignatureResponseFromJSONTyped, "CreateRawSignatureResponseFromJSONTyped");
|
|
1451
|
+
|
|
1452
|
+
// src/models/GenerateKey.ts
|
|
1453
|
+
function GenerateKeyToJSONTyped(value, ignoreDiscriminator = false) {
|
|
1454
|
+
if (value == null) {
|
|
1455
|
+
return value;
|
|
1456
|
+
}
|
|
1457
|
+
return {
|
|
1458
|
+
"alias": value["alias"],
|
|
1459
|
+
"use": JwkUseToJSON(value["use"]),
|
|
1460
|
+
"keyOperations": value["keyOperations"] == null ? void 0 : value["keyOperations"].map(KeyOperationsToJSON),
|
|
1461
|
+
"alg": SignatureAlgorithmToJSON(value["alg"])
|
|
1462
|
+
};
|
|
1463
|
+
}
|
|
1464
|
+
__name(GenerateKeyToJSONTyped, "GenerateKeyToJSONTyped");
|
|
1465
|
+
|
|
1466
|
+
// src/models/GenerateKeyGlobal.ts
|
|
1467
|
+
function GenerateKeyGlobalToJSONTyped(value, ignoreDiscriminator = false) {
|
|
1468
|
+
if (value == null) {
|
|
1469
|
+
return value;
|
|
1470
|
+
}
|
|
1471
|
+
return {
|
|
1472
|
+
"alias": value["alias"],
|
|
1473
|
+
"use": JwkUseToJSON(value["use"]),
|
|
1474
|
+
"keyOperations": value["keyOperations"] == null ? void 0 : value["keyOperations"].map(KeyOperationsToJSON),
|
|
1475
|
+
"alg": SignatureAlgorithmToJSON(value["alg"]),
|
|
1476
|
+
"providerId": value["providerId"]
|
|
1477
|
+
};
|
|
1478
|
+
}
|
|
1479
|
+
__name(GenerateKeyGlobalToJSONTyped, "GenerateKeyGlobalToJSONTyped");
|
|
1480
|
+
|
|
1481
|
+
// src/models/JoseKeyPair.ts
|
|
1482
|
+
function JoseKeyPairFromJSON(json) {
|
|
1483
|
+
return JoseKeyPairFromJSONTyped(json, false);
|
|
1484
|
+
}
|
|
1485
|
+
__name(JoseKeyPairFromJSON, "JoseKeyPairFromJSON");
|
|
1486
|
+
function JoseKeyPairFromJSONTyped(json, ignoreDiscriminator) {
|
|
1487
|
+
if (json == null) {
|
|
1488
|
+
return json;
|
|
1489
|
+
}
|
|
1490
|
+
return {
|
|
1491
|
+
"privateJwk": json["privateJwk"] == null ? void 0 : JwkFromJSON(json["privateJwk"]),
|
|
1492
|
+
"publicJwk": JwkFromJSON(json["publicJwk"])
|
|
1493
|
+
};
|
|
1494
|
+
}
|
|
1495
|
+
__name(JoseKeyPairFromJSONTyped, "JoseKeyPairFromJSONTyped");
|
|
1496
|
+
|
|
1497
|
+
// src/models/ManagedKeyPair.ts
|
|
1498
|
+
function ManagedKeyPairFromJSONTyped(json, ignoreDiscriminator) {
|
|
1499
|
+
if (json == null) {
|
|
1500
|
+
return json;
|
|
1501
|
+
}
|
|
1502
|
+
return {
|
|
1503
|
+
"kid": json["kid"] == null ? void 0 : json["kid"],
|
|
1504
|
+
"providerId": json["providerId"],
|
|
1505
|
+
"alias": json["alias"],
|
|
1506
|
+
"cose": CoseKeyPairFromJSON(json["cose"]),
|
|
1507
|
+
"jose": JoseKeyPairFromJSON(json["jose"])
|
|
1508
|
+
};
|
|
1509
|
+
}
|
|
1510
|
+
__name(ManagedKeyPairFromJSONTyped, "ManagedKeyPairFromJSONTyped");
|
|
1511
|
+
|
|
1512
|
+
// src/models/ManagedKeyInfo.ts
|
|
1513
|
+
function ManagedKeyInfoFromJSON(json) {
|
|
1514
|
+
return ManagedKeyInfoFromJSONTyped(json, false);
|
|
1515
|
+
}
|
|
1516
|
+
__name(ManagedKeyInfoFromJSON, "ManagedKeyInfoFromJSON");
|
|
1517
|
+
function ManagedKeyInfoFromJSONTyped(json, ignoreDiscriminator) {
|
|
1518
|
+
if (json == null) {
|
|
1519
|
+
return json;
|
|
1520
|
+
}
|
|
1521
|
+
return {
|
|
1522
|
+
"kid": json["kid"] == null ? void 0 : json["kid"],
|
|
1523
|
+
"key": JwkFromJSON(json["key"]),
|
|
1524
|
+
"signatureAlgorithm": json["signatureAlgorithm"] == null ? void 0 : SignatureAlgorithmFromJSON(json["signatureAlgorithm"]),
|
|
1525
|
+
"keyVisibility": json["keyVisibility"] == null ? void 0 : KeyVisibilityFromJSON(json["keyVisibility"]),
|
|
1526
|
+
"x5c": json["x5c"] == null ? void 0 : json["x5c"],
|
|
1527
|
+
"alias": json["alias"],
|
|
1528
|
+
"providerId": json["providerId"],
|
|
1529
|
+
"keyType": json["keyType"] == null ? void 0 : KeyTypeFromJSON(json["keyType"]),
|
|
1530
|
+
"keyEncoding": json["keyEncoding"] == null ? void 0 : KeyEncodingFromJSON(json["keyEncoding"]),
|
|
1531
|
+
"opts": json["opts"] == null ? void 0 : json["opts"]
|
|
1532
|
+
};
|
|
1533
|
+
}
|
|
1534
|
+
__name(ManagedKeyInfoFromJSONTyped, "ManagedKeyInfoFromJSONTyped");
|
|
1535
|
+
|
|
1536
|
+
// src/models/IdentifierMethod.ts
|
|
1537
|
+
function IdentifierMethodFromJSON(json) {
|
|
1538
|
+
return IdentifierMethodFromJSONTyped(json, false);
|
|
1539
|
+
}
|
|
1540
|
+
__name(IdentifierMethodFromJSON, "IdentifierMethodFromJSON");
|
|
1541
|
+
function IdentifierMethodFromJSONTyped(json, ignoreDiscriminator) {
|
|
1542
|
+
return json;
|
|
1543
|
+
}
|
|
1544
|
+
__name(IdentifierMethodFromJSONTyped, "IdentifierMethodFromJSONTyped");
|
|
1545
|
+
function IdentifierMethodToJSON(value) {
|
|
1546
|
+
return value;
|
|
1547
|
+
}
|
|
1548
|
+
__name(IdentifierMethodToJSON, "IdentifierMethodToJSON");
|
|
1549
|
+
|
|
1550
|
+
// src/models/KeyProvider.ts
|
|
1551
|
+
function KeyProviderFromJSON(json) {
|
|
1552
|
+
return KeyProviderFromJSONTyped(json, false);
|
|
1553
|
+
}
|
|
1554
|
+
__name(KeyProviderFromJSON, "KeyProviderFromJSON");
|
|
1555
|
+
function KeyProviderFromJSONTyped(json, ignoreDiscriminator) {
|
|
1556
|
+
if (json == null) {
|
|
1557
|
+
return json;
|
|
1558
|
+
}
|
|
1559
|
+
return {
|
|
1560
|
+
"providerId": json["providerId"],
|
|
1561
|
+
"type": KeyProviderTypeFromJSON(json["type"])
|
|
1562
|
+
};
|
|
1563
|
+
}
|
|
1564
|
+
__name(KeyProviderFromJSONTyped, "KeyProviderFromJSONTyped");
|
|
1565
|
+
|
|
1566
|
+
// src/models/KeyProviderResponse.ts
|
|
1567
|
+
function KeyProviderResponseFromJSONTyped(json, ignoreDiscriminator) {
|
|
1568
|
+
if (json == null) {
|
|
1569
|
+
return json;
|
|
1570
|
+
}
|
|
1571
|
+
return {
|
|
1572
|
+
"providerId": json["providerId"],
|
|
1573
|
+
"type": KeyProviderTypeFromJSON(json["type"])
|
|
1574
|
+
};
|
|
1575
|
+
}
|
|
1576
|
+
__name(KeyProviderResponseFromJSONTyped, "KeyProviderResponseFromJSONTyped");
|
|
1577
|
+
|
|
1578
|
+
// src/models/ListKeyProvidersResponse.ts
|
|
1579
|
+
function ListKeyProvidersResponseFromJSONTyped(json, ignoreDiscriminator) {
|
|
1580
|
+
if (json == null) {
|
|
1581
|
+
return json;
|
|
1582
|
+
}
|
|
1583
|
+
return {
|
|
1584
|
+
"providers": json["providers"].map(KeyProviderFromJSON)
|
|
1585
|
+
};
|
|
1586
|
+
}
|
|
1587
|
+
__name(ListKeyProvidersResponseFromJSONTyped, "ListKeyProvidersResponseFromJSONTyped");
|
|
1588
|
+
|
|
1589
|
+
// src/models/ListKeysResponse.ts
|
|
1590
|
+
function ListKeysResponseFromJSONTyped(json, ignoreDiscriminator) {
|
|
1591
|
+
if (json == null) {
|
|
1592
|
+
return json;
|
|
1593
|
+
}
|
|
1594
|
+
return {
|
|
1595
|
+
"keyInfos": json["keyInfos"].map(ManagedKeyInfoFromJSON)
|
|
1596
|
+
};
|
|
1597
|
+
}
|
|
1598
|
+
__name(ListKeysResponseFromJSONTyped, "ListKeysResponseFromJSONTyped");
|
|
1599
|
+
|
|
1600
|
+
// src/models/Resolver.ts
|
|
1601
|
+
function ResolverFromJSON(json) {
|
|
1602
|
+
return ResolverFromJSONTyped(json, false);
|
|
1603
|
+
}
|
|
1604
|
+
__name(ResolverFromJSON, "ResolverFromJSON");
|
|
1605
|
+
function ResolverFromJSONTyped(json, ignoreDiscriminator) {
|
|
1606
|
+
if (json == null) {
|
|
1607
|
+
return json;
|
|
1608
|
+
}
|
|
1609
|
+
return {
|
|
1610
|
+
"resolverId": json["resolverId"],
|
|
1611
|
+
"supportedIdentifierMethods": json["supportedIdentifierMethods"] == null ? void 0 : json["supportedIdentifierMethods"].map(IdentifierMethodFromJSON),
|
|
1612
|
+
"supportedKeyTypes": json["supportedKeyTypes"] == null ? void 0 : json["supportedKeyTypes"].map(KeyTypeFromJSON)
|
|
1613
|
+
};
|
|
1614
|
+
}
|
|
1615
|
+
__name(ResolverFromJSONTyped, "ResolverFromJSONTyped");
|
|
1616
|
+
|
|
1617
|
+
// src/models/ListResolversResponse.ts
|
|
1618
|
+
function ListResolversResponseFromJSONTyped(json, ignoreDiscriminator) {
|
|
1619
|
+
if (json == null) {
|
|
1620
|
+
return json;
|
|
1621
|
+
}
|
|
1622
|
+
return {
|
|
1623
|
+
"resolvers": json["resolvers"].map(ResolverFromJSON)
|
|
1624
|
+
};
|
|
1625
|
+
}
|
|
1626
|
+
__name(ListResolversResponseFromJSONTyped, "ListResolversResponseFromJSONTyped");
|
|
1627
|
+
|
|
1628
|
+
// src/models/ResolvePublicKey.ts
|
|
1629
|
+
function ResolvePublicKeyToJSONTyped(value, ignoreDiscriminator = false) {
|
|
1630
|
+
if (value == null) {
|
|
1631
|
+
return value;
|
|
1632
|
+
}
|
|
1633
|
+
return {
|
|
1634
|
+
"keyInfo": KeyInfoToJSON(value["keyInfo"]),
|
|
1635
|
+
"identifierMethod": IdentifierMethodToJSON(value["identifierMethod"]),
|
|
1636
|
+
"trustedCerts": value["trustedCerts"],
|
|
1637
|
+
"verifyX509CertificateChain": value["verifyX509CertificateChain"]
|
|
1638
|
+
};
|
|
1639
|
+
}
|
|
1640
|
+
__name(ResolvePublicKeyToJSONTyped, "ResolvePublicKeyToJSONTyped");
|
|
1641
|
+
|
|
1642
|
+
// src/models/ResolvedKeyInfo.ts
|
|
1643
|
+
function ResolvedKeyInfoFromJSONTyped(json, ignoreDiscriminator) {
|
|
1644
|
+
if (json == null) {
|
|
1645
|
+
return json;
|
|
1646
|
+
}
|
|
1647
|
+
return {
|
|
1648
|
+
"kid": json["kid"] == null ? void 0 : json["kid"],
|
|
1649
|
+
"key": JwkFromJSON(json["key"]),
|
|
1650
|
+
"signatureAlgorithm": json["signatureAlgorithm"] == null ? void 0 : SignatureAlgorithmFromJSON(json["signatureAlgorithm"]),
|
|
1651
|
+
"keyVisibility": json["keyVisibility"] == null ? void 0 : KeyVisibilityFromJSON(json["keyVisibility"]),
|
|
1652
|
+
"x5c": json["x5c"] == null ? void 0 : json["x5c"],
|
|
1653
|
+
"alias": json["alias"] == null ? void 0 : json["alias"],
|
|
1654
|
+
"providerId": json["providerId"] == null ? void 0 : json["providerId"],
|
|
1655
|
+
"keyType": json["keyType"] == null ? void 0 : KeyTypeFromJSON(json["keyType"]),
|
|
1656
|
+
"keyEncoding": json["keyEncoding"] == null ? void 0 : KeyEncodingFromJSON(json["keyEncoding"]),
|
|
1657
|
+
"opts": json["opts"] == null ? void 0 : json["opts"]
|
|
1658
|
+
};
|
|
1659
|
+
}
|
|
1660
|
+
__name(ResolvedKeyInfoFromJSONTyped, "ResolvedKeyInfoFromJSONTyped");
|
|
1661
|
+
function ResolvedKeyInfoToJSON(json) {
|
|
1662
|
+
return ResolvedKeyInfoToJSONTyped(json, false);
|
|
1663
|
+
}
|
|
1664
|
+
__name(ResolvedKeyInfoToJSON, "ResolvedKeyInfoToJSON");
|
|
1665
|
+
function ResolvedKeyInfoToJSONTyped(value, ignoreDiscriminator = false) {
|
|
1666
|
+
if (value == null) {
|
|
1667
|
+
return value;
|
|
1668
|
+
}
|
|
1669
|
+
return {
|
|
1670
|
+
"kid": value["kid"],
|
|
1671
|
+
"key": JwkToJSON(value["key"]),
|
|
1672
|
+
"signatureAlgorithm": SignatureAlgorithmToJSON(value["signatureAlgorithm"]),
|
|
1673
|
+
"keyVisibility": KeyVisibilityToJSON(value["keyVisibility"]),
|
|
1674
|
+
"x5c": value["x5c"],
|
|
1675
|
+
"alias": value["alias"],
|
|
1676
|
+
"providerId": value["providerId"],
|
|
1677
|
+
"keyType": KeyTypeToJSON(value["keyType"]),
|
|
1678
|
+
"keyEncoding": KeyEncodingToJSON(value["keyEncoding"]),
|
|
1679
|
+
"opts": value["opts"]
|
|
1680
|
+
};
|
|
1681
|
+
}
|
|
1682
|
+
__name(ResolvedKeyInfoToJSONTyped, "ResolvedKeyInfoToJSONTyped");
|
|
1683
|
+
|
|
1684
|
+
// src/models/StoreKey.ts
|
|
1685
|
+
function StoreKeyToJSONTyped(value, ignoreDiscriminator = false) {
|
|
1686
|
+
if (value == null) {
|
|
1687
|
+
return value;
|
|
1688
|
+
}
|
|
1689
|
+
return {
|
|
1690
|
+
"keyInfo": ResolvedKeyInfoToJSON(value["keyInfo"]),
|
|
1691
|
+
"certChain": value["certChain"]
|
|
1692
|
+
};
|
|
1693
|
+
}
|
|
1694
|
+
__name(StoreKeyToJSONTyped, "StoreKeyToJSONTyped");
|
|
1695
|
+
|
|
1696
|
+
// src/models/VerifyRawSignature.ts
|
|
1697
|
+
function VerifyRawSignatureToJSONTyped(value, ignoreDiscriminator = false) {
|
|
1698
|
+
if (value == null) {
|
|
1699
|
+
return value;
|
|
1700
|
+
}
|
|
1701
|
+
return {
|
|
1702
|
+
"keyInfo": KeyInfoToJSON(value["keyInfo"]),
|
|
1703
|
+
"input": value["input"],
|
|
1704
|
+
"signature": value["signature"]
|
|
1705
|
+
};
|
|
1706
|
+
}
|
|
1707
|
+
__name(VerifyRawSignatureToJSONTyped, "VerifyRawSignatureToJSONTyped");
|
|
1708
|
+
|
|
1709
|
+
// src/models/VerifyRawSignatureResponse.ts
|
|
1710
|
+
function VerifyRawSignatureResponseFromJSONTyped(json, ignoreDiscriminator) {
|
|
1711
|
+
if (json == null) {
|
|
1712
|
+
return json;
|
|
1713
|
+
}
|
|
1714
|
+
return {
|
|
1715
|
+
"isValid": json["isValid"]
|
|
1716
|
+
};
|
|
1717
|
+
}
|
|
1718
|
+
__name(VerifyRawSignatureResponseFromJSONTyped, "VerifyRawSignatureResponseFromJSONTyped");
|
|
1719
|
+
|
|
1720
|
+
// src/agent/KmsRestClient.ts
|
|
1721
|
+
var logger = import_ssi_types.Loggers.DEFAULT.get("sphereon:ssi-sdk:kms:rest-client");
|
|
1722
|
+
var KmsRestClient = class _KmsRestClient {
|
|
1723
|
+
static {
|
|
1724
|
+
__name(this, "KmsRestClient");
|
|
1725
|
+
}
|
|
1726
|
+
methods = {
|
|
1727
|
+
kmsGetKey: this.kmsGetKey.bind(this),
|
|
1728
|
+
kmsListKeys: this.kmsListKeys.bind(this),
|
|
1729
|
+
kmsStoreKey: this.kmsStoreKey.bind(this),
|
|
1730
|
+
kmsGenerateKey: this.kmsGenerateKey.bind(this),
|
|
1731
|
+
kmsDeleteKey: this.kmsDeleteKey.bind(this),
|
|
1732
|
+
kmsGetKeyProvider: this.kmsGetKeyProvider.bind(this),
|
|
1733
|
+
kmsListKeyProviders: this.kmsListKeyProviders.bind(this),
|
|
1734
|
+
kmsProviderListKeys: this.kmsProviderListKeys.bind(this),
|
|
1735
|
+
kmsProviderStoreKey: this.kmsProviderStoreKey.bind(this),
|
|
1736
|
+
kmsProviderGenerateKey: this.kmsProviderGenerateKey.bind(this),
|
|
1737
|
+
kmsProviderGetKey: this.kmsProviderGetKey.bind(this),
|
|
1738
|
+
kmsProviderDeleteKey: this.kmsProviderDeleteKey.bind(this),
|
|
1739
|
+
kmsGetResolver: this.kmsGetResolver.bind(this),
|
|
1740
|
+
kmsListResolvers: this.kmsListResolvers.bind(this),
|
|
1741
|
+
kmsResolveKey: this.kmsResolveKey.bind(this),
|
|
1742
|
+
kmsCreateRawSignature: this.kmsCreateRawSignature.bind(this),
|
|
1743
|
+
kmsIsValidRawSignature: this.kmsIsValidRawSignature.bind(this)
|
|
1744
|
+
};
|
|
1745
|
+
agentBaseUrl;
|
|
1746
|
+
authOpts;
|
|
1747
|
+
constructor(args) {
|
|
1748
|
+
if (args?.baseUrl) {
|
|
1749
|
+
this.agentBaseUrl = args.baseUrl;
|
|
1750
|
+
}
|
|
1751
|
+
this.authOpts = args?.authentication;
|
|
1752
|
+
}
|
|
1753
|
+
static urlWithBase(path, baseUrl) {
|
|
1754
|
+
return `${baseUrl}${path.startsWith("/") ? path : `/${path}`}`;
|
|
1755
|
+
}
|
|
1756
|
+
/** {@inheritDoc IKmsRestClient.kmsGetResolver} */
|
|
1757
|
+
async kmsGetResolver(args) {
|
|
1758
|
+
const baseUrl = this.assertedAgentBaseUrl(args.baseUrl);
|
|
1759
|
+
const url = _KmsRestClient.urlWithBase(`/resolvers/${args.resolverId}`, baseUrl);
|
|
1760
|
+
const response = await (0, import_cross_fetch.fetch)(url, {
|
|
1761
|
+
method: "GET"
|
|
1762
|
+
});
|
|
1763
|
+
logger.debug(`get resolver response: ${response}`);
|
|
1764
|
+
try {
|
|
1765
|
+
return ResolverFromJSONTyped(await response.json(), false);
|
|
1766
|
+
} catch (error) {
|
|
1767
|
+
return Promise.reject(Error(`request to ${url} returned ${error}`));
|
|
1768
|
+
}
|
|
1769
|
+
}
|
|
1770
|
+
/** {@inheritDoc IKmsRestClient.kmsListResolvers} */
|
|
1771
|
+
async kmsListResolvers(args) {
|
|
1772
|
+
const baseUrl = this.assertedAgentBaseUrl(args.baseUrl);
|
|
1773
|
+
const url = _KmsRestClient.urlWithBase("/resolvers", baseUrl);
|
|
1774
|
+
const response = await (0, import_cross_fetch.fetch)(url, {
|
|
1775
|
+
method: "GET"
|
|
1776
|
+
});
|
|
1777
|
+
logger.debug(`list resolvers response: ${response}`);
|
|
1778
|
+
try {
|
|
1779
|
+
return ListResolversResponseFromJSONTyped(await response.json(), false);
|
|
1780
|
+
} catch (error) {
|
|
1781
|
+
return Promise.reject(Error(`request to ${url} returned ${error}`));
|
|
1782
|
+
}
|
|
1783
|
+
}
|
|
1784
|
+
/** {@inheritDoc IKmsRestClient.kmsResolveKey} */
|
|
1785
|
+
async kmsResolveKey(args) {
|
|
1786
|
+
const baseUrl = this.assertedAgentBaseUrl(args.baseUrl);
|
|
1787
|
+
const url = _KmsRestClient.urlWithBase(`/resolvers/${args.resolverId}/resolve`, baseUrl);
|
|
1788
|
+
const body = {
|
|
1789
|
+
keyInfo: args.keyInfo,
|
|
1790
|
+
identifierMethod: args.identifierMethod,
|
|
1791
|
+
trustedCerts: args.trustedCerts,
|
|
1792
|
+
verifyX509CertificateChain: args.verifyX509CertificateChain
|
|
1793
|
+
};
|
|
1794
|
+
const response = await (0, import_cross_fetch.fetch)(url, {
|
|
1795
|
+
method: "POST",
|
|
1796
|
+
headers: await this.createHeaders({
|
|
1797
|
+
"Content-Type": "application/json"
|
|
1798
|
+
}),
|
|
1799
|
+
body: JSON.stringify(ResolvePublicKeyToJSONTyped(body))
|
|
1800
|
+
});
|
|
1801
|
+
logger.debug(`resolve key response: ${response}`);
|
|
1802
|
+
try {
|
|
1803
|
+
return ResolvedKeyInfoFromJSONTyped(await response.json(), false);
|
|
1804
|
+
} catch (error) {
|
|
1805
|
+
return Promise.reject(Error(`request to ${url} returned ${error}`));
|
|
1806
|
+
}
|
|
1807
|
+
}
|
|
1808
|
+
/** {@inheritDoc IKmsRestClient.kmsCreateRawSignature} */
|
|
1809
|
+
async kmsCreateRawSignature(args) {
|
|
1810
|
+
const baseUrl = this.assertedAgentBaseUrl(args.baseUrl);
|
|
1811
|
+
const url = _KmsRestClient.urlWithBase(`/signatures/raw`, baseUrl);
|
|
1812
|
+
const body = {
|
|
1813
|
+
keyInfo: args.keyInfo,
|
|
1814
|
+
input: args.input
|
|
1815
|
+
};
|
|
1816
|
+
const response = await (0, import_cross_fetch.fetch)(url, {
|
|
1817
|
+
method: "POST",
|
|
1818
|
+
headers: await this.createHeaders({
|
|
1819
|
+
"Content-Type": "application/json"
|
|
1820
|
+
}),
|
|
1821
|
+
body: JSON.stringify(CreateRawSignatureToJSONTyped(body))
|
|
1822
|
+
});
|
|
1823
|
+
logger.debug(`create raw signature response: ${response}`);
|
|
1824
|
+
try {
|
|
1825
|
+
return CreateRawSignatureResponseFromJSONTyped(await response.json(), false);
|
|
1826
|
+
} catch (error) {
|
|
1827
|
+
return Promise.reject(Error(`request to ${url} returned ${error}`));
|
|
1828
|
+
}
|
|
1829
|
+
}
|
|
1830
|
+
/** {@inheritDoc IKmsRestClient.kmsIsValidRawSignature} */
|
|
1831
|
+
async kmsIsValidRawSignature(args) {
|
|
1832
|
+
const baseUrl = this.assertedAgentBaseUrl(args.baseUrl);
|
|
1833
|
+
const url = _KmsRestClient.urlWithBase(`/signatures/raw/verify`, baseUrl);
|
|
1834
|
+
const body = {
|
|
1835
|
+
keyInfo: args.keyInfo,
|
|
1836
|
+
signature: args.signature,
|
|
1837
|
+
input: args.input
|
|
1838
|
+
};
|
|
1839
|
+
const response = await (0, import_cross_fetch.fetch)(url, {
|
|
1840
|
+
method: "POST",
|
|
1841
|
+
headers: await this.createHeaders({
|
|
1842
|
+
"Content-Type": "application/json"
|
|
1843
|
+
}),
|
|
1844
|
+
body: JSON.stringify(VerifyRawSignatureToJSONTyped(body))
|
|
1845
|
+
});
|
|
1846
|
+
logger.debug(`verify raw signature response: ${response}`);
|
|
1847
|
+
try {
|
|
1848
|
+
return VerifyRawSignatureResponseFromJSONTyped(await response.json(), false);
|
|
1849
|
+
} catch (error) {
|
|
1850
|
+
return Promise.reject(Error(`request to ${url} returned ${error}`));
|
|
1851
|
+
}
|
|
1852
|
+
}
|
|
1853
|
+
/** {@inheritDoc IKmsRestClient.kmsGetKey} */
|
|
1854
|
+
async kmsGetKey(args) {
|
|
1855
|
+
const baseUrl = this.assertedAgentBaseUrl(args.baseUrl);
|
|
1856
|
+
const url = _KmsRestClient.urlWithBase(`/keys/${args.aliasOrKid}`, baseUrl);
|
|
1857
|
+
const response = await (0, import_cross_fetch.fetch)(url, {
|
|
1858
|
+
method: "GET"
|
|
1859
|
+
});
|
|
1860
|
+
logger.debug(`get key response: ${response}`);
|
|
1861
|
+
try {
|
|
1862
|
+
return ManagedKeyInfoFromJSONTyped(await response.json(), false);
|
|
1863
|
+
} catch (error) {
|
|
1864
|
+
return Promise.reject(Error(`request to ${url} returned ${error}`));
|
|
1865
|
+
}
|
|
1866
|
+
}
|
|
1867
|
+
/** {@inheritDoc IKmsRestClient.kmsListKeys} */
|
|
1868
|
+
async kmsListKeys(args) {
|
|
1869
|
+
const baseUrl = this.assertedAgentBaseUrl(args.baseUrl);
|
|
1870
|
+
const url = this.addSearchParams(_KmsRestClient.urlWithBase("/keys", baseUrl), {
|
|
1871
|
+
...args.providerId && {
|
|
1872
|
+
providerId: args.providerId
|
|
1873
|
+
}
|
|
1874
|
+
});
|
|
1875
|
+
const response = await (0, import_cross_fetch.fetch)(url, {
|
|
1876
|
+
method: "GET"
|
|
1877
|
+
});
|
|
1878
|
+
logger.debug(`list keys response: ${response}`);
|
|
1879
|
+
try {
|
|
1880
|
+
const xx = await response.json();
|
|
1881
|
+
return ListKeysResponseFromJSONTyped(xx, false);
|
|
1882
|
+
} catch (error) {
|
|
1883
|
+
return Promise.reject(Error(`request to ${url} returned ${error}`));
|
|
1884
|
+
}
|
|
1885
|
+
}
|
|
1886
|
+
/** {@inheritDoc IKmsRestClient.kmsStoreKey} */
|
|
1887
|
+
async kmsStoreKey(args) {
|
|
1888
|
+
const baseUrl = this.assertedAgentBaseUrl(args.baseUrl);
|
|
1889
|
+
const url = _KmsRestClient.urlWithBase(`/keys`, baseUrl);
|
|
1890
|
+
const body = {
|
|
1891
|
+
keyInfo: args.keyInfo,
|
|
1892
|
+
certChain: args.certChain
|
|
1893
|
+
};
|
|
1894
|
+
const response = await (0, import_cross_fetch.fetch)(url, {
|
|
1895
|
+
method: "POST",
|
|
1896
|
+
headers: await this.createHeaders({
|
|
1897
|
+
"Content-Type": "application/json"
|
|
1898
|
+
}),
|
|
1899
|
+
body: JSON.stringify(StoreKeyToJSONTyped(body))
|
|
1900
|
+
});
|
|
1901
|
+
logger.debug(`store key response: ${response}`);
|
|
1902
|
+
try {
|
|
1903
|
+
return ManagedKeyInfoFromJSONTyped(await response.json(), false);
|
|
1904
|
+
} catch (error) {
|
|
1905
|
+
return Promise.reject(Error(`request to ${url} returned ${error}`));
|
|
1906
|
+
}
|
|
1907
|
+
}
|
|
1908
|
+
/** {@inheritDoc IKmsRestClient.kmsGenerateKey} */
|
|
1909
|
+
async kmsGenerateKey(args) {
|
|
1910
|
+
const baseUrl = this.assertedAgentBaseUrl(args.baseUrl);
|
|
1911
|
+
const url = _KmsRestClient.urlWithBase(`/keys/generate`, baseUrl);
|
|
1912
|
+
const body = {
|
|
1913
|
+
alg: args.alg,
|
|
1914
|
+
keyOperations: args.keyOperations,
|
|
1915
|
+
providerId: args.providerId,
|
|
1916
|
+
use: args.use
|
|
1917
|
+
};
|
|
1918
|
+
const response = await (0, import_cross_fetch.fetch)(url, {
|
|
1919
|
+
method: "POST",
|
|
1920
|
+
headers: await this.createHeaders({
|
|
1921
|
+
"Content-Type": "application/json"
|
|
1922
|
+
}),
|
|
1923
|
+
body: JSON.stringify(GenerateKeyGlobalToJSONTyped(body))
|
|
1924
|
+
});
|
|
1925
|
+
logger.debug(`generate key response: ${response}`);
|
|
1926
|
+
try {
|
|
1927
|
+
return ManagedKeyPairFromJSONTyped(await response.json(), false);
|
|
1928
|
+
} catch (error) {
|
|
1929
|
+
return Promise.reject(Error(`request to ${url} returned ${error}`));
|
|
1930
|
+
}
|
|
1931
|
+
}
|
|
1932
|
+
/** {@inheritDoc IKmsRestClient.kmsDeleteKey} */
|
|
1933
|
+
async kmsDeleteKey(args) {
|
|
1934
|
+
const baseUrl = this.assertedAgentBaseUrl(args.baseUrl);
|
|
1935
|
+
const url = _KmsRestClient.urlWithBase(`/keys/${args.aliasOrKid}`, baseUrl);
|
|
1936
|
+
await (0, import_cross_fetch.fetch)(url, {
|
|
1937
|
+
method: "DELETE"
|
|
1938
|
+
});
|
|
1939
|
+
return true;
|
|
1940
|
+
}
|
|
1941
|
+
/** {@inheritDoc IKmsRestClient.kmsGetKeyProvider} */
|
|
1942
|
+
async kmsGetKeyProvider(args) {
|
|
1943
|
+
const baseUrl = this.assertedAgentBaseUrl(args.baseUrl);
|
|
1944
|
+
const url = _KmsRestClient.urlWithBase(`/providers/${args.providerId}`, baseUrl);
|
|
1945
|
+
const response = await (0, import_cross_fetch.fetch)(url, {
|
|
1946
|
+
method: "GET"
|
|
1947
|
+
});
|
|
1948
|
+
logger.debug(`get provider response: ${response}`);
|
|
1949
|
+
try {
|
|
1950
|
+
return KeyProviderResponseFromJSONTyped(await response.json(), false);
|
|
1951
|
+
} catch (error) {
|
|
1952
|
+
return Promise.reject(Error(`request to ${url} returned ${error}`));
|
|
1953
|
+
}
|
|
1954
|
+
}
|
|
1955
|
+
/** {@inheritDoc IKmsRestClient.kmsListKeyProviders} */
|
|
1956
|
+
async kmsListKeyProviders(args) {
|
|
1957
|
+
const baseUrl = this.assertedAgentBaseUrl(args.baseUrl);
|
|
1958
|
+
const url = _KmsRestClient.urlWithBase("/providers", baseUrl);
|
|
1959
|
+
const response = await (0, import_cross_fetch.fetch)(url, {
|
|
1960
|
+
method: "GET"
|
|
1961
|
+
});
|
|
1962
|
+
logger.debug(`list providers response: ${response}`);
|
|
1963
|
+
try {
|
|
1964
|
+
return ListKeyProvidersResponseFromJSONTyped(await response.json(), false);
|
|
1965
|
+
} catch (error) {
|
|
1966
|
+
return Promise.reject(Error(`request to ${url} returned ${error}`));
|
|
1967
|
+
}
|
|
1968
|
+
}
|
|
1969
|
+
/** {@inheritDoc IKmsRestClient.kmsProviderListKeys} */
|
|
1970
|
+
async kmsProviderListKeys(args) {
|
|
1971
|
+
const baseUrl = this.assertedAgentBaseUrl(args.baseUrl);
|
|
1972
|
+
const url = _KmsRestClient.urlWithBase(`/providers/${args.providerId}/keys`, baseUrl);
|
|
1973
|
+
const response = await (0, import_cross_fetch.fetch)(url, {
|
|
1974
|
+
method: "GET"
|
|
1975
|
+
});
|
|
1976
|
+
logger.debug(`list provider keys response: ${response}`);
|
|
1977
|
+
try {
|
|
1978
|
+
return ListKeysResponseFromJSONTyped(await response.json(), false);
|
|
1979
|
+
} catch (error) {
|
|
1980
|
+
return Promise.reject(Error(`request to ${url} returned ${error}`));
|
|
1981
|
+
}
|
|
1982
|
+
}
|
|
1983
|
+
/** {@inheritDoc IKmsRestClient.kmsProviderStoreKey} */
|
|
1984
|
+
async kmsProviderStoreKey(args) {
|
|
1985
|
+
const baseUrl = this.assertedAgentBaseUrl(args.baseUrl);
|
|
1986
|
+
const url = _KmsRestClient.urlWithBase(`/providers/${args.providerId}/keys`, baseUrl);
|
|
1987
|
+
const body = {
|
|
1988
|
+
keyInfo: args.keyInfo,
|
|
1989
|
+
certChain: args.certChain
|
|
1990
|
+
};
|
|
1991
|
+
const response = await (0, import_cross_fetch.fetch)(url, {
|
|
1992
|
+
method: "POST",
|
|
1993
|
+
headers: await this.createHeaders({
|
|
1994
|
+
"Content-Type": "application/json"
|
|
1995
|
+
}),
|
|
1996
|
+
body: JSON.stringify(StoreKeyToJSONTyped(body))
|
|
1997
|
+
});
|
|
1998
|
+
logger.debug(`provider store key response: ${response}`);
|
|
1999
|
+
try {
|
|
2000
|
+
return ManagedKeyInfoFromJSONTyped(await response.json(), false);
|
|
2001
|
+
} catch (error) {
|
|
2002
|
+
return Promise.reject(Error(`request to ${url} returned ${error}`));
|
|
2003
|
+
}
|
|
2004
|
+
}
|
|
2005
|
+
/** {@inheritDoc IKmsRestClient.kmsProviderGenerateKey} */
|
|
2006
|
+
async kmsProviderGenerateKey(args) {
|
|
2007
|
+
const baseUrl = this.assertedAgentBaseUrl(args.baseUrl);
|
|
2008
|
+
const url = _KmsRestClient.urlWithBase(`/providers/${args.providerId}/keys/generate`, baseUrl);
|
|
2009
|
+
const body = {
|
|
2010
|
+
alg: args.alg,
|
|
2011
|
+
keyOperations: args.keyOperations,
|
|
2012
|
+
use: args.use
|
|
2013
|
+
};
|
|
2014
|
+
const response = await (0, import_cross_fetch.fetch)(url, {
|
|
2015
|
+
method: "POST",
|
|
2016
|
+
headers: await this.createHeaders({
|
|
2017
|
+
"Content-Type": "application/json"
|
|
2018
|
+
}),
|
|
2019
|
+
body: JSON.stringify(GenerateKeyToJSONTyped(body))
|
|
2020
|
+
});
|
|
2021
|
+
logger.debug(`provider generate key response: ${response}`);
|
|
2022
|
+
try {
|
|
2023
|
+
return ManagedKeyPairFromJSONTyped(await response.json(), false);
|
|
2024
|
+
} catch (error) {
|
|
2025
|
+
return Promise.reject(Error(`request to ${url} returned ${error}`));
|
|
2026
|
+
}
|
|
2027
|
+
}
|
|
2028
|
+
/** {@inheritDoc IKmsRestClient.kmsProviderGetKey} */
|
|
2029
|
+
async kmsProviderGetKey(args) {
|
|
2030
|
+
const baseUrl = this.assertedAgentBaseUrl(args.baseUrl);
|
|
2031
|
+
const url = _KmsRestClient.urlWithBase(`/providers/${args.providerId}/keys/${args.aliasOrKid}`, baseUrl);
|
|
2032
|
+
const response = await (0, import_cross_fetch.fetch)(url, {
|
|
2033
|
+
method: "GET"
|
|
2034
|
+
});
|
|
2035
|
+
logger.debug(`get provider key response: ${response}`);
|
|
2036
|
+
try {
|
|
2037
|
+
return ManagedKeyInfoFromJSONTyped(await response.json(), false);
|
|
2038
|
+
} catch (error) {
|
|
2039
|
+
return Promise.reject(Error(`request to ${url} returned ${error}`));
|
|
2040
|
+
}
|
|
2041
|
+
}
|
|
2042
|
+
/** {@inheritDoc IKmsRestClient.kmsProviderDeleteKey} */
|
|
2043
|
+
async kmsProviderDeleteKey(args) {
|
|
2044
|
+
const baseUrl = this.assertedAgentBaseUrl(args.baseUrl);
|
|
2045
|
+
const url = _KmsRestClient.urlWithBase(`providers/${args.providerId}/keys/${args.aliasOrKid}`, baseUrl);
|
|
2046
|
+
await (0, import_cross_fetch.fetch)(url, {
|
|
2047
|
+
method: "DELETE"
|
|
2048
|
+
});
|
|
2049
|
+
return true;
|
|
2050
|
+
}
|
|
2051
|
+
assertedAgentBaseUrl(baseUrl) {
|
|
2052
|
+
if (baseUrl) {
|
|
2053
|
+
return baseUrl;
|
|
2054
|
+
} else if (this.agentBaseUrl) {
|
|
2055
|
+
return this.agentBaseUrl;
|
|
2056
|
+
}
|
|
2057
|
+
throw new Error("No base url has been provided");
|
|
2058
|
+
}
|
|
2059
|
+
async createHeaders(existing) {
|
|
2060
|
+
const headers = {
|
|
2061
|
+
...existing,
|
|
2062
|
+
Accept: "application/json"
|
|
2063
|
+
};
|
|
2064
|
+
if (this.authOpts?.enabled === true) {
|
|
2065
|
+
if (!this.authOpts.bearerToken) {
|
|
2066
|
+
throw Error(`Cannot have authentication enabled, whilst not enabling static bearer tokens at this point`);
|
|
2067
|
+
}
|
|
2068
|
+
headers.Authorization = `Bearer ${typeof this.authOpts.bearerToken === "string" ? this.authOpts.bearerToken : await this.authOpts.bearerToken()}`;
|
|
2069
|
+
}
|
|
2070
|
+
return headers;
|
|
2071
|
+
}
|
|
2072
|
+
addSearchParams(baseUrl, params) {
|
|
2073
|
+
const url = new URL(baseUrl);
|
|
2074
|
+
for (const [key, value] of Object.entries(params)) {
|
|
2075
|
+
url.searchParams.set(key, String(value));
|
|
2076
|
+
}
|
|
2077
|
+
return url;
|
|
2078
|
+
}
|
|
2079
|
+
};
|
|
2080
|
+
|
|
2081
|
+
// src/index.ts
|
|
2082
|
+
var schema = require_plugin_schema();
|
|
2083
|
+
//# sourceMappingURL=index.cjs.map
|