@sphereon/idk-lib-data-link-http-client-impl 0.25.0-SNAPSHOT-build-8529934

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,2009 @@
1
+ import {
2
+ IllegalStateExceptionkoljg5n0nrlr as IllegalStateException,
3
+ toString1pkumu07cwy4m as toString,
4
+ Unit_instancev9v8hjid95df as Unit_instance,
5
+ VOID3gxj6tk5isa35 as VOID,
6
+ initMetadataForObject1cxne3s9w65el as initMetadataForObject,
7
+ initMetadataForCompanion1wyw17z38v6ac as initMetadataForCompanion,
8
+ initMetadataForClassbxx6q50dy2s7 as initMetadataForClass,
9
+ IllegalArgumentException2asla15b5jaob as IllegalArgumentException,
10
+ initMetadataForInterface1egvbzx539z91 as initMetadataForInterface,
11
+ protoOf180f3jzyo7rfj as protoOf,
12
+ THROW_CCE2g6jy02ryeudk as THROW_CCE,
13
+ isInterface3d6p8outrmvmk as isInterface,
14
+ promisify1z0ncraq1ipzh as promisify,
15
+ await2s6xyuld384ut as await_0,
16
+ defineProp3ur6h3slcvq4x as defineProp,
17
+ equals2au1ep9vhcato as equals,
18
+ FunctionAdapter3lcrrz3moet5b as FunctionAdapter,
19
+ Comparator2b3maoeh98xtg as Comparator,
20
+ hashCodeq5arwsb9dgti as hashCode,
21
+ compareValues1n2ayl87ihzfk as compareValues,
22
+ sortedWith2csnbbb21k0lg as sortedWith,
23
+ collectionSizeOrDefault36dulx8yinfqm as collectionSizeOrDefault,
24
+ mapCapacity1h45rc3eh9p2l as mapCapacity,
25
+ coerceAtLeast2bkz8m9ik7hep as coerceAtLeast,
26
+ LinkedHashMap1zhqxkxv3xnkl as LinkedHashMap,
27
+ toMutableMapr5f3w62lv8sk as toMutableMap,
28
+ first28gmhyvs4kf06 as first,
29
+ copyToArray2j022khrow2yi as copyToArray,
30
+ joinToStringxqcavsxcmh4q as joinToString,
31
+ contains1tccixv8iwdcq as contains,
32
+ toString30pk9tzaqopn as toString_0,
33
+ KProperty1ca4yb4wlo496 as KProperty1,
34
+ getPropertyCallableRef3hckxc0xueiaj as getPropertyCallableRef,
35
+ lazy2hsh8ze7j6ikd as lazy,
36
+ ArrayList3it5z8td81qkl as ArrayList,
37
+ } from '../kotlin-kotlin-stdlib.mjs';
38
+ import {
39
+ CoseJoseKeyMappingService_instance1u2hjnjtsd7r1 as CoseJoseKeyMappingService_instance,
40
+ JwaKeyType_EC_getInstancesy663o3quhf3 as JwaKeyType_EC_getInstance,
41
+ Companion_getInstance2j5z70v28sfbd as Companion_getInstance,
42
+ P_256_getInstance2c3yye4qdxi9a as P_256_getInstance,
43
+ EcdhUtils_instancem1f6p6z4er02 as EcdhUtils_instance,
44
+ getProviderById3cbs00g78z86z as getProviderById,
45
+ getProvider15nv6e6uoyvqk as getProvider,
46
+ registerProvidergldbgky7fryv as registerProvider,
47
+ getResolverById3o3u01y9o8j73 as getResolverById,
48
+ getResolverByKeyTypeOrIdentifieruxmy70pl5k7u as getResolverByKeyTypeOrIdentifier,
49
+ registerResolver26by0isjei20a as registerResolver,
50
+ QueryProviderArgs1qpobauc9f2xe as QueryProviderArgs,
51
+ QueryProvidersArgs2o8p6qm1z6ajs as QueryProvidersArgs,
52
+ GetAllCapabilitiesArgsvl5sannhkhj8 as GetAllCapabilitiesArgs,
53
+ getAllCapabilities$default2my8ewhe78lnc as getAllCapabilities$default,
54
+ ResolvePublicKeyArgs18wcr8ckibo4x as ResolvePublicKeyArgs,
55
+ PKIException2q8eyrx46yxje as PKIException,
56
+ ResolvedKeyInfoTypee7maap38fdff as ResolvedKeyInfoType,
57
+ resolvePublicKey$default1s9xtr3v06wzo as resolvePublicKey$default,
58
+ GenerateKeyArgs3exal8cx1h1iv as GenerateKeyArgs,
59
+ generateKeyAsync$virtualSuspendBridgea5kvtvcvqjgo as generateKeyAsync$virtualSuspendBridge,
60
+ generateKey$default1qhxgz7gl19w4 as generateKey$default,
61
+ generateKeyAsync$default2tvn0ng0q0x5u as generateKeyAsync$default,
62
+ CreateRawSignatureArgsj4ekfuix1k42 as CreateRawSignatureArgs,
63
+ IdentifierMethod_x5c_getInstance37h0jruk9ae35 as IdentifierMethod_x5c_getInstance,
64
+ VerifyRawSignatureArgs18ql14s7cjsl7 as VerifyRawSignatureArgs,
65
+ EncryptArgs3nscqgzjci3t0 as EncryptArgs,
66
+ EncryptionResult2kafqhrbwv0ks as EncryptionResult,
67
+ encrypt$virtualSuspendBridge2fzt5s4nxtydk as encrypt$virtualSuspendBridge,
68
+ encrypt$default5d1j5wmpk5ac as encrypt$default,
69
+ DecryptArgs2okdcyh5j1xm3 as DecryptArgs,
70
+ decrypt$virtualSuspendBridge26lx0sxvy72pq as decrypt$virtualSuspendBridge,
71
+ decrypt$default2tg5snelob84g as decrypt$default,
72
+ WrapKeyArgs1o2nu2n8hiij6 as WrapKeyArgs,
73
+ wrapKey$virtualSuspendBridgehuom2lnmrxig as wrapKey$virtualSuspendBridge,
74
+ UnwrapKeyArgs1l29bkkp4d04y as UnwrapKeyArgs,
75
+ unwrapKey$virtualSuspendBridge10diszgquw2jd as unwrapKey$virtualSuspendBridge,
76
+ PerformKeyAgreementArgs2cy1svd0b0maa as PerformKeyAgreementArgs,
77
+ performKeyAgreement$default3kjax4b11qhz1 as performKeyAgreement$default,
78
+ StoreKeyArgs2x4xpugiswbue as StoreKeyArgs,
79
+ storeKey$virtualSuspendBridge2ur76bvwv5849 as storeKey$virtualSuspendBridge,
80
+ storeKey$default3hyedu7uwb2q as storeKey$default,
81
+ ListKeysArgsx5y8zk7xx666 as ListKeysArgs,
82
+ listKeys$virtualSuspendBridgeogq2mk63x0vn as listKeys$virtualSuspendBridge,
83
+ listKeys$virtualSuspendBridge3om318qdf1ayn as listKeys$virtualSuspendBridge_0,
84
+ GetKeyArgs3d3w36dy5oz41 as GetKeyArgs,
85
+ getKey$virtualSuspendBridge38ippv9eib6zv as getKey$virtualSuspendBridge,
86
+ DeleteKeyArgskxnuaox68awq as DeleteKeyArgs,
87
+ deleteKey$virtualSuspendBridge2clie97ix3t7p as deleteKey$virtualSuspendBridge,
88
+ createRawSignatureResult$defaultd77zhembl951 as createRawSignatureResult$default,
89
+ encryptResult$default1hbyrnrb2tnze as encryptResult$default,
90
+ decryptResult$default2xvx5e6kgoqpi as decryptResult$default,
91
+ performKeyAgreementResult$default1zk3om63b7aeh as performKeyAgreementResult$default,
92
+ generateKeyResult$default3jhigo88uholy as generateKeyResult$default,
93
+ listKeysResult$default3rniwb27pmy11 as listKeysResult$default,
94
+ storeKeyResult$default3cq4wzefnn46l as storeKeyResult$default,
95
+ resolvePublicKeyResult$default1xzdkdrhpdxr1 as resolvePublicKeyResult$default,
96
+ exposesPrivateKeysForSigning2dtrk591mvf2q as exposesPrivateKeysForSigning,
97
+ KeyManagerService1jy2oalnbllzs as KeyManagerService,
98
+ KeyResolverRegistry6pjvs5ngvu1l as KeyResolverRegistry,
99
+ KmsProviderRegistry37cfrhx8iscz8 as KmsProviderRegistry,
100
+ Companion_instanceg7awlm0z4331 as Companion_instance,
101
+ Companion_instance32pwcnmcyatxm as Companion_instance_0,
102
+ PredefinedKeyStoreTypes_MEMORY_getInstance23f58aplzn8ww as PredefinedKeyStoreTypes_MEMORY_getInstance,
103
+ Companion_getInstance12wp5sqa9plkt as Companion_getInstance_0,
104
+ toKeyReference1hbuu4zgrnbfp as toKeyReference,
105
+ KeyVisibility_PUBLIC_getInstancexko9xei8c785 as KeyVisibility_PUBLIC_getInstance,
106
+ KeyVisibility_PRIVATE_getInstance3vqkhhiu4wt1g as KeyVisibility_PRIVATE_getInstance,
107
+ ManagedKeyInfo2yqhf0w110ugh as ManagedKeyInfo,
108
+ storeCertificateChain$default11apxigx30bm7 as storeCertificateChain$default,
109
+ get_order2qb9qo6aibruu as get_order,
110
+ get_enabled1p6jc410a0fyv as get_enabled,
111
+ listKeys19wgim0aszum0 as listKeys,
112
+ listKeysFiltered2tyqsqt30ik0b as listKeysFiltered,
113
+ KeyStore3o40bf3gbe8w9 as KeyStore,
114
+ X509VerifyPlatformCallback3rbl32vhepoz7 as X509VerifyPlatformCallback,
115
+ X509VerifyService1ji3rocew3bty as X509VerifyService,
116
+ HasPlatformCallback1ytgk8bbzqatz as HasPlatformCallback,
117
+ } from './idk-lib-crypto-core-public.mjs';
118
+ import {
119
+ Companion_instance27w1uk4n2zibh as Companion_instance_1,
120
+ asErrorResult2t61x2oy4870d as asErrorResult,
121
+ NotFoundException1nc2pz9vpeyq7 as NotFoundException,
122
+ } from './idk-lib-core-api-public.mjs';
123
+ import {
124
+ _Result___get_error__impl__ihqhun2yewd2st3zd9i as _Result___get_error__impl__ihqhun,
125
+ _Result___get_value__impl__bjfvqg3pdjhj1ntjbaj as _Result___get_value__impl__bjfvqg,
126
+ _Result___get_isOk__impl__qbhaup1tqxnca0qn7sa as _Result___get_isOk__impl__qbhaup,
127
+ } from '../kotlin-result-kotlin-result.mjs';
128
+ import { Companion_getInstance1cart96rrvhbk as Companion_getInstance_1 } from '../metro-runtime-js.mjs';
129
+ import { awaitd1m8y0em728c as await_1 } from '../kotlinx-coroutines-core.mjs';
130
+ //region block: imports
131
+ //endregion
132
+ //region block: pre-declaration
133
+ class DefaultCallbacks {
134
+ constructor() {
135
+ this.e5l_1 = null;
136
+ this.f5l_1 = null;
137
+ }
138
+ x509() {
139
+ var callback = this.e5l_1;
140
+ $l$block: {
141
+ // Inline function 'kotlin.checkNotNull' call
142
+ if (callback == null) {
143
+ var message = 'No default X509 Platform Callback implementation was registered';
144
+ throw IllegalStateException.o(toString(message));
145
+ } else {
146
+ break $l$block;
147
+ }
148
+ }
149
+ return callback;
150
+ }
151
+ g5l(x509Callback) {
152
+ this.e5l_1 = x509Callback;
153
+ }
154
+ setX509Default(x509Callback, $super) {
155
+ x509Callback = x509Callback === VOID ? null : x509Callback;
156
+ var tmp;
157
+ if ($super === VOID) {
158
+ this.g5l(x509Callback);
159
+ tmp = Unit_instance;
160
+ } else {
161
+ tmp = $super.g5l.call(this, x509Callback);
162
+ }
163
+ return tmp;
164
+ }
165
+ hasX509Default() {
166
+ return !(this.e5l_1 == null);
167
+ }
168
+ coseCrypto() {
169
+ var callback = this.f5l_1;
170
+ $l$block: {
171
+ // Inline function 'kotlin.checkNotNull' call
172
+ if (callback == null) {
173
+ var message = 'No default Cose Crypto Platform Callback implementation was registered';
174
+ throw IllegalStateException.o(toString(message));
175
+ } else {
176
+ break $l$block;
177
+ }
178
+ }
179
+ return callback;
180
+ }
181
+ hasCoseCryptoDefault() {
182
+ return !(this.f5l_1 == null);
183
+ }
184
+ h5l(coseCryptoCallback) {
185
+ this.f5l_1 = coseCryptoCallback;
186
+ }
187
+ setCoseCryptoDefault(coseCryptoCallback, $super) {
188
+ coseCryptoCallback = coseCryptoCallback === VOID ? null : coseCryptoCallback;
189
+ var tmp;
190
+ if ($super === VOID) {
191
+ this.h5l(coseCryptoCallback);
192
+ tmp = Unit_instance;
193
+ } else {
194
+ tmp = $super.h5l.call(this, coseCryptoCallback);
195
+ }
196
+ return tmp;
197
+ }
198
+ }
199
+ class Companion {
200
+ create(providerRegistry, resolverRegistry, keyStoreService, execution, queryProviderCommand, queryProvidersCommand, getAllCapabilitiesCommand, createRawSignatureCommand, verifyRawSignatureCommand, encryptCommand, decryptCommand, wrapKeyCommand, unwrapKeyCommand, performKeyAgreementCommand, generateKeyCommand, listKeysCommand, getKeyCommand, storeKeyCommand, deleteKeyCommand, resolvePublicKeyCommand) {
201
+ return new MetroFactory(providerRegistry, resolverRegistry, keyStoreService, execution, queryProviderCommand, queryProvidersCommand, getAllCapabilitiesCommand, createRawSignatureCommand, verifyRawSignatureCommand, encryptCommand, decryptCommand, wrapKeyCommand, unwrapKeyCommand, performKeyAgreementCommand, generateKeyCommand, listKeysCommand, getKeyCommand, storeKeyCommand, deleteKeyCommand, resolvePublicKeyCommand);
202
+ }
203
+ newInstance(providerRegistry, resolverRegistry, keyStoreService, execution, queryProviderCommand, queryProvidersCommand, getAllCapabilitiesCommand, createRawSignatureCommand, verifyRawSignatureCommand, encryptCommand, decryptCommand, wrapKeyCommand, unwrapKeyCommand, performKeyAgreementCommand, generateKeyCommand, listKeysCommand, getKeyCommand, storeKeyCommand, deleteKeyCommand, resolvePublicKeyCommand) {
204
+ return new KeyManagerServiceImpl(providerRegistry, resolverRegistry, keyStoreService, execution, queryProviderCommand, queryProvidersCommand, getAllCapabilitiesCommand, createRawSignatureCommand, verifyRawSignatureCommand, encryptCommand, decryptCommand, wrapKeyCommand, unwrapKeyCommand, performKeyAgreementCommand, generateKeyCommand, listKeysCommand, getKeyCommand, storeKeyCommand, deleteKeyCommand, resolvePublicKeyCommand);
205
+ }
206
+ }
207
+ class BindsMirror {}
208
+ class MetroFactory {
209
+ constructor(providerRegistry, resolverRegistry, keyStoreService, execution, queryProviderCommand, queryProvidersCommand, getAllCapabilitiesCommand, createRawSignatureCommand, verifyRawSignatureCommand, encryptCommand, decryptCommand, wrapKeyCommand, unwrapKeyCommand, performKeyAgreementCommand, generateKeyCommand, listKeysCommand, getKeyCommand, storeKeyCommand, deleteKeyCommand, resolvePublicKeyCommand) {
210
+ this.i5l_1 = providerRegistry;
211
+ this.j5l_1 = resolverRegistry;
212
+ this.k5l_1 = keyStoreService;
213
+ this.l5l_1 = execution;
214
+ this.m5l_1 = queryProviderCommand;
215
+ this.n5l_1 = queryProvidersCommand;
216
+ this.o5l_1 = getAllCapabilitiesCommand;
217
+ this.p5l_1 = createRawSignatureCommand;
218
+ this.q5l_1 = verifyRawSignatureCommand;
219
+ this.r5l_1 = encryptCommand;
220
+ this.s5l_1 = decryptCommand;
221
+ this.t5l_1 = wrapKeyCommand;
222
+ this.u5l_1 = unwrapKeyCommand;
223
+ this.v5l_1 = performKeyAgreementCommand;
224
+ this.w5l_1 = generateKeyCommand;
225
+ this.x5l_1 = listKeysCommand;
226
+ this.y5l_1 = getKeyCommand;
227
+ this.z5l_1 = storeKeyCommand;
228
+ this.a5m_1 = deleteKeyCommand;
229
+ this.b5m_1 = resolvePublicKeyCommand;
230
+ }
231
+ s1i() {
232
+ return Companion_instance_2.newInstance(this.i5l_1.s1i(), this.j5l_1.s1i(), this.k5l_1.s1i(), this.l5l_1.s1i(), this.m5l_1.s1i(), this.n5l_1.s1i(), this.o5l_1.s1i(), this.p5l_1.s1i(), this.q5l_1.s1i(), this.r5l_1.s1i(), this.s5l_1.s1i(), this.t5l_1.s1i(), this.u5l_1.s1i(), this.v5l_1.s1i(), this.w5l_1.s1i(), this.x5l_1.s1i(), this.y5l_1.s1i(), this.z5l_1.s1i(), this.a5m_1.s1i(), this.b5m_1.s1i());
233
+ }
234
+ mirrorFunction(providerRegistry, resolverRegistry, keyStoreService, execution, queryProviderCommand, queryProvidersCommand, getAllCapabilitiesCommand, createRawSignatureCommand, verifyRawSignatureCommand, encryptCommand, decryptCommand, wrapKeyCommand, unwrapKeyCommand, performKeyAgreementCommand, generateKeyCommand, listKeysCommand, getKeyCommand, storeKeyCommand, deleteKeyCommand, resolvePublicKeyCommand) {
235
+ // Inline function 'kotlin.error' call
236
+ var message = 'Never called';
237
+ throw IllegalStateException.o(toString(message));
238
+ }
239
+ }
240
+ class MetroContributionToSessionScope {}
241
+ function bindsAsKeyManagerService(instance) {
242
+ // Inline function 'kotlin.error' call
243
+ var message = 'Never called';
244
+ throw IllegalStateException.o(toString(message));
245
+ }
246
+ function bindsAsSimpleSignatureService(instance) {
247
+ // Inline function 'kotlin.error' call
248
+ var message = 'Never called';
249
+ throw IllegalStateException.o(toString(message));
250
+ }
251
+ class KeyManagerServiceImpl {
252
+ constructor(providerRegistry, resolverRegistry, keyStoreService, execution, queryProviderCommand, queryProvidersCommand, getAllCapabilitiesCommand, createRawSignatureCommand, verifyRawSignatureCommand, encryptCommand, decryptCommand, wrapKeyCommand, unwrapKeyCommand, performKeyAgreementCommand, generateKeyCommand, listKeysCommand, getKeyCommand, storeKeyCommand, deleteKeyCommand, resolvePublicKeyCommand) {
253
+ this.c5m_1 = providerRegistry;
254
+ this.d5m_1 = resolverRegistry;
255
+ this.e5m_1 = keyStoreService;
256
+ this.f5m_1 = execution;
257
+ this.g5m_1 = queryProviderCommand;
258
+ this.h5m_1 = queryProvidersCommand;
259
+ this.i5m_1 = getAllCapabilitiesCommand;
260
+ this.j5m_1 = createRawSignatureCommand;
261
+ this.k5m_1 = verifyRawSignatureCommand;
262
+ this.l5m_1 = encryptCommand;
263
+ this.m5m_1 = decryptCommand;
264
+ this.n5m_1 = wrapKeyCommand;
265
+ this.o5m_1 = unwrapKeyCommand;
266
+ this.p5m_1 = performKeyAgreementCommand;
267
+ this.q5m_1 = generateKeyCommand;
268
+ this.r5m_1 = listKeysCommand;
269
+ this.s5m_1 = getKeyCommand;
270
+ this.t5m_1 = storeKeyCommand;
271
+ this.u5m_1 = deleteKeyCommand;
272
+ this.v5m_1 = resolvePublicKeyCommand;
273
+ }
274
+ w5m() {
275
+ return this.e5m_1;
276
+ }
277
+ defaultProviderId() {
278
+ return this.c5m_1.defaultProviderId();
279
+ }
280
+ getProviderIds() {
281
+ return this.c5m_1.getProviderIds();
282
+ }
283
+ s4x(id) {
284
+ return this.c5m_1.getProviderById(id);
285
+ }
286
+ t4x(providerId, alg) {
287
+ return this.c5m_1.getProvider(providerId, alg);
288
+ }
289
+ getKmsBySignatureAlgorithm(signatureAlgorithm) {
290
+ return this.c5m_1.getKmsBySignatureAlgorithm(signatureAlgorithm);
291
+ }
292
+ u4x(provider, makeDefaultKms) {
293
+ return this.c5m_1.registerProvider(provider, makeDefaultKms);
294
+ }
295
+ defaultResolverId() {
296
+ return this.d5m_1.defaultResolverId();
297
+ }
298
+ getResolverIds() {
299
+ return this.d5m_1.getResolverIds();
300
+ }
301
+ d4t(id) {
302
+ return this.d5m_1.getResolverById(id);
303
+ }
304
+ e4t(identifierMethod, keyType, resolverId) {
305
+ return this.d5m_1.getResolverByKeyTypeOrIdentifier(identifierMethod, keyType, resolverId);
306
+ }
307
+ f4t(resolver, makeDefaultResolver) {
308
+ return this.d5m_1.registerResolver(resolver, makeDefaultResolver);
309
+ }
310
+ *x5m(query, $completion) {
311
+ var tmp0_elvis_lhs = this.g5m_1;
312
+ var tmp;
313
+ if (tmp0_elvis_lhs == null) {
314
+ return asErrorResult(Companion_instance_1.v2o(VOID, VOID, 'QueryProviderCommand', 'Command not available'));
315
+ } else {
316
+ tmp = tmp0_elvis_lhs;
317
+ }
318
+ var command = tmp;
319
+ var tmp1_elvis_lhs = this.f5m_1;
320
+ var tmp_0;
321
+ if (tmp1_elvis_lhs == null) {
322
+ return asErrorResult(Companion_instance_1.p2o(VOID, VOID, 'SessionExecution not available'));
323
+ } else {
324
+ tmp_0 = tmp1_elvis_lhs;
325
+ }
326
+ var exec = tmp_0;
327
+ var args = new QueryProviderArgs(query);
328
+ return yield* command.f2s(args, $completion);
329
+ }
330
+ *y5m(query, $completion) {
331
+ var tmp0_elvis_lhs = this.h5m_1;
332
+ var tmp;
333
+ if (tmp0_elvis_lhs == null) {
334
+ return asErrorResult(Companion_instance_1.v2o(VOID, VOID, 'QueryProvidersCommand', 'Command not available'));
335
+ } else {
336
+ tmp = tmp0_elvis_lhs;
337
+ }
338
+ var command = tmp;
339
+ var tmp1_elvis_lhs = this.f5m_1;
340
+ var tmp_0;
341
+ if (tmp1_elvis_lhs == null) {
342
+ return asErrorResult(Companion_instance_1.p2o(VOID, VOID, 'SessionExecution not available'));
343
+ } else {
344
+ tmp_0 = tmp1_elvis_lhs;
345
+ }
346
+ var exec = tmp_0;
347
+ var args = new QueryProvidersArgs(query);
348
+ return yield* command.f2s(args, $completion);
349
+ }
350
+ *f4s(includeDisabled, $completion) {
351
+ var tmp0_elvis_lhs = this.i5m_1;
352
+ var tmp;
353
+ if (tmp0_elvis_lhs == null) {
354
+ return asErrorResult(Companion_instance_1.v2o(VOID, VOID, 'GetAllCapabilitiesCommand', 'Command not available'));
355
+ } else {
356
+ tmp = tmp0_elvis_lhs;
357
+ }
358
+ var command = tmp;
359
+ var tmp1_elvis_lhs = this.f5m_1;
360
+ var tmp_0;
361
+ if (tmp1_elvis_lhs == null) {
362
+ return asErrorResult(Companion_instance_1.p2o(VOID, VOID, 'SessionExecution not available'));
363
+ } else {
364
+ tmp_0 = tmp1_elvis_lhs;
365
+ }
366
+ var exec = tmp_0;
367
+ var args = new GetAllCapabilitiesArgs(includeDisabled);
368
+ return yield* command.f2s(args, $completion);
369
+ }
370
+ *g4t(keyInfo, identifierMethod, trustedCerts, verifyX509CertificateChain, $completion) {
371
+ var command = this.v5m_1;
372
+ var exec = this.f5m_1;
373
+ if (!(command == null) && !(exec == null)) {
374
+ var args = new ResolvePublicKeyArgs(keyInfo, identifierMethod, trustedCerts, verifyX509CertificateChain);
375
+ var result = yield* command.f2s(args, $completion);
376
+ // Inline function 'com.sphereon.core.api.IdkResult.getOrElse' call
377
+ // Inline function 'com.github.michaelbull.result.getOrElse' call
378
+ var this_0 = result.o2n_1;
379
+ var tmp;
380
+ if (_Result___get_isOk__impl__qbhaup(this_0)) {
381
+ tmp = _Result___get_value__impl__bjfvqg(this_0);
382
+ } else {
383
+ var tmp0_elvis_lhs = _Result___get_error__impl__ihqhun(this_0).message.defaultMessage;
384
+ throw PKIException.s44(tmp0_elvis_lhs == null ? 'Resolve public key failed' : tmp0_elvis_lhs);
385
+ }
386
+ var tmp0_elvis_lhs_0 = tmp.resolvedKeyInfo;
387
+ var tmp_0;
388
+ if (tmp0_elvis_lhs_0 == null) {
389
+ throw PKIException.s44('Resolved key info is null');
390
+ } else {
391
+ tmp_0 = tmp0_elvis_lhs_0;
392
+ }
393
+ var resolvedKeyInfo = tmp_0;
394
+ return isInterface(resolvedKeyInfo, ResolvedKeyInfoType) ? resolvedKeyInfo : THROW_CCE();
395
+ }
396
+ return yield* this.getResolverByKeyTypeOrIdentifier(identifierMethod, keyInfo.keyType, keyInfo.i43()).g4t(keyInfo, identifierMethod, trustedCerts, verifyX509CertificateChain, $completion);
397
+ }
398
+ *j4s(providerId, alias, use, keyOperations, alg, keyVisibility, $completion) {
399
+ var command = this.q5m_1;
400
+ var exec = this.f5m_1;
401
+ if (!(command == null) && !(exec == null)) {
402
+ var args = new GenerateKeyArgs(providerId, alias, use, keyOperations, alg, keyVisibility);
403
+ var result = yield* command.f2s(args, $completion);
404
+ // Inline function 'com.sphereon.core.api.IdkResult.getOrElse' call
405
+ // Inline function 'com.github.michaelbull.result.getOrElse' call
406
+ var this_0 = result.o2n_1;
407
+ var tmp;
408
+ if (_Result___get_isOk__impl__qbhaup(this_0)) {
409
+ tmp = _Result___get_value__impl__bjfvqg(this_0);
410
+ } else {
411
+ var tmp0_elvis_lhs = _Result___get_error__impl__ihqhun(this_0).message.defaultMessage;
412
+ throw PKIException.s44(tmp0_elvis_lhs == null ? 'Key generation failed' : tmp0_elvis_lhs);
413
+ }
414
+ var tmp0_elvis_lhs_0 = tmp.keyPair;
415
+ var tmp_0;
416
+ if (tmp0_elvis_lhs_0 == null) {
417
+ throw PKIException.s44('Generated key pair is null');
418
+ } else {
419
+ tmp_0 = tmp0_elvis_lhs_0;
420
+ }
421
+ return tmp_0;
422
+ }
423
+ var kmsProvider = this.getProvider(providerId, alg);
424
+ var keyPair = yield* generateKeyAsync$virtualSuspendBridge(kmsProvider, alias, use, keyOperations, alg, VOID, $completion);
425
+ return keyPair;
426
+ }
427
+ *h4s(providerId, alias, use, keyOperations, alg, keyVisibility, $completion) {
428
+ return yield* this.j4s(providerId, alias, use, keyOperations, alg, keyVisibility, $completion);
429
+ }
430
+ *a4z(keyInfo, input, requireX5Chain, $completion) {
431
+ var command = this.j5m_1;
432
+ var exec = this.f5m_1;
433
+ if (!(command == null) && !(exec == null)) {
434
+ var args = new CreateRawSignatureArgs(keyInfo, input, requireX5Chain);
435
+ var result = yield* command.f2s(args, $completion);
436
+ // Inline function 'com.sphereon.core.api.IdkResult.getOrElse' call
437
+ // Inline function 'com.github.michaelbull.result.getOrElse' call
438
+ var this_0 = result.o2n_1;
439
+ var tmp;
440
+ if (_Result___get_isOk__impl__qbhaup(this_0)) {
441
+ tmp = _Result___get_value__impl__bjfvqg(this_0);
442
+ } else {
443
+ var tmp0_elvis_lhs = _Result___get_error__impl__ihqhun(this_0).message.defaultMessage;
444
+ throw PKIException.s44(tmp0_elvis_lhs == null ? 'Signature creation failed' : tmp0_elvis_lhs);
445
+ }
446
+ return tmp.signature;
447
+ }
448
+ return yield* this.getProvider(keyInfo.i43(), keyInfo.signatureAlgorithm).a4z(keyInfo, input, requireX5Chain, $completion);
449
+ }
450
+ *b4z(keyInfo, input, signature, $completion) {
451
+ var tmp;
452
+ var tmp_0;
453
+ if (keyInfo.key == null && keyInfo.g43() == null && keyInfo.j43() == null) {
454
+ // Inline function 'kotlin.collections.isNullOrEmpty' call
455
+ var this_0 = keyInfo.x5c;
456
+ var tmp_1;
457
+ if (this_0 == null) {
458
+ tmp_1 = true;
459
+ } else {
460
+ // Inline function 'kotlin.collections.isEmpty' call
461
+ tmp_1 = this_0.length === 0;
462
+ }
463
+ tmp_0 = !tmp_1;
464
+ } else {
465
+ tmp_0 = false;
466
+ }
467
+ if (tmp_0) {
468
+ tmp = yield* this.b4t(keyInfo, IdentifierMethod_x5c_getInstance(), VOID, VOID, $completion);
469
+ } else {
470
+ tmp = keyInfo;
471
+ }
472
+ var resolvedKeyInfo = tmp;
473
+ var command = this.k5m_1;
474
+ var exec = this.f5m_1;
475
+ if (!(command == null) && !(exec == null)) {
476
+ var args = new VerifyRawSignatureArgs(resolvedKeyInfo, input, signature);
477
+ var result = yield* command.f2s(args, $completion);
478
+ // Inline function 'com.sphereon.core.api.IdkResult.getOrElse' call
479
+ // Inline function 'com.github.michaelbull.result.getOrElse' call
480
+ var this_1 = result.o2n_1;
481
+ var tmp_2;
482
+ if (_Result___get_isOk__impl__qbhaup(this_1)) {
483
+ tmp_2 = _Result___get_value__impl__bjfvqg(this_1);
484
+ } else {
485
+ var tmp0_elvis_lhs = _Result___get_error__impl__ihqhun(this_1).message.defaultMessage;
486
+ throw PKIException.s44(tmp0_elvis_lhs == null ? 'Signature verification failed' : tmp0_elvis_lhs);
487
+ }
488
+ return tmp_2.isValid;
489
+ }
490
+ var kms = resolvedKeyInfo.i43();
491
+ var alg = resolvedKeyInfo.signatureAlgorithm;
492
+ if (!(kms === null) || !(alg === null)) {
493
+ return yield* this.getProvider(kms, alg).b4z(resolvedKeyInfo, input, signature, $completion);
494
+ }
495
+ return yield* this.getProviderById(this.defaultProviderId()).b4z(resolvedKeyInfo, input, signature, $completion);
496
+ }
497
+ *l4r(keyInfo, plaintext, algorithm, additionalAuthenticatedData, $completion) {
498
+ var command = this.l5m_1;
499
+ var exec = this.f5m_1;
500
+ if (!(command == null) && !(exec == null)) {
501
+ var args = new EncryptArgs(keyInfo, plaintext, algorithm, additionalAuthenticatedData);
502
+ var result = yield* command.f2s(args, $completion);
503
+ // Inline function 'com.sphereon.core.api.IdkResult.getOrElse' call
504
+ // Inline function 'com.github.michaelbull.result.getOrElse' call
505
+ var this_0 = result.o2n_1;
506
+ var tmp;
507
+ if (_Result___get_isOk__impl__qbhaup(this_0)) {
508
+ tmp = _Result___get_value__impl__bjfvqg(this_0);
509
+ } else {
510
+ var tmp0_elvis_lhs = _Result___get_error__impl__ihqhun(this_0).message.defaultMessage;
511
+ throw PKIException.s44(tmp0_elvis_lhs == null ? 'Encryption failed' : tmp0_elvis_lhs);
512
+ }
513
+ var encResult = tmp;
514
+ return new EncryptionResult(encResult.ciphertext, encResult.iv, encResult.authTag);
515
+ }
516
+ return yield* encrypt$virtualSuspendBridge(this.getProvider(keyInfo.i43(), keyInfo.signatureAlgorithm), keyInfo, plaintext, algorithm, additionalAuthenticatedData, $completion);
517
+ }
518
+ encrypt(keyInfo, plaintext, algorithm, additionalAuthenticatedData) {
519
+ return promisify(($completion) => this.m4r(keyInfo, plaintext, algorithm, additionalAuthenticatedData, $completion));
520
+ }
521
+ *h4r(keyInfo, plaintext, algorithm, additionalAuthenticatedData, $completion) {
522
+ return this.encrypt === protoOf(KeyManagerServiceImpl).encrypt ? (yield* this.m4r(keyInfo, plaintext, algorithm, additionalAuthenticatedData, $completion)) : (yield* await_0(this.encrypt(keyInfo, plaintext, algorithm, additionalAuthenticatedData), $completion));
523
+ }
524
+ *n4r(keyInfo, ciphertext, algorithm, iv, authTag, additionalAuthenticatedData, $completion) {
525
+ var command = this.m5m_1;
526
+ var exec = this.f5m_1;
527
+ if (!(command == null) && !(exec == null)) {
528
+ var args = new DecryptArgs(keyInfo, ciphertext, algorithm, iv, authTag, additionalAuthenticatedData);
529
+ var result = yield* command.f2s(args, $completion);
530
+ // Inline function 'com.sphereon.core.api.IdkResult.getOrElse' call
531
+ // Inline function 'com.github.michaelbull.result.getOrElse' call
532
+ var this_0 = result.o2n_1;
533
+ var tmp;
534
+ if (_Result___get_isOk__impl__qbhaup(this_0)) {
535
+ tmp = _Result___get_value__impl__bjfvqg(this_0);
536
+ } else {
537
+ var tmp0_elvis_lhs = _Result___get_error__impl__ihqhun(this_0).message.defaultMessage;
538
+ throw PKIException.s44(tmp0_elvis_lhs == null ? 'Decryption failed' : tmp0_elvis_lhs);
539
+ }
540
+ return tmp.plaintext;
541
+ }
542
+ return yield* decrypt$virtualSuspendBridge(this.getProvider(keyInfo.i43(), keyInfo.signatureAlgorithm), keyInfo, ciphertext, algorithm, iv, authTag, additionalAuthenticatedData, $completion);
543
+ }
544
+ decrypt(keyInfo, ciphertext, algorithm, iv, authTag, additionalAuthenticatedData) {
545
+ return promisify(($completion) => this.o4r(keyInfo, ciphertext, algorithm, iv, authTag, additionalAuthenticatedData, $completion));
546
+ }
547
+ *i4r(keyInfo, ciphertext, algorithm, iv, authTag, additionalAuthenticatedData, $completion) {
548
+ return this.decrypt === protoOf(KeyManagerServiceImpl).decrypt ? (yield* this.o4r(keyInfo, ciphertext, algorithm, iv, authTag, additionalAuthenticatedData, $completion)) : (yield* await_0(this.decrypt(keyInfo, ciphertext, algorithm, iv, authTag, additionalAuthenticatedData), $completion));
549
+ }
550
+ *p4r(wrappingKeyInfo, keyToWrap, algorithm, $completion) {
551
+ var command = this.n5m_1;
552
+ var exec = this.f5m_1;
553
+ if (!(command == null) && !(exec == null)) {
554
+ var args = new WrapKeyArgs(wrappingKeyInfo, keyToWrap, algorithm);
555
+ var result = yield* command.f2s(args, $completion);
556
+ // Inline function 'com.sphereon.core.api.IdkResult.getOrElse' call
557
+ // Inline function 'com.github.michaelbull.result.getOrElse' call
558
+ var this_0 = result.o2n_1;
559
+ var tmp;
560
+ if (_Result___get_isOk__impl__qbhaup(this_0)) {
561
+ tmp = _Result___get_value__impl__bjfvqg(this_0);
562
+ } else {
563
+ var tmp0_elvis_lhs = _Result___get_error__impl__ihqhun(this_0).message.defaultMessage;
564
+ throw PKIException.s44(tmp0_elvis_lhs == null ? 'Key wrap failed' : tmp0_elvis_lhs);
565
+ }
566
+ return tmp.wrappedKey;
567
+ }
568
+ return yield* wrapKey$virtualSuspendBridge(this.getProvider(wrappingKeyInfo.i43(), wrappingKeyInfo.signatureAlgorithm), wrappingKeyInfo, keyToWrap, algorithm, $completion);
569
+ }
570
+ wrapKey(wrappingKeyInfo, keyToWrap, algorithm) {
571
+ return promisify(($completion) => this.p4r(wrappingKeyInfo, keyToWrap, algorithm, $completion));
572
+ }
573
+ *j4r(wrappingKeyInfo, keyToWrap, algorithm, $completion) {
574
+ return this.wrapKey === protoOf(KeyManagerServiceImpl).wrapKey ? (yield* this.p4r(wrappingKeyInfo, keyToWrap, algorithm, $completion)) : (yield* await_0(this.wrapKey(wrappingKeyInfo, keyToWrap, algorithm), $completion));
575
+ }
576
+ *q4r(unwrappingKeyInfo, wrappedKey, algorithm, $completion) {
577
+ var command = this.o5m_1;
578
+ var exec = this.f5m_1;
579
+ if (!(command == null) && !(exec == null)) {
580
+ var args = new UnwrapKeyArgs(unwrappingKeyInfo, wrappedKey, algorithm);
581
+ var result = yield* command.f2s(args, $completion);
582
+ // Inline function 'com.sphereon.core.api.IdkResult.getOrElse' call
583
+ // Inline function 'com.github.michaelbull.result.getOrElse' call
584
+ var this_0 = result.o2n_1;
585
+ var tmp;
586
+ if (_Result___get_isOk__impl__qbhaup(this_0)) {
587
+ tmp = _Result___get_value__impl__bjfvqg(this_0);
588
+ } else {
589
+ var tmp0_elvis_lhs = _Result___get_error__impl__ihqhun(this_0).message.defaultMessage;
590
+ throw PKIException.s44(tmp0_elvis_lhs == null ? 'Key unwrap failed' : tmp0_elvis_lhs);
591
+ }
592
+ return tmp.unwrappedKey;
593
+ }
594
+ return yield* unwrapKey$virtualSuspendBridge(this.getProvider(unwrappingKeyInfo.i43(), unwrappingKeyInfo.signatureAlgorithm), unwrappingKeyInfo, wrappedKey, algorithm, $completion);
595
+ }
596
+ unwrapKey(unwrappingKeyInfo, wrappedKey, algorithm) {
597
+ return promisify(($completion) => this.q4r(unwrappingKeyInfo, wrappedKey, algorithm, $completion));
598
+ }
599
+ *k4r(unwrappingKeyInfo, wrappedKey, algorithm, $completion) {
600
+ return this.unwrapKey === protoOf(KeyManagerServiceImpl).unwrapKey ? (yield* this.q4r(unwrappingKeyInfo, wrappedKey, algorithm, $completion)) : (yield* await_0(this.unwrapKey(unwrappingKeyInfo, wrappedKey, algorithm), $completion));
601
+ }
602
+ *r4r(privateKeyInfo, publicKeyInfo, algorithm, keyDataLen, $completion) {
603
+ var command = this.p5m_1;
604
+ var exec = this.f5m_1;
605
+ if (!(command == null) && !(exec == null)) {
606
+ var args = new PerformKeyAgreementArgs(privateKeyInfo, publicKeyInfo, algorithm, keyDataLen);
607
+ var result = yield* command.f2s(args, $completion);
608
+ // Inline function 'com.sphereon.core.api.IdkResult.getOrElse' call
609
+ // Inline function 'com.github.michaelbull.result.getOrElse' call
610
+ var this_0 = result.o2n_1;
611
+ var tmp;
612
+ if (_Result___get_isOk__impl__qbhaup(this_0)) {
613
+ tmp = _Result___get_value__impl__bjfvqg(this_0);
614
+ } else {
615
+ var tmp0_elvis_lhs = _Result___get_error__impl__ihqhun(this_0).message.defaultMessage;
616
+ throw PKIException.s44(tmp0_elvis_lhs == null ? 'Key agreement failed' : tmp0_elvis_lhs);
617
+ }
618
+ return tmp.sharedSecret;
619
+ }
620
+ return yield* /*#__NOINLINE__*/performKeyAgreementDirect(this, privateKeyInfo, publicKeyInfo, algorithm, keyDataLen, $completion);
621
+ }
622
+ performKeyAgreement(privateKeyInfo, publicKeyInfo, algorithm, keyDataLen) {
623
+ return promisify(($completion) => this.s4r(privateKeyInfo, publicKeyInfo, algorithm, keyDataLen, $completion));
624
+ }
625
+ *t4r(privateKeyInfo, publicKeyInfo, algorithm, keyDataLen, $completion) {
626
+ return this.performKeyAgreement === protoOf(KeyManagerServiceImpl).performKeyAgreement ? (yield* this.s4r(privateKeyInfo, publicKeyInfo, algorithm, keyDataLen, $completion)) : (yield* await_0(this.performKeyAgreement(privateKeyInfo, publicKeyInfo, algorithm, keyDataLen), $completion));
627
+ }
628
+ *v4t(keyInfo, providerId, alias, certChain, $completion) {
629
+ var command = this.t5m_1;
630
+ var exec = this.f5m_1;
631
+ if (!(command == null) && !(exec == null)) {
632
+ var args = new StoreKeyArgs(keyInfo, providerId, alias, certChain);
633
+ var result = yield* command.f2s(args, $completion);
634
+ // Inline function 'com.sphereon.core.api.IdkResult.getOrElse' call
635
+ // Inline function 'com.github.michaelbull.result.getOrElse' call
636
+ var this_0 = result.o2n_1;
637
+ var tmp;
638
+ if (_Result___get_isOk__impl__qbhaup(this_0)) {
639
+ tmp = _Result___get_value__impl__bjfvqg(this_0);
640
+ } else {
641
+ var tmp0_elvis_lhs = _Result___get_error__impl__ihqhun(this_0).message.defaultMessage;
642
+ throw PKIException.s44(tmp0_elvis_lhs == null ? 'Store key failed' : tmp0_elvis_lhs);
643
+ }
644
+ var tmp0_elvis_lhs_0 = tmp.key;
645
+ var tmp_0;
646
+ if (tmp0_elvis_lhs_0 == null) {
647
+ throw PKIException.s44('Store key result is null');
648
+ } else {
649
+ tmp_0 = tmp0_elvis_lhs_0;
650
+ }
651
+ return tmp_0;
652
+ }
653
+ return yield* storeKey$virtualSuspendBridge(this.w5m(), keyInfo, providerId, alias, certChain, $completion);
654
+ }
655
+ storeKey(keyInfo, providerId, alias, certChain) {
656
+ return promisify(($completion) => this.c4t(keyInfo, providerId, alias, certChain, $completion));
657
+ }
658
+ *k4t(keyInfo, providerId, alias, certChain, $completion) {
659
+ return this.storeKey === protoOf(KeyManagerServiceImpl).storeKey ? (yield* this.c4t(keyInfo, providerId, alias, certChain, $completion)) : (yield* await_0(this.storeKey(keyInfo, providerId, alias, certChain), $completion));
660
+ }
661
+ m4t() {
662
+ return this.w5m().settings;
663
+ }
664
+ *n4t($completion) {
665
+ var command = this.r5m_1;
666
+ var exec = this.f5m_1;
667
+ if (!(command == null) && !(exec == null)) {
668
+ var args = new ListKeysArgs();
669
+ var result = yield* command.f2s(args, $completion);
670
+ // Inline function 'com.sphereon.core.api.IdkResult.getOrElse' call
671
+ // Inline function 'com.github.michaelbull.result.getOrElse' call
672
+ var this_0 = result.o2n_1;
673
+ var tmp;
674
+ if (_Result___get_isOk__impl__qbhaup(this_0)) {
675
+ tmp = _Result___get_value__impl__bjfvqg(this_0);
676
+ } else {
677
+ var tmp0_elvis_lhs = _Result___get_error__impl__ihqhun(this_0).message.defaultMessage;
678
+ throw PKIException.s44(tmp0_elvis_lhs == null ? 'List keys failed' : tmp0_elvis_lhs);
679
+ }
680
+ return tmp.keys;
681
+ }
682
+ return yield* listKeys$virtualSuspendBridge(this.w5m(), $completion);
683
+ }
684
+ listKeys() {
685
+ return promisify(($completion) => this.n4t($completion));
686
+ }
687
+ *h4t($completion) {
688
+ return this.listKeys === protoOf(KeyManagerServiceImpl).listKeys ? (yield* this.n4t($completion)) : (yield* await_0(this.listKeys(), $completion));
689
+ }
690
+ *o4t(filter, $completion) {
691
+ return yield* listKeys$virtualSuspendBridge_0(this.w5m(), filter, $completion);
692
+ }
693
+ listKeysFiltered(filter) {
694
+ return promisify(($completion) => this.o4t(filter, $completion));
695
+ }
696
+ *i4t(filter, $completion) {
697
+ return this.listKeysFiltered === protoOf(KeyManagerServiceImpl).listKeysFiltered ? (yield* this.o4t(filter, $completion)) : (yield* await_0(this.listKeysFiltered(filter), $completion));
698
+ }
699
+ *u4t(keyInfo, $completion) {
700
+ var command = this.s5m_1;
701
+ var exec = this.f5m_1;
702
+ if (!(command == null) && !(exec == null)) {
703
+ var args = new GetKeyArgs(keyInfo);
704
+ var result = yield* command.f2s(args, $completion);
705
+ // Inline function 'com.sphereon.core.api.IdkResult.getOrElse' call
706
+ // Inline function 'com.github.michaelbull.result.getOrElse' call
707
+ var this_0 = result.o2n_1;
708
+ var tmp;
709
+ if (_Result___get_isOk__impl__qbhaup(this_0)) {
710
+ tmp = _Result___get_value__impl__bjfvqg(this_0);
711
+ } else {
712
+ var tmp0_elvis_lhs = _Result___get_error__impl__ihqhun(this_0).message.defaultMessage;
713
+ throw PKIException.s44(tmp0_elvis_lhs == null ? 'Get key failed' : tmp0_elvis_lhs);
714
+ }
715
+ var tmp0_elvis_lhs_0 = tmp.key;
716
+ var tmp_0;
717
+ if (tmp0_elvis_lhs_0 == null) {
718
+ throw PKIException.s44('Get key result is null');
719
+ } else {
720
+ tmp_0 = tmp0_elvis_lhs_0;
721
+ }
722
+ return tmp_0;
723
+ }
724
+ return yield* getKey$virtualSuspendBridge(this.w5m(), keyInfo, $completion);
725
+ }
726
+ getKey(keyInfo) {
727
+ return promisify(($completion) => this.u4t(keyInfo, $completion));
728
+ }
729
+ *j4t(keyInfo, $completion) {
730
+ return this.getKey === protoOf(KeyManagerServiceImpl).getKey ? (yield* this.u4t(keyInfo, $completion)) : (yield* await_0(this.getKey(keyInfo), $completion));
731
+ }
732
+ *w4t(keyInfo, $completion) {
733
+ var command = this.u5m_1;
734
+ var exec = this.f5m_1;
735
+ if (!(command == null) && !(exec == null)) {
736
+ var args = new DeleteKeyArgs(keyInfo);
737
+ var result = yield* command.f2s(args, $completion);
738
+ // Inline function 'com.sphereon.core.api.IdkResult.getOrElse' call
739
+ // Inline function 'com.github.michaelbull.result.getOrElse' call
740
+ var this_0 = result.o2n_1;
741
+ var tmp;
742
+ if (_Result___get_isOk__impl__qbhaup(this_0)) {
743
+ tmp = _Result___get_value__impl__bjfvqg(this_0);
744
+ } else {
745
+ var tmp0_elvis_lhs = _Result___get_error__impl__ihqhun(this_0).message.defaultMessage;
746
+ throw PKIException.s44(tmp0_elvis_lhs == null ? 'Delete key failed' : tmp0_elvis_lhs);
747
+ }
748
+ return tmp.deleted;
749
+ }
750
+ return yield* deleteKey$virtualSuspendBridge(this.w5m(), keyInfo, $completion);
751
+ }
752
+ deleteKey(keyInfo) {
753
+ return promisify(($completion) => this.w4t(keyInfo, $completion));
754
+ }
755
+ *l4t(keyInfo, $completion) {
756
+ return this.deleteKey === protoOf(KeyManagerServiceImpl).deleteKey ? (yield* this.w4t(keyInfo, $completion)) : (yield* await_0(this.deleteKey(keyInfo), $completion));
757
+ }
758
+ keyVisibility() {
759
+ return this.w5m().keyVisibility();
760
+ }
761
+ *l4s(keyInfo, input, requireX5Chain, $completion) {
762
+ var tmp0_elvis_lhs = this.j5m_1;
763
+ var tmp;
764
+ if (tmp0_elvis_lhs == null) {
765
+ return asErrorResult(Companion_instance_1.v2o(VOID, VOID, 'CreateRawSignatureCommand', 'Command not available'));
766
+ } else {
767
+ tmp = tmp0_elvis_lhs;
768
+ }
769
+ var command = tmp;
770
+ var tmp1_elvis_lhs = this.f5m_1;
771
+ var tmp_0;
772
+ if (tmp1_elvis_lhs == null) {
773
+ return asErrorResult(Companion_instance_1.p2o(VOID, VOID, 'SessionExecution not available'));
774
+ } else {
775
+ tmp_0 = tmp1_elvis_lhs;
776
+ }
777
+ var exec = tmp_0;
778
+ var args = new CreateRawSignatureArgs(keyInfo, input, requireX5Chain);
779
+ return yield* command.f2s(args, $completion);
780
+ }
781
+ *z5m(keyInfo, input, signature, $completion) {
782
+ var tmp0_elvis_lhs = this.k5m_1;
783
+ var tmp;
784
+ if (tmp0_elvis_lhs == null) {
785
+ return asErrorResult(Companion_instance_1.v2o(VOID, VOID, 'VerifyRawSignatureCommand', 'Command not available'));
786
+ } else {
787
+ tmp = tmp0_elvis_lhs;
788
+ }
789
+ var command = tmp;
790
+ var tmp1_elvis_lhs = this.f5m_1;
791
+ var tmp_0;
792
+ if (tmp1_elvis_lhs == null) {
793
+ return asErrorResult(Companion_instance_1.p2o(VOID, VOID, 'SessionExecution not available'));
794
+ } else {
795
+ tmp_0 = tmp1_elvis_lhs;
796
+ }
797
+ var exec = tmp_0;
798
+ var args = new VerifyRawSignatureArgs(keyInfo, input, signature);
799
+ return yield* command.f2s(args, $completion);
800
+ }
801
+ *n4s(keyInfo, plaintext, algorithm, additionalAuthenticatedData, $completion) {
802
+ var tmp0_elvis_lhs = this.l5m_1;
803
+ var tmp;
804
+ if (tmp0_elvis_lhs == null) {
805
+ return asErrorResult(Companion_instance_1.v2o(VOID, VOID, 'EncryptCommand', 'Command not available'));
806
+ } else {
807
+ tmp = tmp0_elvis_lhs;
808
+ }
809
+ var command = tmp;
810
+ var tmp1_elvis_lhs = this.f5m_1;
811
+ var tmp_0;
812
+ if (tmp1_elvis_lhs == null) {
813
+ return asErrorResult(Companion_instance_1.p2o(VOID, VOID, 'SessionExecution not available'));
814
+ } else {
815
+ tmp_0 = tmp1_elvis_lhs;
816
+ }
817
+ var exec = tmp_0;
818
+ var args = new EncryptArgs(keyInfo, plaintext, algorithm, additionalAuthenticatedData);
819
+ return yield* command.f2s(args, $completion);
820
+ }
821
+ *p4s(keyInfo, ciphertext, algorithm, iv, authTag, additionalAuthenticatedData, $completion) {
822
+ var tmp0_elvis_lhs = this.m5m_1;
823
+ var tmp;
824
+ if (tmp0_elvis_lhs == null) {
825
+ return asErrorResult(Companion_instance_1.v2o(VOID, VOID, 'DecryptCommand', 'Command not available'));
826
+ } else {
827
+ tmp = tmp0_elvis_lhs;
828
+ }
829
+ var command = tmp;
830
+ var tmp1_elvis_lhs = this.f5m_1;
831
+ var tmp_0;
832
+ if (tmp1_elvis_lhs == null) {
833
+ return asErrorResult(Companion_instance_1.p2o(VOID, VOID, 'SessionExecution not available'));
834
+ } else {
835
+ tmp_0 = tmp1_elvis_lhs;
836
+ }
837
+ var exec = tmp_0;
838
+ var args = new DecryptArgs(keyInfo, ciphertext, algorithm, iv, authTag, additionalAuthenticatedData);
839
+ return yield* command.f2s(args, $completion);
840
+ }
841
+ *a5n(wrappingKeyInfo, keyToWrap, algorithm, $completion) {
842
+ var tmp0_elvis_lhs = this.n5m_1;
843
+ var tmp;
844
+ if (tmp0_elvis_lhs == null) {
845
+ return asErrorResult(Companion_instance_1.v2o(VOID, VOID, 'WrapKeyCommand', 'Command not available'));
846
+ } else {
847
+ tmp = tmp0_elvis_lhs;
848
+ }
849
+ var command = tmp;
850
+ var tmp1_elvis_lhs = this.f5m_1;
851
+ var tmp_0;
852
+ if (tmp1_elvis_lhs == null) {
853
+ return asErrorResult(Companion_instance_1.p2o(VOID, VOID, 'SessionExecution not available'));
854
+ } else {
855
+ tmp_0 = tmp1_elvis_lhs;
856
+ }
857
+ var exec = tmp_0;
858
+ var args = new WrapKeyArgs(wrappingKeyInfo, keyToWrap, algorithm);
859
+ return yield* command.f2s(args, $completion);
860
+ }
861
+ *b5n(unwrappingKeyInfo, wrappedKey, algorithm, $completion) {
862
+ var tmp0_elvis_lhs = this.o5m_1;
863
+ var tmp;
864
+ if (tmp0_elvis_lhs == null) {
865
+ return asErrorResult(Companion_instance_1.v2o(VOID, VOID, 'UnwrapKeyCommand', 'Command not available'));
866
+ } else {
867
+ tmp = tmp0_elvis_lhs;
868
+ }
869
+ var command = tmp;
870
+ var tmp1_elvis_lhs = this.f5m_1;
871
+ var tmp_0;
872
+ if (tmp1_elvis_lhs == null) {
873
+ return asErrorResult(Companion_instance_1.p2o(VOID, VOID, 'SessionExecution not available'));
874
+ } else {
875
+ tmp_0 = tmp1_elvis_lhs;
876
+ }
877
+ var exec = tmp_0;
878
+ var args = new UnwrapKeyArgs(unwrappingKeyInfo, wrappedKey, algorithm);
879
+ return yield* command.f2s(args, $completion);
880
+ }
881
+ *r4s(privateKeyInfo, publicKeyInfo, algorithm, keyDataLen, $completion) {
882
+ var tmp0_elvis_lhs = this.p5m_1;
883
+ var tmp;
884
+ if (tmp0_elvis_lhs == null) {
885
+ return asErrorResult(Companion_instance_1.v2o(VOID, VOID, 'PerformKeyAgreementCommand', 'Command not available'));
886
+ } else {
887
+ tmp = tmp0_elvis_lhs;
888
+ }
889
+ var command = tmp;
890
+ var tmp1_elvis_lhs = this.f5m_1;
891
+ var tmp_0;
892
+ if (tmp1_elvis_lhs == null) {
893
+ return asErrorResult(Companion_instance_1.p2o(VOID, VOID, 'SessionExecution not available'));
894
+ } else {
895
+ tmp_0 = tmp1_elvis_lhs;
896
+ }
897
+ var exec = tmp_0;
898
+ var args = new PerformKeyAgreementArgs(privateKeyInfo, publicKeyInfo, algorithm, keyDataLen);
899
+ return yield* command.f2s(args, $completion);
900
+ }
901
+ *t4s(providerId, alias, use, keyOperations, alg, keyVisibility, $completion) {
902
+ var tmp0_elvis_lhs = this.q5m_1;
903
+ var tmp;
904
+ if (tmp0_elvis_lhs == null) {
905
+ return asErrorResult(Companion_instance_1.v2o(VOID, VOID, 'GenerateKeyCommand', 'Command not available'));
906
+ } else {
907
+ tmp = tmp0_elvis_lhs;
908
+ }
909
+ var command = tmp;
910
+ var tmp1_elvis_lhs = this.f5m_1;
911
+ var tmp_0;
912
+ if (tmp1_elvis_lhs == null) {
913
+ return asErrorResult(Companion_instance_1.p2o(VOID, VOID, 'SessionExecution not available'));
914
+ } else {
915
+ tmp_0 = tmp1_elvis_lhs;
916
+ }
917
+ var exec = tmp_0;
918
+ var args = new GenerateKeyArgs(providerId, alias, use, keyOperations, alg, keyVisibility);
919
+ return yield* command.f2s(args, $completion);
920
+ }
921
+ *v4s(providerId, $completion) {
922
+ var tmp0_elvis_lhs = this.r5m_1;
923
+ var tmp;
924
+ if (tmp0_elvis_lhs == null) {
925
+ return asErrorResult(Companion_instance_1.v2o(VOID, VOID, 'ListKeysCommand', 'Command not available'));
926
+ } else {
927
+ tmp = tmp0_elvis_lhs;
928
+ }
929
+ var command = tmp;
930
+ var tmp1_elvis_lhs = this.f5m_1;
931
+ var tmp_0;
932
+ if (tmp1_elvis_lhs == null) {
933
+ return asErrorResult(Companion_instance_1.p2o(VOID, VOID, 'SessionExecution not available'));
934
+ } else {
935
+ tmp_0 = tmp1_elvis_lhs;
936
+ }
937
+ var exec = tmp_0;
938
+ var args = new ListKeysArgs(providerId);
939
+ return yield* command.f2s(args, $completion);
940
+ }
941
+ *c5n(keyInfo, $completion) {
942
+ var tmp0_elvis_lhs = this.s5m_1;
943
+ var tmp;
944
+ if (tmp0_elvis_lhs == null) {
945
+ return asErrorResult(Companion_instance_1.v2o(VOID, VOID, 'GetKeyCommand', 'Command not available'));
946
+ } else {
947
+ tmp = tmp0_elvis_lhs;
948
+ }
949
+ var command = tmp;
950
+ var tmp1_elvis_lhs = this.f5m_1;
951
+ var tmp_0;
952
+ if (tmp1_elvis_lhs == null) {
953
+ return asErrorResult(Companion_instance_1.p2o(VOID, VOID, 'SessionExecution not available'));
954
+ } else {
955
+ tmp_0 = tmp1_elvis_lhs;
956
+ }
957
+ var exec = tmp_0;
958
+ var args = new GetKeyArgs(keyInfo);
959
+ return yield* command.f2s(args, $completion);
960
+ }
961
+ *x4s(keyInfo, providerId, alias, certChain, $completion) {
962
+ var tmp0_elvis_lhs = this.t5m_1;
963
+ var tmp;
964
+ if (tmp0_elvis_lhs == null) {
965
+ return asErrorResult(Companion_instance_1.v2o(VOID, VOID, 'StoreKeyCommand', 'Command not available'));
966
+ } else {
967
+ tmp = tmp0_elvis_lhs;
968
+ }
969
+ var command = tmp;
970
+ var tmp1_elvis_lhs = this.f5m_1;
971
+ var tmp_0;
972
+ if (tmp1_elvis_lhs == null) {
973
+ return asErrorResult(Companion_instance_1.p2o(VOID, VOID, 'SessionExecution not available'));
974
+ } else {
975
+ tmp_0 = tmp1_elvis_lhs;
976
+ }
977
+ var exec = tmp_0;
978
+ var args = new StoreKeyArgs(keyInfo, providerId, alias, certChain);
979
+ return yield* command.f2s(args, $completion);
980
+ }
981
+ *d5n(keyInfo, $completion) {
982
+ var tmp0_elvis_lhs = this.u5m_1;
983
+ var tmp;
984
+ if (tmp0_elvis_lhs == null) {
985
+ return asErrorResult(Companion_instance_1.v2o(VOID, VOID, 'DeleteKeyCommand', 'Command not available'));
986
+ } else {
987
+ tmp = tmp0_elvis_lhs;
988
+ }
989
+ var command = tmp;
990
+ var tmp1_elvis_lhs = this.f5m_1;
991
+ var tmp_0;
992
+ if (tmp1_elvis_lhs == null) {
993
+ return asErrorResult(Companion_instance_1.p2o(VOID, VOID, 'SessionExecution not available'));
994
+ } else {
995
+ tmp_0 = tmp1_elvis_lhs;
996
+ }
997
+ var exec = tmp_0;
998
+ var args = new DeleteKeyArgs(keyInfo);
999
+ return yield* command.f2s(args, $completion);
1000
+ }
1001
+ *z4s(keyInfo, identifierMethod, trustedCerts, verifyX509CertificateChain, $completion) {
1002
+ var tmp0_elvis_lhs = this.v5m_1;
1003
+ var tmp;
1004
+ if (tmp0_elvis_lhs == null) {
1005
+ return asErrorResult(Companion_instance_1.v2o(VOID, VOID, 'ResolvePublicKeyCommand', 'Command not available'));
1006
+ } else {
1007
+ tmp = tmp0_elvis_lhs;
1008
+ }
1009
+ var command = tmp;
1010
+ var tmp1_elvis_lhs = this.f5m_1;
1011
+ var tmp_0;
1012
+ if (tmp1_elvis_lhs == null) {
1013
+ return asErrorResult(Companion_instance_1.p2o(VOID, VOID, 'SessionExecution not available'));
1014
+ } else {
1015
+ tmp_0 = tmp1_elvis_lhs;
1016
+ }
1017
+ var exec = tmp_0;
1018
+ var args = new ResolvePublicKeyArgs(keyInfo, identifierMethod, trustedCerts, verifyX509CertificateChain);
1019
+ return yield* command.f2s(args, $completion);
1020
+ }
1021
+ get settings() {
1022
+ return this.m4t();
1023
+ }
1024
+ }
1025
+ class Companion_0 {
1026
+ create(keyResolvers) {
1027
+ return new MetroFactory_0(keyResolvers);
1028
+ }
1029
+ newInstance(keyResolvers) {
1030
+ return new KeyResolverRegistryImpl(keyResolvers);
1031
+ }
1032
+ }
1033
+ class BindsMirror_0 {}
1034
+ class MetroFactory_0 {
1035
+ constructor(keyResolvers) {
1036
+ this.e5n_1 = keyResolvers;
1037
+ }
1038
+ s1i() {
1039
+ return Companion_instance_3.newInstance(this.e5n_1.s1i());
1040
+ }
1041
+ mirrorFunction(keyResolvers) {
1042
+ // Inline function 'kotlin.error' call
1043
+ var message = 'Never called';
1044
+ throw IllegalStateException.o(toString(message));
1045
+ }
1046
+ }
1047
+ class MetroContributionToSessionScope_0 {}
1048
+ function bindsAsKeyResolverRegistry(instance) {
1049
+ // Inline function 'kotlin.error' call
1050
+ var message = 'Never called';
1051
+ throw IllegalStateException.o(toString(message));
1052
+ }
1053
+ class sam$kotlin_Comparator$0 {
1054
+ constructor(function_0) {
1055
+ this.f5n_1 = function_0;
1056
+ }
1057
+ ji(a, b) {
1058
+ return this.f5n_1(a, b);
1059
+ }
1060
+ compare(a, b) {
1061
+ return this.ji(a, b);
1062
+ }
1063
+ g5() {
1064
+ return this.f5n_1;
1065
+ }
1066
+ equals(other) {
1067
+ var tmp;
1068
+ if (!(other == null) ? isInterface(other, Comparator) : false) {
1069
+ var tmp_0;
1070
+ if (!(other == null) ? isInterface(other, FunctionAdapter) : false) {
1071
+ tmp_0 = equals(this.g5(), other.g5());
1072
+ } else {
1073
+ tmp_0 = false;
1074
+ }
1075
+ tmp = tmp_0;
1076
+ } else {
1077
+ tmp = false;
1078
+ }
1079
+ return tmp;
1080
+ }
1081
+ hashCode() {
1082
+ return hashCode(this.g5());
1083
+ }
1084
+ }
1085
+ class KeyResolverRegistryImpl {
1086
+ constructor(keyResolvers) {
1087
+ var tmp = this;
1088
+ // Inline function 'kotlin.collections.sortedBy' call
1089
+ // Inline function 'kotlin.comparisons.compareBy' call
1090
+ var tmp_0 = KeyResolverRegistryImpl$keyResolversById$lambda;
1091
+ var tmp$ret$1 = new sam$kotlin_Comparator$0(tmp_0);
1092
+ // Inline function 'kotlin.collections.associateBy' call
1093
+ var this_0 = sortedWith(keyResolvers, tmp$ret$1);
1094
+ var capacity = coerceAtLeast(mapCapacity(collectionSizeOrDefault(this_0, 10)), 16);
1095
+ // Inline function 'kotlin.collections.associateByTo' call
1096
+ var destination = LinkedHashMap.hc(capacity);
1097
+ var _iterator__ex2g4s = this_0.j1();
1098
+ while (_iterator__ex2g4s.k1()) {
1099
+ var element = _iterator__ex2g4s.l1();
1100
+ var tmp$ret$4 = element.getId();
1101
+ destination.p4(tmp$ret$4, element);
1102
+ }
1103
+ tmp.g5n_1 = toMutableMap(destination);
1104
+ this.h5n_1 = null;
1105
+ }
1106
+ defaultResolverId() {
1107
+ // Inline function 'kotlin.collections.isNotEmpty' call
1108
+ // Inline function 'kotlin.require' call
1109
+ if (!!this.g5n_1.h1()) {
1110
+ var message = 'At least one key resolver is required';
1111
+ throw IllegalArgumentException.y1(toString(message));
1112
+ }
1113
+ var tmp0_elvis_lhs = this.h5n_1;
1114
+ return tmp0_elvis_lhs == null ? first(this.g5n_1.n4()).getId() : tmp0_elvis_lhs;
1115
+ }
1116
+ getResolverIds() {
1117
+ // Inline function 'kotlin.collections.toTypedArray' call
1118
+ var this_0 = this.g5n_1.m4();
1119
+ return copyToArray(this_0);
1120
+ }
1121
+ d4t(id) {
1122
+ var tmp0_elvis_lhs = this.g5n_1.l4(id);
1123
+ var tmp;
1124
+ if (tmp0_elvis_lhs == null) {
1125
+ throw PKIException.s44('Invalid Resolver id ' + id + '. Valid ids are: ' + joinToString(this.getResolverIds(), ','));
1126
+ } else {
1127
+ tmp = tmp0_elvis_lhs;
1128
+ }
1129
+ return tmp;
1130
+ }
1131
+ e4t(identifierMethod, keyType, resolverId) {
1132
+ // Inline function 'kotlin.collections.isNotEmpty' call
1133
+ // Inline function 'kotlin.require' call
1134
+ if (!!this.g5n_1.h1()) {
1135
+ var message = 'At least one resolver is required';
1136
+ throw IllegalArgumentException.y1(toString(message));
1137
+ }
1138
+ var tmp0 = this.g5n_1.n4();
1139
+ var tmp$ret$3;
1140
+ $l$block_4: {
1141
+ // Inline function 'kotlin.collections.firstOrNull' call
1142
+ var _iterator__ex2g4s = tmp0.j1();
1143
+ while (_iterator__ex2g4s.k1()) {
1144
+ var element = _iterator__ex2g4s.l1();
1145
+ var tmp$ret$4;
1146
+ $l$block_3: {
1147
+ if (!(resolverId == null) && element.getId() === resolverId) {
1148
+ tmp$ret$4 = true;
1149
+ break $l$block_3;
1150
+ }
1151
+ if (!(keyType == null)) {
1152
+ if (!(identifierMethod == null)) {
1153
+ tmp$ret$4 = contains(element.getSupportedKeyTypes(identifierMethod), keyType);
1154
+ break $l$block_3;
1155
+ } else if (contains(element.allSupportedKeyTypes(), keyType)) {
1156
+ tmp$ret$4 = true;
1157
+ break $l$block_3;
1158
+ }
1159
+ }
1160
+ if (!(identifierMethod == null) && contains(element.allSupportedIdentifierMethods(), identifierMethod)) {
1161
+ tmp$ret$4 = true;
1162
+ break $l$block_3;
1163
+ }
1164
+ if (identifierMethod == null && keyType == null && resolverId == null) {
1165
+ tmp$ret$4 = element.getId() === this.defaultResolverId();
1166
+ break $l$block_3;
1167
+ }
1168
+ tmp$ret$4 = false;
1169
+ }
1170
+ if (tmp$ret$4) {
1171
+ tmp$ret$3 = element;
1172
+ break $l$block_4;
1173
+ }
1174
+ }
1175
+ tmp$ret$3 = null;
1176
+ }
1177
+ var resolver = tmp$ret$3;
1178
+ var tmp;
1179
+ if (resolver == null) {
1180
+ throw IllegalArgumentException.y1('Could not find resolver for identifier method ' + toString_0(identifierMethod) + ' and key type ' + toString_0(keyType));
1181
+ } else {
1182
+ tmp = resolver;
1183
+ }
1184
+ return tmp;
1185
+ }
1186
+ f4t(resolver, makeDefaultResolver) {
1187
+ var tmp0 = this.g5n_1;
1188
+ // Inline function 'kotlin.collections.set' call
1189
+ var key = resolver.getId();
1190
+ tmp0.p4(key, resolver);
1191
+ if (makeDefaultResolver === true) {
1192
+ this.h5n_1 = resolver.getId();
1193
+ }
1194
+ }
1195
+ }
1196
+ class Companion_1 {
1197
+ create(contextConfig, kmsProviderManager, execution) {
1198
+ return new MetroFactory_1(contextConfig, kmsProviderManager, execution);
1199
+ }
1200
+ newInstance(contextConfig, kmsProviderManager, execution) {
1201
+ return new KmsProviderRegistryImpl(contextConfig, kmsProviderManager, execution);
1202
+ }
1203
+ }
1204
+ class BindsMirror_1 {}
1205
+ class MetroFactory_1 {
1206
+ constructor(contextConfig, kmsProviderManager, execution) {
1207
+ this.n5n_1 = contextConfig;
1208
+ this.o5n_1 = kmsProviderManager;
1209
+ this.p5n_1 = execution;
1210
+ }
1211
+ s1i() {
1212
+ return Companion_instance_4.newInstance(this.n5n_1.s1i(), this.o5n_1.s1i(), this.p5n_1.s1i());
1213
+ }
1214
+ mirrorFunction(contextConfig, kmsProviderManager, execution) {
1215
+ // Inline function 'kotlin.error' call
1216
+ var message = 'Never called';
1217
+ throw IllegalStateException.o(toString(message));
1218
+ }
1219
+ }
1220
+ class MetroContributionToSessionScope_1 {}
1221
+ function bindsAsKmsProviderRegistry(instance) {
1222
+ // Inline function 'kotlin.error' call
1223
+ var message = 'Never called';
1224
+ throw IllegalStateException.o(toString(message));
1225
+ }
1226
+ class sam$kotlin_Comparator$0_0 {
1227
+ constructor(function_0) {
1228
+ this.q5n_1 = function_0;
1229
+ }
1230
+ ji(a, b) {
1231
+ return this.q5n_1(a, b);
1232
+ }
1233
+ compare(a, b) {
1234
+ return this.ji(a, b);
1235
+ }
1236
+ g5() {
1237
+ return this.q5n_1;
1238
+ }
1239
+ equals(other) {
1240
+ var tmp;
1241
+ if (!(other == null) ? isInterface(other, Comparator) : false) {
1242
+ var tmp_0;
1243
+ if (!(other == null) ? isInterface(other, FunctionAdapter) : false) {
1244
+ tmp_0 = equals(this.g5(), other.g5());
1245
+ } else {
1246
+ tmp_0 = false;
1247
+ }
1248
+ tmp = tmp_0;
1249
+ } else {
1250
+ tmp = false;
1251
+ }
1252
+ return tmp;
1253
+ }
1254
+ hashCode() {
1255
+ return hashCode(this.g5());
1256
+ }
1257
+ }
1258
+ class KmsProviderRegistryImpl {
1259
+ constructor(contextConfig, kmsProviderManager, execution) {
1260
+ this.i5n_1 = contextConfig;
1261
+ this.j5n_1 = kmsProviderManager;
1262
+ this.k5n_1 = execution;
1263
+ var tmp = this;
1264
+ tmp.l5n_1 = lazy(KmsProviderRegistryImpl$kmsProvidersById$delegate$lambda(this));
1265
+ this.m5n_1 = null;
1266
+ }
1267
+ defaultProviderId() {
1268
+ // Inline function 'kotlin.collections.isNotEmpty' call
1269
+ // Inline function 'kotlin.require' call
1270
+ if (!!_get_kmsProvidersById__3ih65k(this).h1()) {
1271
+ var message = 'At least one KMS provider is required';
1272
+ throw IllegalArgumentException.y1(toString(message));
1273
+ }
1274
+ var tmp0_elvis_lhs = this.m5n_1;
1275
+ return tmp0_elvis_lhs == null ? first(_get_kmsProvidersById__3ih65k(this).n4()).id : tmp0_elvis_lhs;
1276
+ }
1277
+ getProviderIds() {
1278
+ // Inline function 'kotlin.collections.toTypedArray' call
1279
+ var this_0 = _get_kmsProvidersById__3ih65k(this).m4();
1280
+ return copyToArray(this_0);
1281
+ }
1282
+ s4x(id) {
1283
+ var tmp0_elvis_lhs = _get_kmsProvidersById__3ih65k(this).l4(id);
1284
+ var tmp;
1285
+ if (tmp0_elvis_lhs == null) {
1286
+ throw PKIException.s44('Invalid KMS id ' + id + ' provider. Valid ids are: ' + joinToString(this.getProviderIds(), ','));
1287
+ } else {
1288
+ tmp = tmp0_elvis_lhs;
1289
+ }
1290
+ return tmp;
1291
+ }
1292
+ t4x(providerId, alg) {
1293
+ if (providerId == null && !(alg == null)) {
1294
+ return this.getKmsBySignatureAlgorithm(alg);
1295
+ }
1296
+ return this.getProviderById(providerId == null ? this.defaultProviderId() : providerId);
1297
+ }
1298
+ getKmsBySignatureAlgorithm(signatureAlgorithm) {
1299
+ var tmp0 = _get_kmsProvidersById__3ih65k(this).n4();
1300
+ var tmp$ret$0;
1301
+ $l$block: {
1302
+ // Inline function 'kotlin.collections.firstOrNull' call
1303
+ var _iterator__ex2g4s = tmp0.j1();
1304
+ while (_iterator__ex2g4s.k1()) {
1305
+ var element = _iterator__ex2g4s.l1();
1306
+ if (contains(element.supportedSignatureAlgorithms(), signatureAlgorithm)) {
1307
+ tmp$ret$0 = element;
1308
+ break $l$block;
1309
+ }
1310
+ }
1311
+ tmp$ret$0 = null;
1312
+ }
1313
+ var tmp0_elvis_lhs = tmp$ret$0;
1314
+ var tmp;
1315
+ if (tmp0_elvis_lhs == null) {
1316
+ throw PKIException.s44('No KMS found for signature algorithm ' + toString(signatureAlgorithm));
1317
+ } else {
1318
+ tmp = tmp0_elvis_lhs;
1319
+ }
1320
+ return tmp;
1321
+ }
1322
+ u4x(provider, makeDefaultKms) {
1323
+ var tmp0 = _get_kmsProvidersById__3ih65k(this);
1324
+ // Inline function 'kotlin.collections.set' call
1325
+ var key = provider.id;
1326
+ tmp0.p4(key, provider);
1327
+ if (makeDefaultKms === true) {
1328
+ this.m5n_1 = provider.id;
1329
+ }
1330
+ }
1331
+ }
1332
+ class Companion_2 {
1333
+ create(delegateFactory) {
1334
+ return Companion_getInstance_1().q1i(new Impl(delegateFactory));
1335
+ }
1336
+ }
1337
+ class MemoryKeyStoreServiceFactory {}
1338
+ class Impl {
1339
+ constructor(delegateFactory) {
1340
+ this.u5n_1 = delegateFactory;
1341
+ }
1342
+ create(config, backingStorage, partitionKey) {
1343
+ return this.u5n_1.v5n(config, backingStorage, partitionKey);
1344
+ }
1345
+ }
1346
+ class Companion_3 {
1347
+ w5n(config, backingStorage, partitionKey) {
1348
+ return new MemoryKeyStoreService(config, backingStorage, partitionKey);
1349
+ }
1350
+ }
1351
+ class MemoryKeyStoreService {
1352
+ constructor(config, backingStorage, partitionKey) {
1353
+ backingStorage = backingStorage === VOID ? null : backingStorage;
1354
+ partitionKey = partitionKey === VOID ? null : partitionKey;
1355
+ this.x5n_1 = config;
1356
+ this.y5n_1 = backingStorage;
1357
+ this.z5n_1 = partitionKey;
1358
+ this.a5o_1 = this.x5n_1.id;
1359
+ this.b5o_1 = this.x5n_1.keyStoreType;
1360
+ var tmp = this;
1361
+ // Inline function 'kotlin.collections.toTypedArray' call
1362
+ var this_0 = Companion_instance.v2z();
1363
+ tmp.c5o_1 = copyToArray(this_0);
1364
+ var tmp_0 = this;
1365
+ // Inline function 'kotlin.collections.toTypedArray' call
1366
+ var this_1 = Companion_instance_0.v2z();
1367
+ tmp_0.d5o_1 = copyToArray(this_1);
1368
+ var tmp_1 = this;
1369
+ // Inline function 'kotlin.collections.mutableMapOf' call
1370
+ tmp_1.e5o_1 = LinkedHashMap.v5();
1371
+ var tmp_2 = this;
1372
+ // Inline function 'kotlin.collections.mutableMapOf' call
1373
+ tmp_2.f5o_1 = LinkedHashMap.v5();
1374
+ var tmp_3 = this;
1375
+ // Inline function 'kotlin.collections.mutableMapOf' call
1376
+ tmp_3.g5o_1 = LinkedHashMap.v5();
1377
+ // Inline function 'kotlin.require' call
1378
+ if (!(this.x5n_1.keyStoreType === PredefinedKeyStoreTypes_MEMORY_getInstance().c56_1)) {
1379
+ var message = 'A memory keystore needs to be of config type MEMORY';
1380
+ throw IllegalArgumentException.y1(toString(message));
1381
+ }
1382
+ }
1383
+ n2c() {
1384
+ return this.a5o_1;
1385
+ }
1386
+ i4u() {
1387
+ return this.b5o_1;
1388
+ }
1389
+ o4u() {
1390
+ return this.c5o_1;
1391
+ }
1392
+ p4u() {
1393
+ return this.d5o_1;
1394
+ }
1395
+ m4t() {
1396
+ return null;
1397
+ }
1398
+ exposesPrivateKeysForSigning() {
1399
+ return true;
1400
+ }
1401
+ keyVisibility() {
1402
+ return Companion_getInstance_0().v48(this.x5n_1.keyVisibility);
1403
+ }
1404
+ *n4t($completion) {
1405
+ // Inline function 'kotlin.collections.map' call
1406
+ var this_0 = _get_keys__d97k5z(this);
1407
+ // Inline function 'kotlin.collections.mapTo' call
1408
+ var destination = ArrayList.j2(this_0.m2());
1409
+ // Inline function 'kotlin.collections.iterator' call
1410
+ var _iterator__ex2g4s = this_0.x2().j1();
1411
+ while (_iterator__ex2g4s.k1()) {
1412
+ var item = _iterator__ex2g4s.l1();
1413
+ var tmp$ret$3 = toKeyReference(item.h4());
1414
+ destination.k2(tmp$ret$3);
1415
+ }
1416
+ // Inline function 'kotlin.collections.toTypedArray' call
1417
+ return copyToArray(destination);
1418
+ }
1419
+ listKeys() {
1420
+ return promisify(($completion) => this.n4t($completion));
1421
+ }
1422
+ *h4t($completion) {
1423
+ return this.listKeys === protoOf(MemoryKeyStoreService).listKeys ? (yield* this.n4t($completion)) : (yield* await_0(this.listKeys(), $completion));
1424
+ }
1425
+ *u4t(keyInfo, $completion) {
1426
+ var managedKeyInfo = keyInfo;
1427
+ if (managedKeyInfo.j43() === null) {
1428
+ // Inline function 'kotlin.collections.find' call
1429
+ var tmp0 = _get_keys__d97k5z(this).n4();
1430
+ var tmp$ret$1;
1431
+ $l$block: {
1432
+ // Inline function 'kotlin.collections.firstOrNull' call
1433
+ var _iterator__ex2g4s = tmp0.j1();
1434
+ while (_iterator__ex2g4s.k1()) {
1435
+ var element = _iterator__ex2g4s.l1();
1436
+ var tmp;
1437
+ if (!(keyInfo.g43() === null) && element.g43() == keyInfo.g43()) {
1438
+ tmp = true;
1439
+ } else {
1440
+ var tmp_0;
1441
+ var tmp0_safe_receiver = keyInfo.key;
1442
+ if ((tmp0_safe_receiver == null ? null : tmp0_safe_receiver.getXAsString()) == element.key.getXAsString()) {
1443
+ var tmp1_safe_receiver = keyInfo.key;
1444
+ tmp_0 = (tmp1_safe_receiver == null ? null : tmp1_safe_receiver.getYAsString()) == element.key.getYAsString();
1445
+ } else {
1446
+ tmp_0 = false;
1447
+ }
1448
+ tmp = tmp_0;
1449
+ }
1450
+ if (tmp) {
1451
+ tmp$ret$1 = element;
1452
+ break $l$block;
1453
+ }
1454
+ }
1455
+ tmp$ret$1 = null;
1456
+ }
1457
+ var matchingKey = tmp$ret$1;
1458
+ if (!(matchingKey == null)) {
1459
+ managedKeyInfo = matchingKey;
1460
+ }
1461
+ }
1462
+ // Inline function 'kotlin.require' call
1463
+ if (!(!(managedKeyInfo.key === null) || !(managedKeyInfo.g43() === null) || !(managedKeyInfo.j43() === null))) {
1464
+ var message = 'Either a kid needs to be provided or a key needs to be passed in';
1465
+ throw IllegalArgumentException.y1(toString(message));
1466
+ }
1467
+ var tmp0_elvis_lhs = managedKeyInfo.keyVisibility;
1468
+ var visibility = tmp0_elvis_lhs == null ? this.x5n_1.keyVisibility : tmp0_elvis_lhs;
1469
+ if (this.x5n_1.keyVisibility === KeyVisibility_PUBLIC_getInstance().y48_1 && visibility === KeyVisibility_PRIVATE_getInstance()) {
1470
+ throw PKIException.s44('Cannot get private key info for a public key store');
1471
+ }
1472
+ var tmp1_elvis_lhs = managedKeyInfo.g43();
1473
+ var tmp_1;
1474
+ if (tmp1_elvis_lhs == null) {
1475
+ var tmp2_safe_receiver = managedKeyInfo.key;
1476
+ tmp_1 = tmp2_safe_receiver == null ? null : tmp2_safe_receiver.kid;
1477
+ } else {
1478
+ tmp_1 = tmp1_elvis_lhs;
1479
+ }
1480
+ var kid = tmp_1;
1481
+ var alias = managedKeyInfo.j43();
1482
+ // Inline function 'kotlin.require' call
1483
+ if (!!(alias === null)) {
1484
+ var message_0 = 'Need to provide a alias';
1485
+ throw IllegalArgumentException.y1(toString(message_0));
1486
+ }
1487
+ var keyInfoResult = _get_keys__d97k5z(this).l4(alias);
1488
+ // Inline function 'kotlin.require' call
1489
+ if (!!(keyInfoResult === null)) {
1490
+ var message_1 = 'Could not find key for alias ' + alias + ', kid ' + toString_0(kid);
1491
+ throw IllegalArgumentException.y1(toString(message_1));
1492
+ }
1493
+ var tmp_2;
1494
+ if (visibility === KeyVisibility_PUBLIC_getInstance()) {
1495
+ tmp_2 = new ManagedKeyInfo(alias, keyInfoResult.i43(), keyInfoResult.toResolvedPublicKeyInfo());
1496
+ } else {
1497
+ if (!(keyInfoResult.keyVisibility === KeyVisibility_PRIVATE_getInstance())) {
1498
+ throw IllegalArgumentException.y1('Key with alias ' + alias + ' is not a private key, whilst a private key is requested');
1499
+ }
1500
+ tmp_2 = keyInfoResult;
1501
+ }
1502
+ return tmp_2;
1503
+ }
1504
+ getKey(keyInfo) {
1505
+ return promisify(($completion) => this.u4t(keyInfo, $completion));
1506
+ }
1507
+ *j4t(keyInfo, $completion) {
1508
+ return this.getKey === protoOf(MemoryKeyStoreService).getKey ? (yield* this.u4t(keyInfo, $completion)) : (yield* await_0(this.getKey(keyInfo), $completion));
1509
+ }
1510
+ *w4t(keyInfo, $completion) {
1511
+ var tmp;
1512
+ try {
1513
+ var storedKeyInfo = yield* this.j4t(keyInfo, $completion);
1514
+ tmp = !(_get_keys__d97k5z(this).q4(storedKeyInfo.j43()) == null);
1515
+ } catch ($p) {
1516
+ var tmp_0;
1517
+ if ($p instanceof NotFoundException) {
1518
+ var e = $p;
1519
+ tmp_0 = false;
1520
+ } else {
1521
+ if ($p instanceof IllegalArgumentException) {
1522
+ var e_0 = $p;
1523
+ tmp_0 = false;
1524
+ } else {
1525
+ throw $p;
1526
+ }
1527
+ }
1528
+ tmp = tmp_0;
1529
+ }
1530
+ return tmp;
1531
+ }
1532
+ deleteKey(keyInfo) {
1533
+ return promisify(($completion) => this.w4t(keyInfo, $completion));
1534
+ }
1535
+ *l4t(keyInfo, $completion) {
1536
+ return this.deleteKey === protoOf(MemoryKeyStoreService).deleteKey ? (yield* this.w4t(keyInfo, $completion)) : (yield* await_0(this.deleteKey(keyInfo), $completion));
1537
+ }
1538
+ *v4t(keyInfo, providerId, alias, certChain, $completion) {
1539
+ var tmp0_elvis_lhs = keyInfo.keyVisibility;
1540
+ var visibility = tmp0_elvis_lhs == null ? this.x5n_1.keyVisibility : tmp0_elvis_lhs;
1541
+ if (this.x5n_1.keyVisibility === KeyVisibility_PUBLIC_getInstance().y48_1 && visibility === KeyVisibility_PRIVATE_getInstance()) {
1542
+ throw PKIException.s44('Cannot get private key info for a public key store');
1543
+ }
1544
+ var managedKeyInfo = new ManagedKeyInfo(alias, providerId, keyInfo);
1545
+ if (!this.x5n_1.overwriteAlias) {
1546
+ // Inline function 'kotlin.check' call
1547
+ if (!!_get_keys__d97k5z(this).j4(alias)) {
1548
+ var message = 'Cannot overwrite key alias ' + alias + ', as alias already exists in keystore and overwriting is not enabled';
1549
+ throw IllegalStateException.o(toString(message));
1550
+ }
1551
+ }
1552
+ // Inline function 'kotlin.collections.set' call
1553
+ _get_keys__d97k5z(this).p4(alias, managedKeyInfo);
1554
+ return managedKeyInfo;
1555
+ }
1556
+ storeKey(keyInfo, providerId, alias, certChain) {
1557
+ return promisify(($completion) => this.c4t(keyInfo, providerId, alias, certChain, $completion));
1558
+ }
1559
+ *k4t(keyInfo, providerId, alias, certChain, $completion) {
1560
+ return this.storeKey === protoOf(MemoryKeyStoreService).storeKey ? (yield* this.c4t(keyInfo, providerId, alias, certChain, $completion)) : (yield* await_0(this.storeKey(keyInfo, providerId, alias, certChain), $completion));
1561
+ }
1562
+ *n4q(alias, certificates, keyInfo, $completion) {
1563
+ if (!this.x5n_1.overwriteAlias) {
1564
+ // Inline function 'kotlin.check' call
1565
+ if (!!_get_certificateChains__l5yeco(this).j4(alias)) {
1566
+ var message = 'Cannot overwrite certificate chain alias ' + alias + ', as alias already exists in keystore and overwriting is not enabled';
1567
+ throw IllegalStateException.o(toString(message));
1568
+ }
1569
+ }
1570
+ if (certificates.length === 1) {
1571
+ var tmp0 = _get_certificates__eymdpt(this);
1572
+ // Inline function 'kotlin.collections.set' call
1573
+ var value = certificates[0];
1574
+ tmp0.p4(alias, value);
1575
+ }
1576
+ // Inline function 'kotlin.collections.set' call
1577
+ _get_certificateChains__l5yeco(this).p4(alias, certificates);
1578
+ return Unit_instance;
1579
+ }
1580
+ storeCertificateChain(alias, certificates, keyInfo) {
1581
+ return promisify(($completion) => this.o4q(alias, certificates, keyInfo, $completion));
1582
+ }
1583
+ *p4q(alias, certificates, keyInfo, $completion) {
1584
+ if (this.storeCertificateChain === protoOf(MemoryKeyStoreService).storeCertificateChain)
1585
+ yield* this.o4q(alias, certificates, keyInfo, $completion);
1586
+ else
1587
+ yield* await_0(this.storeCertificateChain(alias, certificates, keyInfo), $completion);
1588
+ return Unit_instance;
1589
+ }
1590
+ *q4q($completion) {
1591
+ // Inline function 'kotlin.collections.toTypedArray' call
1592
+ var this_0 = _get_certificateChains__l5yeco(this).m4();
1593
+ return copyToArray(this_0);
1594
+ }
1595
+ listCertificateChainAliases() {
1596
+ return promisify(($completion) => this.q4q($completion));
1597
+ }
1598
+ *r4q($completion) {
1599
+ return this.listCertificateChainAliases === protoOf(MemoryKeyStoreService).listCertificateChainAliases ? (yield* this.q4q($completion)) : (yield* await_0(this.listCertificateChainAliases(), $completion));
1600
+ }
1601
+ *s4q(alias, $completion) {
1602
+ var tmp0_elvis_lhs = _get_certificateChains__l5yeco(this).l4(alias);
1603
+ var tmp;
1604
+ if (tmp0_elvis_lhs == null) {
1605
+ var tmp1_safe_receiver = _get_certificates__eymdpt(this).l4(alias);
1606
+ var tmp_0;
1607
+ if (tmp1_safe_receiver == null) {
1608
+ tmp_0 = null;
1609
+ } else {
1610
+ // Inline function 'kotlin.let' call
1611
+ // Inline function 'kotlin.arrayOf' call
1612
+ // Inline function 'kotlin.js.unsafeCast' call
1613
+ // Inline function 'kotlin.js.asDynamic' call
1614
+ tmp_0 = [tmp1_safe_receiver];
1615
+ }
1616
+ tmp = tmp_0;
1617
+ } else {
1618
+ tmp = tmp0_elvis_lhs;
1619
+ }
1620
+ var tmp2_elvis_lhs = tmp;
1621
+ var tmp_1;
1622
+ if (tmp2_elvis_lhs == null) {
1623
+ throw NotFoundException.c2q('Could not find certificate chain for alias ' + alias);
1624
+ } else {
1625
+ tmp_1 = tmp2_elvis_lhs;
1626
+ }
1627
+ return tmp_1;
1628
+ }
1629
+ getCertificateChain(alias) {
1630
+ return promisify(($completion) => this.s4q(alias, $completion));
1631
+ }
1632
+ *t4q(alias, $completion) {
1633
+ return this.getCertificateChain === protoOf(MemoryKeyStoreService).getCertificateChain ? (yield* this.s4q(alias, $completion)) : (yield* await_0(this.getCertificateChain(alias), $completion));
1634
+ }
1635
+ *u4q(alias, $completion) {
1636
+ return !(_get_certificateChains__l5yeco(this).q4(alias) == null);
1637
+ }
1638
+ deleteCertificateChain(alias) {
1639
+ return promisify(($completion) => this.u4q(alias, $completion));
1640
+ }
1641
+ *v4q(alias, $completion) {
1642
+ return this.deleteCertificateChain === protoOf(MemoryKeyStoreService).deleteCertificateChain ? (yield* this.u4q(alias, $completion)) : (yield* await_0(this.deleteCertificateChain(alias), $completion));
1643
+ }
1644
+ *w4q(alias, certificate, $completion) {
1645
+ if (!this.x5n_1.overwriteAlias) {
1646
+ // Inline function 'kotlin.check' call
1647
+ if (!!_get_certificates__eymdpt(this).j4(alias)) {
1648
+ var message = 'Cannot overwrite certificate alias ' + alias + ', as alias already exists in keystore and overwriting is not enabled';
1649
+ throw IllegalStateException.o(toString(message));
1650
+ }
1651
+ }
1652
+ // Inline function 'kotlin.collections.set' call
1653
+ _get_certificates__eymdpt(this).p4(alias, certificate);
1654
+ return Unit_instance;
1655
+ }
1656
+ storeTrustedCertificate(alias, certificate) {
1657
+ return promisify(($completion) => this.w4q(alias, certificate, $completion));
1658
+ }
1659
+ *x4q(alias, certificate, $completion) {
1660
+ if (this.storeTrustedCertificate === protoOf(MemoryKeyStoreService).storeTrustedCertificate)
1661
+ yield* this.w4q(alias, certificate, $completion);
1662
+ else
1663
+ yield* await_0(this.storeTrustedCertificate(alias, certificate), $completion);
1664
+ return Unit_instance;
1665
+ }
1666
+ *y4q($completion) {
1667
+ // Inline function 'kotlin.collections.toTypedArray' call
1668
+ var this_0 = _get_certificates__eymdpt(this).m4();
1669
+ return copyToArray(this_0);
1670
+ }
1671
+ listCertificateAliases() {
1672
+ return promisify(($completion) => this.y4q($completion));
1673
+ }
1674
+ *z4q($completion) {
1675
+ return this.listCertificateAliases === protoOf(MemoryKeyStoreService).listCertificateAliases ? (yield* this.y4q($completion)) : (yield* await_0(this.listCertificateAliases(), $completion));
1676
+ }
1677
+ *a4r(alias, $completion) {
1678
+ var tmp0_elvis_lhs = _get_certificates__eymdpt(this).l4(alias);
1679
+ var tmp;
1680
+ if (tmp0_elvis_lhs == null) {
1681
+ var tmp1_safe_receiver = _get_certificateChains__l5yeco(this).l4(alias);
1682
+ tmp = tmp1_safe_receiver == null ? null : tmp1_safe_receiver[0];
1683
+ } else {
1684
+ tmp = tmp0_elvis_lhs;
1685
+ }
1686
+ var tmp2_elvis_lhs = tmp;
1687
+ var tmp_0;
1688
+ if (tmp2_elvis_lhs == null) {
1689
+ throw NotFoundException.c2q('Could not find certificate for alias ' + alias);
1690
+ } else {
1691
+ tmp_0 = tmp2_elvis_lhs;
1692
+ }
1693
+ return tmp_0;
1694
+ }
1695
+ getCertificate(alias) {
1696
+ return promisify(($completion) => this.a4r(alias, $completion));
1697
+ }
1698
+ *b4r(alias, $completion) {
1699
+ return this.getCertificate === protoOf(MemoryKeyStoreService).getCertificate ? (yield* this.a4r(alias, $completion)) : (yield* await_0(this.getCertificate(alias), $completion));
1700
+ }
1701
+ *c4r(alias, $completion) {
1702
+ return !(_get_certificates__eymdpt(this).q4(alias) == null);
1703
+ }
1704
+ deleteCertificate(alias) {
1705
+ return promisify(($completion) => this.c4r(alias, $completion));
1706
+ }
1707
+ *d4r(alias, $completion) {
1708
+ return this.deleteCertificate === protoOf(MemoryKeyStoreService).deleteCertificate ? (yield* this.c4r(alias, $completion)) : (yield* await_0(this.deleteCertificate(alias), $completion));
1709
+ }
1710
+ l5o(filter, $completion) {
1711
+ return this.o4t(filter, $completion);
1712
+ }
1713
+ get id() {
1714
+ return this.n2c();
1715
+ }
1716
+ get keyStoreType() {
1717
+ return this.i4u();
1718
+ }
1719
+ get keyTypesSupported() {
1720
+ return this.o4u();
1721
+ }
1722
+ get signatureAlgorithmsSupported() {
1723
+ return this.p4u();
1724
+ }
1725
+ get settings() {
1726
+ return this.m4t();
1727
+ }
1728
+ get order() {
1729
+ return this.v2v();
1730
+ }
1731
+ get enabled() {
1732
+ return this.j4u();
1733
+ }
1734
+ }
1735
+ class IX509JSCallback {}
1736
+ class X509VerifyVerifyPlatformCallbackJSPromises {}
1737
+ function *verifyCertificateChain(req, $completion) {
1738
+ var context = req.validateToContext();
1739
+ if (context.isErr) {
1740
+ return context.error;
1741
+ }
1742
+ return yield* await_1(this.verifyCertificateChainUsingPlatformCallback(context.value), $completion);
1743
+ }
1744
+ //endregion
1745
+ var DefaultCallbacks_instance;
1746
+ function DefaultCallbacks_getInstance() {
1747
+ return DefaultCallbacks_instance;
1748
+ }
1749
+ var Companion_instance_2;
1750
+ function Companion_getInstance_2() {
1751
+ return Companion_instance_2;
1752
+ }
1753
+ function *performKeyAgreementDirect($this, privateKeyInfo, publicKeyInfo, algorithm, keyDataLen, $completion) {
1754
+ var tmp0_elvis_lhs = CoseJoseKeyMappingService_instance.toJwkKeyInfo(privateKeyInfo).key;
1755
+ var tmp;
1756
+ if (tmp0_elvis_lhs == null) {
1757
+ throw IllegalArgumentException.y1('Private key info must contain a key');
1758
+ } else {
1759
+ tmp = tmp0_elvis_lhs;
1760
+ }
1761
+ var privateKeyJwk = tmp;
1762
+ var tmp1_elvis_lhs = CoseJoseKeyMappingService_instance.toJwkKeyInfo(publicKeyInfo).key;
1763
+ var tmp_0;
1764
+ if (tmp1_elvis_lhs == null) {
1765
+ throw IllegalArgumentException.y1('Public key info must contain a key');
1766
+ } else {
1767
+ tmp_0 = tmp1_elvis_lhs;
1768
+ }
1769
+ var publicKeyJwk = tmp_0;
1770
+ // Inline function 'kotlin.require' call
1771
+ if (!privateKeyJwk.s4m_1.equals(JwaKeyType_EC_getInstance())) {
1772
+ var message = 'Private key must be an EC key for ECDH key agreement, got: ' + privateKeyJwk.s4m_1.toString();
1773
+ throw IllegalArgumentException.y1(toString(message));
1774
+ }
1775
+ // Inline function 'kotlin.require' call
1776
+ if (!publicKeyJwk.s4m_1.equals(JwaKeyType_EC_getInstance())) {
1777
+ var message_0 = 'Public key must be an EC key for ECDH key agreement, got: ' + publicKeyJwk.s4m_1.toString();
1778
+ throw IllegalArgumentException.y1(toString(message_0));
1779
+ }
1780
+ // Inline function 'kotlin.require' call
1781
+ if (!!(privateKeyJwk.i4m_1 == null)) {
1782
+ var message_1 = "Private key must have 'd' parameter for key agreement";
1783
+ throw IllegalArgumentException.y1(toString(message_1));
1784
+ }
1785
+ // Inline function 'kotlin.require' call
1786
+ if (!(!(publicKeyJwk.v4m_1 == null) && !(publicKeyJwk.a4n_1 == null))) {
1787
+ var message_2 = "Public key must have 'x' and 'y' coordinates for key agreement";
1788
+ throw IllegalArgumentException.y1(toString(message_2));
1789
+ }
1790
+ var tmp2_safe_receiver = privateKeyJwk.h4m_1;
1791
+ var tmp_1;
1792
+ if (tmp2_safe_receiver == null) {
1793
+ tmp_1 = null;
1794
+ } else {
1795
+ // Inline function 'kotlin.let' call
1796
+ tmp_1 = Companion_getInstance().p4i(tmp2_safe_receiver);
1797
+ }
1798
+ var tmp3_elvis_lhs = tmp_1;
1799
+ var tmp_2;
1800
+ if (tmp3_elvis_lhs == null) {
1801
+ var tmp4_safe_receiver = publicKeyJwk.h4m_1;
1802
+ var tmp_3;
1803
+ if (tmp4_safe_receiver == null) {
1804
+ tmp_3 = null;
1805
+ } else {
1806
+ // Inline function 'kotlin.let' call
1807
+ tmp_3 = Companion_getInstance().p4i(tmp4_safe_receiver);
1808
+ }
1809
+ tmp_2 = tmp_3;
1810
+ } else {
1811
+ tmp_2 = tmp3_elvis_lhs;
1812
+ }
1813
+ var tmp5_elvis_lhs = tmp_2;
1814
+ var curve = tmp5_elvis_lhs == null ? P_256_getInstance() : tmp5_elvis_lhs;
1815
+ return yield* EcdhUtils_instance.e4r(privateKeyJwk, publicKeyJwk, curve, $completion);
1816
+ }
1817
+ var Companion_instance_3;
1818
+ function Companion_getInstance_3() {
1819
+ return Companion_instance_3;
1820
+ }
1821
+ function KeyResolverRegistryImpl$keyResolversById$lambda(a, b) {
1822
+ // Inline function 'kotlin.comparisons.compareValuesBy' call
1823
+ var tmp = a.getId();
1824
+ var tmp$ret$2 = b.getId();
1825
+ return compareValues(tmp, tmp$ret$2);
1826
+ }
1827
+ var Companion_instance_4;
1828
+ function Companion_getInstance_4() {
1829
+ return Companion_instance_4;
1830
+ }
1831
+ function _get_kmsProvidersById__3ih65k($this) {
1832
+ var tmp0 = $this.l5n_1;
1833
+ var tmp = KProperty1;
1834
+ // Inline function 'kotlin.getValue' call
1835
+ getPropertyCallableRef('kmsProvidersById', 1, tmp, KmsProviderRegistryImpl$_get_kmsProvidersById_$ref_i56lok(), null);
1836
+ return tmp0.h4();
1837
+ }
1838
+ function KmsProviderRegistryImpl$kmsProvidersById$delegate$lambda$lambda(a, b) {
1839
+ // Inline function 'kotlin.comparisons.compareValuesBy' call
1840
+ var tmp = a.id;
1841
+ var tmp$ret$2 = b.id;
1842
+ return compareValues(tmp, tmp$ret$2);
1843
+ }
1844
+ function KmsProviderRegistryImpl$kmsProvidersById$delegate$lambda(this$0) {
1845
+ return () => {
1846
+ // Inline function 'kotlin.collections.sortedBy' call
1847
+ var this_0 = this$0.j5n_1.t5n(this$0.i5n_1, this$0.k5n_1);
1848
+ // Inline function 'kotlin.comparisons.compareBy' call
1849
+ var tmp = KmsProviderRegistryImpl$kmsProvidersById$delegate$lambda$lambda;
1850
+ var tmp$ret$1 = new sam$kotlin_Comparator$0_0(tmp);
1851
+ // Inline function 'kotlin.collections.associateBy' call
1852
+ var this_1 = sortedWith(this_0, tmp$ret$1);
1853
+ var capacity = coerceAtLeast(mapCapacity(collectionSizeOrDefault(this_1, 10)), 16);
1854
+ // Inline function 'kotlin.collections.associateByTo' call
1855
+ var destination = LinkedHashMap.hc(capacity);
1856
+ var _iterator__ex2g4s = this_1.j1();
1857
+ while (_iterator__ex2g4s.k1()) {
1858
+ var element = _iterator__ex2g4s.l1();
1859
+ var tmp$ret$4 = element.id;
1860
+ destination.p4(tmp$ret$4, element);
1861
+ }
1862
+ return toMutableMap(destination);
1863
+ };
1864
+ }
1865
+ function KmsProviderRegistryImpl$_get_kmsProvidersById_$ref_i56lok() {
1866
+ return (p0) => _get_kmsProvidersById__3ih65k(p0);
1867
+ }
1868
+ var Companion_instance_5;
1869
+ function Companion_getInstance_5() {
1870
+ return Companion_instance_5;
1871
+ }
1872
+ var Companion_instance_6;
1873
+ function Companion_getInstance_6() {
1874
+ return Companion_instance_6;
1875
+ }
1876
+ function _get_partition__kyj23d($this) {
1877
+ var tmp0_safe_receiver = $this.y5n_1;
1878
+ var tmp;
1879
+ if (tmp0_safe_receiver == null) {
1880
+ tmp = null;
1881
+ } else {
1882
+ // Inline function 'kotlin.let' call
1883
+ var tmp0_safe_receiver_0 = $this.z5n_1;
1884
+ var tmp_0;
1885
+ if (tmp0_safe_receiver_0 == null) {
1886
+ tmp_0 = null;
1887
+ } else {
1888
+ // Inline function 'kotlin.let' call
1889
+ tmp_0 = tmp0_safe_receiver.h5o(tmp0_safe_receiver_0);
1890
+ }
1891
+ tmp = tmp_0;
1892
+ }
1893
+ return tmp;
1894
+ }
1895
+ function _get_keys__d97k5z($this) {
1896
+ var tmp0_safe_receiver = _get_partition__kyj23d($this);
1897
+ var tmp1_elvis_lhs = tmp0_safe_receiver == null ? null : tmp0_safe_receiver.i5o_1;
1898
+ return tmp1_elvis_lhs == null ? $this.e5o_1 : tmp1_elvis_lhs;
1899
+ }
1900
+ function _get_certificateChains__l5yeco($this) {
1901
+ var tmp0_safe_receiver = _get_partition__kyj23d($this);
1902
+ var tmp1_elvis_lhs = tmp0_safe_receiver == null ? null : tmp0_safe_receiver.j5o_1;
1903
+ return tmp1_elvis_lhs == null ? $this.f5o_1 : tmp1_elvis_lhs;
1904
+ }
1905
+ function _get_certificates__eymdpt($this) {
1906
+ var tmp0_safe_receiver = _get_partition__kyj23d($this);
1907
+ var tmp1_elvis_lhs = tmp0_safe_receiver == null ? null : tmp0_safe_receiver.k5o_1;
1908
+ return tmp1_elvis_lhs == null ? $this.g5o_1 : tmp1_elvis_lhs;
1909
+ }
1910
+ //region block: post-declaration
1911
+ initMetadataForObject(DefaultCallbacks, 'DefaultCallbacks');
1912
+ initMetadataForCompanion(Companion);
1913
+ initMetadataForClass(BindsMirror, 'BindsMirror');
1914
+ initMetadataForClass(MetroFactory, 'MetroFactory');
1915
+ initMetadataForInterface(MetroContributionToSessionScope, 'MetroContributionToSessionScope');
1916
+ protoOf(KeyManagerServiceImpl).getProviderById = getProviderById;
1917
+ protoOf(KeyManagerServiceImpl).getProvider = getProvider;
1918
+ protoOf(KeyManagerServiceImpl).registerProvider = registerProvider;
1919
+ protoOf(KeyManagerServiceImpl).getResolverById = getResolverById;
1920
+ protoOf(KeyManagerServiceImpl).getResolverByKeyTypeOrIdentifier = getResolverByKeyTypeOrIdentifier;
1921
+ protoOf(KeyManagerServiceImpl).registerResolver = registerResolver;
1922
+ protoOf(KeyManagerServiceImpl).g4s = getAllCapabilities$default;
1923
+ protoOf(KeyManagerServiceImpl).b4t = resolvePublicKey$default;
1924
+ protoOf(KeyManagerServiceImpl).k4s = generateKey$default;
1925
+ protoOf(KeyManagerServiceImpl).i4s = generateKeyAsync$default;
1926
+ protoOf(KeyManagerServiceImpl).m4r = encrypt$default;
1927
+ protoOf(KeyManagerServiceImpl).o4r = decrypt$default;
1928
+ protoOf(KeyManagerServiceImpl).s4r = performKeyAgreement$default;
1929
+ protoOf(KeyManagerServiceImpl).c4t = storeKey$default;
1930
+ protoOf(KeyManagerServiceImpl).m4s = createRawSignatureResult$default;
1931
+ protoOf(KeyManagerServiceImpl).o4s = encryptResult$default;
1932
+ protoOf(KeyManagerServiceImpl).q4s = decryptResult$default;
1933
+ protoOf(KeyManagerServiceImpl).s4s = performKeyAgreementResult$default;
1934
+ protoOf(KeyManagerServiceImpl).u4s = generateKeyResult$default;
1935
+ protoOf(KeyManagerServiceImpl).w4s = listKeysResult$default;
1936
+ protoOf(KeyManagerServiceImpl).y4s = storeKeyResult$default;
1937
+ protoOf(KeyManagerServiceImpl).a4t = resolvePublicKeyResult$default;
1938
+ protoOf(KeyManagerServiceImpl).exposesPrivateKeysForSigning = exposesPrivateKeysForSigning;
1939
+ initMetadataForClass(KeyManagerServiceImpl, 'KeyManagerServiceImpl', VOID, VOID, [KeyManagerService], [1, 4, 6, 3, 0]);
1940
+ initMetadataForCompanion(Companion_0);
1941
+ initMetadataForClass(BindsMirror_0, 'BindsMirror');
1942
+ initMetadataForClass(MetroFactory_0, 'MetroFactory');
1943
+ initMetadataForInterface(MetroContributionToSessionScope_0, 'MetroContributionToSessionScope');
1944
+ initMetadataForClass(sam$kotlin_Comparator$0, 'sam$kotlin_Comparator$0', VOID, VOID, [Comparator, FunctionAdapter]);
1945
+ protoOf(KeyResolverRegistryImpl).getResolverById = getResolverById;
1946
+ protoOf(KeyResolverRegistryImpl).getResolverByKeyTypeOrIdentifier = getResolverByKeyTypeOrIdentifier;
1947
+ protoOf(KeyResolverRegistryImpl).registerResolver = registerResolver;
1948
+ initMetadataForClass(KeyResolverRegistryImpl, 'KeyResolverRegistryImpl', VOID, VOID, [KeyResolverRegistry]);
1949
+ initMetadataForCompanion(Companion_1);
1950
+ initMetadataForClass(BindsMirror_1, 'BindsMirror');
1951
+ initMetadataForClass(MetroFactory_1, 'MetroFactory');
1952
+ initMetadataForInterface(MetroContributionToSessionScope_1, 'MetroContributionToSessionScope');
1953
+ initMetadataForClass(sam$kotlin_Comparator$0_0, 'sam$kotlin_Comparator$0', VOID, VOID, [Comparator, FunctionAdapter]);
1954
+ protoOf(KmsProviderRegistryImpl).getProviderById = getProviderById;
1955
+ protoOf(KmsProviderRegistryImpl).getProvider = getProvider;
1956
+ protoOf(KmsProviderRegistryImpl).registerProvider = registerProvider;
1957
+ initMetadataForClass(KmsProviderRegistryImpl, 'KmsProviderRegistryImpl', VOID, VOID, [KmsProviderRegistry]);
1958
+ initMetadataForCompanion(Companion_2);
1959
+ initMetadataForInterface(MemoryKeyStoreServiceFactory, 'MemoryKeyStoreServiceFactory');
1960
+ initMetadataForClass(Impl, 'Impl', VOID, VOID, [MemoryKeyStoreServiceFactory]);
1961
+ initMetadataForCompanion(Companion_3);
1962
+ protoOf(MemoryKeyStoreService).c4t = storeKey$default;
1963
+ protoOf(MemoryKeyStoreService).o4q = storeCertificateChain$default;
1964
+ protoOf(MemoryKeyStoreService).v2v = get_order;
1965
+ protoOf(MemoryKeyStoreService).j4u = get_enabled;
1966
+ protoOf(MemoryKeyStoreService).o4t = listKeys;
1967
+ protoOf(MemoryKeyStoreService).listKeysFiltered = listKeysFiltered;
1968
+ initMetadataForClass(MemoryKeyStoreService, 'MemoryKeyStoreService', VOID, VOID, [KeyStore], [0, 1, 4, 3, 2]);
1969
+ initMetadataForInterface(IX509JSCallback, 'IX509JSCallback', VOID, VOID, [X509VerifyPlatformCallback]);
1970
+ initMetadataForInterface(X509VerifyVerifyPlatformCallbackJSPromises, 'X509VerifyVerifyPlatformCallbackJSPromises', VOID, VOID, [X509VerifyService, IX509JSCallback, HasPlatformCallback], [1]);
1971
+ //endregion
1972
+ //region block: init
1973
+ DefaultCallbacks_instance = new DefaultCallbacks();
1974
+ Companion_instance_2 = new Companion();
1975
+ Companion_instance_3 = new Companion_0();
1976
+ Companion_instance_4 = new Companion_1();
1977
+ Companion_instance_5 = new Companion_2();
1978
+ Companion_instance_6 = new Companion_3();
1979
+ //endregion
1980
+ //region block: exports
1981
+ var DefaultCallbacks_0 = {getInstance: DefaultCallbacks_getInstance};
1982
+ KeyManagerServiceImpl.MetroFactory = MetroFactory;
1983
+ defineProp(KeyManagerServiceImpl.MetroFactory, 'Companion', Companion_getInstance_2, VOID, true);
1984
+ var MetroContributionToSessionScope_2 = {};
1985
+ KeyManagerServiceImpl.MetroContributionToSessionScope = MetroContributionToSessionScope_2;
1986
+ KeyManagerServiceImpl.MetroContributionToSessionScope.BindsMirror = BindsMirror;
1987
+ KeyResolverRegistryImpl.MetroFactory = MetroFactory_0;
1988
+ defineProp(KeyResolverRegistryImpl.MetroFactory, 'Companion', Companion_getInstance_3, VOID, true);
1989
+ var MetroContributionToSessionScope_3 = {};
1990
+ KeyResolverRegistryImpl.MetroContributionToSessionScope = MetroContributionToSessionScope_3;
1991
+ KeyResolverRegistryImpl.MetroContributionToSessionScope.BindsMirror = BindsMirror_0;
1992
+ KmsProviderRegistryImpl.MetroFactory = MetroFactory_1;
1993
+ defineProp(KmsProviderRegistryImpl.MetroFactory, 'Companion', Companion_getInstance_4, VOID, true);
1994
+ var MetroContributionToSessionScope_4 = {};
1995
+ KmsProviderRegistryImpl.MetroContributionToSessionScope = MetroContributionToSessionScope_4;
1996
+ KmsProviderRegistryImpl.MetroContributionToSessionScope.BindsMirror = BindsMirror_1;
1997
+ var MemoryKeyStoreServiceFactory_0 = {};
1998
+ MemoryKeyStoreServiceFactory_0.Impl = Impl;
1999
+ defineProp(MemoryKeyStoreServiceFactory_0.Impl, 'Companion', Companion_getInstance_5, VOID, true);
2000
+ export {
2001
+ DefaultCallbacks_0 as DefaultCallbacks,
2002
+ KeyManagerServiceImpl as KeyManagerServiceImpl,
2003
+ KeyResolverRegistryImpl as KeyResolverRegistryImpl,
2004
+ KmsProviderRegistryImpl as KmsProviderRegistryImpl,
2005
+ MemoryKeyStoreServiceFactory_0 as MemoryKeyStoreServiceFactory,
2006
+ };
2007
+ //endregion
2008
+
2009
+ //# sourceMappingURL=idk-lib-crypto-core-impl.mjs.map