wangzhibo
2026-05-09 53418655c061ac26f66058253f39200aced1ab1d
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
"use strict";
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT License.
Object.defineProperty(exports, "__esModule", { value: true });
exports.KnownVersions = exports.KnownKeyEncryptionAlgorithm = exports.KnownJsonWebKeySignatureAlgorithm = exports.KnownJsonWebKeyEncryptionAlgorithm = exports.KnownJsonWebKeyCurveName = exports.KnownDeletionRecoveryLevel = exports.KnownJsonWebKeyOperation = exports.KnownJsonWebKeyType = void 0;
exports.keyCreateParametersSerializer = keyCreateParametersSerializer;
exports.keyAttributesSerializer = keyAttributesSerializer;
exports.keyAttributesDeserializer = keyAttributesDeserializer;
exports.keyAttestationDeserializer = keyAttestationDeserializer;
exports.keyReleasePolicySerializer = keyReleasePolicySerializer;
exports.keyReleasePolicyDeserializer = keyReleasePolicyDeserializer;
exports.keyBundleDeserializer = keyBundleDeserializer;
exports.jsonWebKeySerializer = jsonWebKeySerializer;
exports.jsonWebKeyDeserializer = jsonWebKeyDeserializer;
exports.keyVaultErrorDeserializer = keyVaultErrorDeserializer;
exports._keyVaultErrorErrorDeserializer = _keyVaultErrorErrorDeserializer;
exports.keyImportParametersSerializer = keyImportParametersSerializer;
exports.deletedKeyBundleDeserializer = deletedKeyBundleDeserializer;
exports.keyUpdateParametersSerializer = keyUpdateParametersSerializer;
exports._keyListResultDeserializer = _keyListResultDeserializer;
exports.keyItemArrayDeserializer = keyItemArrayDeserializer;
exports.keyItemDeserializer = keyItemDeserializer;
exports.backupKeyResultDeserializer = backupKeyResultDeserializer;
exports.keyRestoreParametersSerializer = keyRestoreParametersSerializer;
exports.keyOperationsParametersSerializer = keyOperationsParametersSerializer;
exports.keyOperationResultDeserializer = keyOperationResultDeserializer;
exports.keySignParametersSerializer = keySignParametersSerializer;
exports.keyVerifyParametersSerializer = keyVerifyParametersSerializer;
exports.keyVerifyResultDeserializer = keyVerifyResultDeserializer;
exports.keyReleaseParametersSerializer = keyReleaseParametersSerializer;
exports.keyReleaseResultDeserializer = keyReleaseResultDeserializer;
exports._deletedKeyListResultDeserializer = _deletedKeyListResultDeserializer;
exports.deletedKeyItemArrayDeserializer = deletedKeyItemArrayDeserializer;
exports.deletedKeyItemDeserializer = deletedKeyItemDeserializer;
exports.keyRotationPolicySerializer = keyRotationPolicySerializer;
exports.keyRotationPolicyDeserializer = keyRotationPolicyDeserializer;
exports.lifetimeActionsArraySerializer = lifetimeActionsArraySerializer;
exports.lifetimeActionsArrayDeserializer = lifetimeActionsArrayDeserializer;
exports.lifetimeActionsSerializer = lifetimeActionsSerializer;
exports.lifetimeActionsDeserializer = lifetimeActionsDeserializer;
exports.lifetimeActionsTriggerSerializer = lifetimeActionsTriggerSerializer;
exports.lifetimeActionsTriggerDeserializer = lifetimeActionsTriggerDeserializer;
exports.lifetimeActionsTypeSerializer = lifetimeActionsTypeSerializer;
exports.lifetimeActionsTypeDeserializer = lifetimeActionsTypeDeserializer;
exports.keyRotationPolicyAttributesSerializer = keyRotationPolicyAttributesSerializer;
exports.keyRotationPolicyAttributesDeserializer = keyRotationPolicyAttributesDeserializer;
exports.getRandomBytesRequestSerializer = getRandomBytesRequestSerializer;
exports.randomBytesDeserializer = randomBytesDeserializer;
const core_util_1 = require("@azure/core-util");
function keyCreateParametersSerializer(item) {
    return {
        kty: item["kty"],
        key_size: item["keySize"],
        public_exponent: item["publicExponent"],
        key_ops: !item["keyOps"]
            ? item["keyOps"]
            : item["keyOps"].map((p) => {
                return p;
            }),
        attributes: !item["keyAttributes"]
            ? item["keyAttributes"]
            : keyAttributesSerializer(item["keyAttributes"]),
        tags: item["tags"],
        crv: item["curve"],
        release_policy: !item["releasePolicy"]
            ? item["releasePolicy"]
            : keyReleasePolicySerializer(item["releasePolicy"]),
    };
}
/** JsonWebKey Key Type (kty), as defined in https://tools.ietf.org/html/draft-ietf-jose-json-web-algorithms-40. */
var KnownJsonWebKeyType;
(function (KnownJsonWebKeyType) {
    /** Elliptic Curve. */
    KnownJsonWebKeyType["EC"] = "EC";
    /** Elliptic Curve with a private key which is stored in the HSM. */
    KnownJsonWebKeyType["ECHSM"] = "EC-HSM";
    /** RSA (https://tools.ietf.org/html/rfc3447) */
    KnownJsonWebKeyType["RSA"] = "RSA";
    /** RSA with a private key which is stored in the HSM. */
    KnownJsonWebKeyType["RSAHSM"] = "RSA-HSM";
    /** Octet sequence (used to represent symmetric keys) */
    KnownJsonWebKeyType["Oct"] = "oct";
    /** Octet sequence (used to represent symmetric keys) which is stored the HSM. */
    KnownJsonWebKeyType["OctHSM"] = "oct-HSM";
})(KnownJsonWebKeyType || (exports.KnownJsonWebKeyType = KnownJsonWebKeyType = {}));
/** JSON web key operations. For more information, see JsonWebKeyOperation. */
var KnownJsonWebKeyOperation;
(function (KnownJsonWebKeyOperation) {
    /** Indicates that the key can be used to encrypt. */
    KnownJsonWebKeyOperation["Encrypt"] = "encrypt";
    /** Indicates that the key can be used to decrypt. */
    KnownJsonWebKeyOperation["Decrypt"] = "decrypt";
    /** Indicates that the key can be used to sign. */
    KnownJsonWebKeyOperation["Sign"] = "sign";
    /** Indicates that the key can be used to verify. */
    KnownJsonWebKeyOperation["Verify"] = "verify";
    /** Indicates that the key can be used to wrap another key. */
    KnownJsonWebKeyOperation["WrapKey"] = "wrapKey";
    /** Indicates that the key can be used to unwrap another key. */
    KnownJsonWebKeyOperation["UnwrapKey"] = "unwrapKey";
    /** Indicates that the key can be imported during creation. */
    KnownJsonWebKeyOperation["Import"] = "import";
    /** Indicates that the private component of the key can be exported. */
    KnownJsonWebKeyOperation["Export"] = "export";
})(KnownJsonWebKeyOperation || (exports.KnownJsonWebKeyOperation = KnownJsonWebKeyOperation = {}));
function keyAttributesSerializer(item) {
    return {
        enabled: item["enabled"],
        nbf: !item["notBefore"]
            ? item["notBefore"]
            : (item["notBefore"].getTime() / 1000) | 0,
        exp: !item["expires"]
            ? item["expires"]
            : (item["expires"].getTime() / 1000) | 0,
        exportable: item["exportable"],
    };
}
function keyAttributesDeserializer(item) {
    return {
        enabled: item["enabled"],
        notBefore: !item["nbf"] ? item["nbf"] : new Date(item["nbf"] * 1000),
        expires: !item["exp"] ? item["exp"] : new Date(item["exp"] * 1000),
        created: !item["created"]
            ? item["created"]
            : new Date(item["created"] * 1000),
        updated: !item["updated"]
            ? item["updated"]
            : new Date(item["updated"] * 1000),
        recoverableDays: item["recoverableDays"],
        recoveryLevel: item["recoveryLevel"],
        exportable: item["exportable"],
        hsmPlatform: item["hsmPlatform"],
        attestation: !item["attestation"]
            ? item["attestation"]
            : keyAttestationDeserializer(item["attestation"]),
    };
}
/** Reflects the deletion recovery level currently in effect for certificates in the current vault. If it contains 'Purgeable', the certificate can be permanently deleted by a privileged user; otherwise, only the system can purge the certificate, at the end of the retention interval. */
var KnownDeletionRecoveryLevel;
(function (KnownDeletionRecoveryLevel) {
    /** Denotes a vault state in which deletion is an irreversible operation, without the possibility for recovery. This level corresponds to no protection being available against a Delete operation; the data is irretrievably lost upon accepting a Delete operation at the entity level or higher (vault, resource group, subscription etc.) */
    KnownDeletionRecoveryLevel["Purgeable"] = "Purgeable";
    /** Denotes a vault state in which deletion is recoverable, and which also permits immediate and permanent deletion (i.e. purge). This level guarantees the recoverability of the deleted entity during the retention interval (90 days), unless a Purge operation is requested, or the subscription is cancelled. System wil permanently delete it after 90 days, if not recovered */
    KnownDeletionRecoveryLevel["RecoverablePurgeable"] = "Recoverable+Purgeable";
    /** Denotes a vault state in which deletion is recoverable without the possibility for immediate and permanent deletion (i.e. purge). This level guarantees the recoverability of the deleted entity during the retention interval(90 days) and while the subscription is still available. System wil permanently delete it after 90 days, if not recovered */
    KnownDeletionRecoveryLevel["Recoverable"] = "Recoverable";
    /** Denotes a vault and subscription state in which deletion is recoverable within retention interval (90 days), immediate and permanent deletion (i.e. purge) is not permitted, and in which the subscription itself  cannot be permanently canceled. System wil permanently delete it after 90 days, if not recovered */
    KnownDeletionRecoveryLevel["RecoverableProtectedSubscription"] = "Recoverable+ProtectedSubscription";
    /** Denotes a vault state in which deletion is recoverable, and which also permits immediate and permanent deletion (i.e. purge when 7 <= SoftDeleteRetentionInDays < 90). This level guarantees the recoverability of the deleted entity during the retention interval, unless a Purge operation is requested, or the subscription is cancelled. */
    KnownDeletionRecoveryLevel["CustomizedRecoverablePurgeable"] = "CustomizedRecoverable+Purgeable";
    /** Denotes a vault state in which deletion is recoverable without the possibility for immediate and permanent deletion (i.e. purge when 7 <= SoftDeleteRetentionInDays < 90).This level guarantees the recoverability of the deleted entity during the retention interval and while the subscription is still available. */
    KnownDeletionRecoveryLevel["CustomizedRecoverable"] = "CustomizedRecoverable";
    /** Denotes a vault and subscription state in which deletion is recoverable, immediate and permanent deletion (i.e. purge) is not permitted, and in which the subscription itself cannot be permanently canceled when 7 <= SoftDeleteRetentionInDays < 90. This level guarantees the recoverability of the deleted entity during the retention interval, and also reflects the fact that the subscription itself cannot be cancelled. */
    KnownDeletionRecoveryLevel["CustomizedRecoverableProtectedSubscription"] = "CustomizedRecoverable+ProtectedSubscription";
})(KnownDeletionRecoveryLevel || (exports.KnownDeletionRecoveryLevel = KnownDeletionRecoveryLevel = {}));
function keyAttestationDeserializer(item) {
    return {
        certificatePemFile: !item["certificatePemFile"]
            ? item["certificatePemFile"]
            : typeof item["certificatePemFile"] === "string"
                ? (0, core_util_1.stringToUint8Array)(item["certificatePemFile"], "base64url")
                : item["certificatePemFile"],
        privateKeyAttestation: !item["privateKeyAttestation"]
            ? item["privateKeyAttestation"]
            : typeof item["privateKeyAttestation"] === "string"
                ? (0, core_util_1.stringToUint8Array)(item["privateKeyAttestation"], "base64url")
                : item["privateKeyAttestation"],
        publicKeyAttestation: !item["publicKeyAttestation"]
            ? item["publicKeyAttestation"]
            : typeof item["publicKeyAttestation"] === "string"
                ? (0, core_util_1.stringToUint8Array)(item["publicKeyAttestation"], "base64url")
                : item["publicKeyAttestation"],
        version: item["version"],
    };
}
/** Elliptic curve name. For valid values, see JsonWebKeyCurveName. */
var KnownJsonWebKeyCurveName;
(function (KnownJsonWebKeyCurveName) {
    /** The NIST P-256 elliptic curve, AKA SECG curve SECP256R1. */
    KnownJsonWebKeyCurveName["P256"] = "P-256";
    /** The NIST P-384 elliptic curve, AKA SECG curve SECP384R1. */
    KnownJsonWebKeyCurveName["P384"] = "P-384";
    /** The NIST P-521 elliptic curve, AKA SECG curve SECP521R1. */
    KnownJsonWebKeyCurveName["P521"] = "P-521";
    /** The SECG SECP256K1 elliptic curve. */
    KnownJsonWebKeyCurveName["P256K"] = "P-256K";
})(KnownJsonWebKeyCurveName || (exports.KnownJsonWebKeyCurveName = KnownJsonWebKeyCurveName = {}));
function keyReleasePolicySerializer(item) {
    return {
        contentType: item["contentType"],
        immutable: item["immutable"],
        data: !item["encodedPolicy"]
            ? item["encodedPolicy"]
            : (0, core_util_1.uint8ArrayToString)(item["encodedPolicy"], "base64url"),
    };
}
function keyReleasePolicyDeserializer(item) {
    return {
        contentType: item["contentType"],
        immutable: item["immutable"],
        encodedPolicy: !item["data"]
            ? item["data"]
            : typeof item["data"] === "string"
                ? (0, core_util_1.stringToUint8Array)(item["data"], "base64url")
                : item["data"],
    };
}
function keyBundleDeserializer(item) {
    return {
        key: !item["key"] ? item["key"] : jsonWebKeyDeserializer(item["key"]),
        attributes: !item["attributes"]
            ? item["attributes"]
            : keyAttributesDeserializer(item["attributes"]),
        tags: item["tags"],
        managed: item["managed"],
        releasePolicy: !item["release_policy"]
            ? item["release_policy"]
            : keyReleasePolicyDeserializer(item["release_policy"]),
    };
}
function jsonWebKeySerializer(item) {
    return {
        kid: item["kid"],
        kty: item["kty"],
        key_ops: !item["keyOps"]
            ? item["keyOps"]
            : item["keyOps"].map((p) => {
                return p;
            }),
        n: !item["n"] ? item["n"] : (0, core_util_1.uint8ArrayToString)(item["n"], "base64url"),
        e: !item["e"] ? item["e"] : (0, core_util_1.uint8ArrayToString)(item["e"], "base64url"),
        d: !item["d"] ? item["d"] : (0, core_util_1.uint8ArrayToString)(item["d"], "base64url"),
        dp: !item["dp"] ? item["dp"] : (0, core_util_1.uint8ArrayToString)(item["dp"], "base64url"),
        dq: !item["dq"] ? item["dq"] : (0, core_util_1.uint8ArrayToString)(item["dq"], "base64url"),
        qi: !item["qi"] ? item["qi"] : (0, core_util_1.uint8ArrayToString)(item["qi"], "base64url"),
        p: !item["p"] ? item["p"] : (0, core_util_1.uint8ArrayToString)(item["p"], "base64url"),
        q: !item["q"] ? item["q"] : (0, core_util_1.uint8ArrayToString)(item["q"], "base64url"),
        k: !item["k"] ? item["k"] : (0, core_util_1.uint8ArrayToString)(item["k"], "base64url"),
        key_hsm: !item["t"]
            ? item["t"]
            : (0, core_util_1.uint8ArrayToString)(item["t"], "base64url"),
        crv: item["crv"],
        x: !item["x"] ? item["x"] : (0, core_util_1.uint8ArrayToString)(item["x"], "base64url"),
        y: !item["y"] ? item["y"] : (0, core_util_1.uint8ArrayToString)(item["y"], "base64url"),
    };
}
function jsonWebKeyDeserializer(item) {
    return {
        kid: item["kid"],
        kty: item["kty"],
        keyOps: !item["key_ops"]
            ? item["key_ops"]
            : item["key_ops"].map((p) => {
                return p;
            }),
        n: !item["n"]
            ? item["n"]
            : typeof item["n"] === "string"
                ? (0, core_util_1.stringToUint8Array)(item["n"], "base64url")
                : item["n"],
        e: !item["e"]
            ? item["e"]
            : typeof item["e"] === "string"
                ? (0, core_util_1.stringToUint8Array)(item["e"], "base64url")
                : item["e"],
        d: !item["d"]
            ? item["d"]
            : typeof item["d"] === "string"
                ? (0, core_util_1.stringToUint8Array)(item["d"], "base64url")
                : item["d"],
        dp: !item["dp"]
            ? item["dp"]
            : typeof item["dp"] === "string"
                ? (0, core_util_1.stringToUint8Array)(item["dp"], "base64url")
                : item["dp"],
        dq: !item["dq"]
            ? item["dq"]
            : typeof item["dq"] === "string"
                ? (0, core_util_1.stringToUint8Array)(item["dq"], "base64url")
                : item["dq"],
        qi: !item["qi"]
            ? item["qi"]
            : typeof item["qi"] === "string"
                ? (0, core_util_1.stringToUint8Array)(item["qi"], "base64url")
                : item["qi"],
        p: !item["p"]
            ? item["p"]
            : typeof item["p"] === "string"
                ? (0, core_util_1.stringToUint8Array)(item["p"], "base64url")
                : item["p"],
        q: !item["q"]
            ? item["q"]
            : typeof item["q"] === "string"
                ? (0, core_util_1.stringToUint8Array)(item["q"], "base64url")
                : item["q"],
        k: !item["k"]
            ? item["k"]
            : typeof item["k"] === "string"
                ? (0, core_util_1.stringToUint8Array)(item["k"], "base64url")
                : item["k"],
        t: !item["key_hsm"]
            ? item["key_hsm"]
            : typeof item["key_hsm"] === "string"
                ? (0, core_util_1.stringToUint8Array)(item["key_hsm"], "base64url")
                : item["key_hsm"],
        crv: item["crv"],
        x: !item["x"]
            ? item["x"]
            : typeof item["x"] === "string"
                ? (0, core_util_1.stringToUint8Array)(item["x"], "base64url")
                : item["x"],
        y: !item["y"]
            ? item["y"]
            : typeof item["y"] === "string"
                ? (0, core_util_1.stringToUint8Array)(item["y"], "base64url")
                : item["y"],
    };
}
function keyVaultErrorDeserializer(item) {
    return {
        error: !item["error"]
            ? item["error"]
            : _keyVaultErrorErrorDeserializer(item["error"]),
    };
}
function _keyVaultErrorErrorDeserializer(item) {
    return {
        code: item["code"],
        message: item["message"],
        innerError: !item["innererror"]
            ? item["innererror"]
            : _keyVaultErrorErrorDeserializer(item["innererror"]),
    };
}
function keyImportParametersSerializer(item) {
    return {
        Hsm: item["hsm"],
        key: jsonWebKeySerializer(item["key"]),
        attributes: !item["keyAttributes"]
            ? item["keyAttributes"]
            : keyAttributesSerializer(item["keyAttributes"]),
        tags: item["tags"],
        release_policy: !item["releasePolicy"]
            ? item["releasePolicy"]
            : keyReleasePolicySerializer(item["releasePolicy"]),
    };
}
function deletedKeyBundleDeserializer(item) {
    return {
        key: !item["key"] ? item["key"] : jsonWebKeyDeserializer(item["key"]),
        attributes: !item["attributes"]
            ? item["attributes"]
            : keyAttributesDeserializer(item["attributes"]),
        tags: item["tags"],
        managed: item["managed"],
        releasePolicy: !item["release_policy"]
            ? item["release_policy"]
            : keyReleasePolicyDeserializer(item["release_policy"]),
        recoveryId: item["recoveryId"],
        scheduledPurgeDate: !item["scheduledPurgeDate"]
            ? item["scheduledPurgeDate"]
            : new Date(item["scheduledPurgeDate"] * 1000),
        deletedDate: !item["deletedDate"]
            ? item["deletedDate"]
            : new Date(item["deletedDate"] * 1000),
    };
}
function keyUpdateParametersSerializer(item) {
    return {
        key_ops: !item["keyOps"]
            ? item["keyOps"]
            : item["keyOps"].map((p) => {
                return p;
            }),
        attributes: !item["keyAttributes"]
            ? item["keyAttributes"]
            : keyAttributesSerializer(item["keyAttributes"]),
        tags: item["tags"],
        release_policy: !item["releasePolicy"]
            ? item["releasePolicy"]
            : keyReleasePolicySerializer(item["releasePolicy"]),
    };
}
function _keyListResultDeserializer(item) {
    return {
        value: !item["value"]
            ? item["value"]
            : keyItemArrayDeserializer(item["value"]),
        nextLink: item["nextLink"],
    };
}
function keyItemArrayDeserializer(result) {
    return result.map((item) => {
        return keyItemDeserializer(item);
    });
}
function keyItemDeserializer(item) {
    return {
        kid: item["kid"],
        attributes: !item["attributes"]
            ? item["attributes"]
            : keyAttributesDeserializer(item["attributes"]),
        tags: item["tags"],
        managed: item["managed"],
    };
}
function backupKeyResultDeserializer(item) {
    return {
        value: !item["value"]
            ? item["value"]
            : typeof item["value"] === "string"
                ? (0, core_util_1.stringToUint8Array)(item["value"], "base64url")
                : item["value"],
    };
}
function keyRestoreParametersSerializer(item) {
    return { value: (0, core_util_1.uint8ArrayToString)(item["keyBundleBackup"], "base64url") };
}
function keyOperationsParametersSerializer(item) {
    return {
        alg: item["algorithm"],
        value: (0, core_util_1.uint8ArrayToString)(item["value"], "base64url"),
        iv: !item["iv"] ? item["iv"] : (0, core_util_1.uint8ArrayToString)(item["iv"], "base64url"),
        aad: !item["aad"]
            ? item["aad"]
            : (0, core_util_1.uint8ArrayToString)(item["aad"], "base64url"),
        tag: !item["tag"]
            ? item["tag"]
            : (0, core_util_1.uint8ArrayToString)(item["tag"], "base64url"),
    };
}
/** An algorithm used for encryption and decryption. */
var KnownJsonWebKeyEncryptionAlgorithm;
(function (KnownJsonWebKeyEncryptionAlgorithm) {
    /** [Not recommended] RSAES using Optimal Asymmetric Encryption Padding (OAEP), as described in https://tools.ietf.org/html/rfc3447, with the default parameters specified by RFC 3447 in Section A.2.1. Those default parameters are using a hash function of SHA-1 and a mask generation function of MGF1 with SHA-1. Microsoft recommends using RSA_OAEP_256 or stronger algorithms for enhanced security. Microsoft does *not* recommend RSA_OAEP, which is included solely for backwards compatibility. RSA_OAEP utilizes SHA1, which has known collision problems. */
    KnownJsonWebKeyEncryptionAlgorithm["RSAOaep"] = "RSA-OAEP";
    /** RSAES using Optimal Asymmetric Encryption Padding with a hash function of SHA-256 and a mask generation function of MGF1 with SHA-256. */
    KnownJsonWebKeyEncryptionAlgorithm["RSAOaep256"] = "RSA-OAEP-256";
    /** [Not recommended] RSAES-PKCS1-V1_5 key encryption, as described in https://tools.ietf.org/html/rfc3447. Microsoft recommends using RSA_OAEP_256 or stronger algorithms for enhanced security. Microsoft does *not* recommend RSA_1_5, which is included solely for backwards compatibility. Cryptographic standards no longer consider RSA with the PKCS#1 v1.5 padding scheme secure for encryption. */
    KnownJsonWebKeyEncryptionAlgorithm["RSA15"] = "RSA1_5";
    /** 128-bit AES-GCM. */
    KnownJsonWebKeyEncryptionAlgorithm["A128GCM"] = "A128GCM";
    /** 192-bit AES-GCM. */
    KnownJsonWebKeyEncryptionAlgorithm["A192GCM"] = "A192GCM";
    /** 256-bit AES-GCM. */
    KnownJsonWebKeyEncryptionAlgorithm["A256GCM"] = "A256GCM";
    /** 128-bit AES key wrap. */
    KnownJsonWebKeyEncryptionAlgorithm["A128KW"] = "A128KW";
    /** 192-bit AES key wrap. */
    KnownJsonWebKeyEncryptionAlgorithm["A192KW"] = "A192KW";
    /** 256-bit AES key wrap. */
    KnownJsonWebKeyEncryptionAlgorithm["A256KW"] = "A256KW";
    /** 128-bit AES-CBC. */
    KnownJsonWebKeyEncryptionAlgorithm["A128CBC"] = "A128CBC";
    /** 192-bit AES-CBC. */
    KnownJsonWebKeyEncryptionAlgorithm["A192CBC"] = "A192CBC";
    /** 256-bit AES-CBC. */
    KnownJsonWebKeyEncryptionAlgorithm["A256CBC"] = "A256CBC";
    /** 128-bit AES-CBC with PKCS padding. */
    KnownJsonWebKeyEncryptionAlgorithm["A128Cbcpad"] = "A128CBCPAD";
    /** 192-bit AES-CBC with PKCS padding. */
    KnownJsonWebKeyEncryptionAlgorithm["A192Cbcpad"] = "A192CBCPAD";
    /** 256-bit AES-CBC with PKCS padding. */
    KnownJsonWebKeyEncryptionAlgorithm["A256Cbcpad"] = "A256CBCPAD";
    /** CKM AES key wrap. */
    KnownJsonWebKeyEncryptionAlgorithm["CkmAesKeyWrap"] = "CKM_AES_KEY_WRAP";
    /** CKM AES key wrap with padding. */
    KnownJsonWebKeyEncryptionAlgorithm["CkmAesKeyWrapPad"] = "CKM_AES_KEY_WRAP_PAD";
})(KnownJsonWebKeyEncryptionAlgorithm || (exports.KnownJsonWebKeyEncryptionAlgorithm = KnownJsonWebKeyEncryptionAlgorithm = {}));
function keyOperationResultDeserializer(item) {
    return {
        kid: item["kid"],
        result: !item["value"]
            ? item["value"]
            : typeof item["value"] === "string"
                ? (0, core_util_1.stringToUint8Array)(item["value"], "base64url")
                : item["value"],
        iv: !item["iv"]
            ? item["iv"]
            : typeof item["iv"] === "string"
                ? (0, core_util_1.stringToUint8Array)(item["iv"], "base64url")
                : item["iv"],
        authenticationTag: !item["tag"]
            ? item["tag"]
            : typeof item["tag"] === "string"
                ? (0, core_util_1.stringToUint8Array)(item["tag"], "base64url")
                : item["tag"],
        additionalAuthenticatedData: !item["aad"]
            ? item["aad"]
            : typeof item["aad"] === "string"
                ? (0, core_util_1.stringToUint8Array)(item["aad"], "base64url")
                : item["aad"],
    };
}
function keySignParametersSerializer(item) {
    return {
        alg: item["algorithm"],
        value: (0, core_util_1.uint8ArrayToString)(item["value"], "base64url"),
    };
}
/** The signing/verification algorithm identifier. For more information on possible algorithm types, see JsonWebKeySignatureAlgorithm. */
var KnownJsonWebKeySignatureAlgorithm;
(function (KnownJsonWebKeySignatureAlgorithm) {
    /** RSASSA-PSS using SHA-256 and MGF1 with SHA-256, as described in https://tools.ietf.org/html/rfc7518 */
    KnownJsonWebKeySignatureAlgorithm["PS256"] = "PS256";
    /** RSASSA-PSS using SHA-384 and MGF1 with SHA-384, as described in https://tools.ietf.org/html/rfc7518 */
    KnownJsonWebKeySignatureAlgorithm["PS384"] = "PS384";
    /** RSASSA-PSS using SHA-512 and MGF1 with SHA-512, as described in https://tools.ietf.org/html/rfc7518 */
    KnownJsonWebKeySignatureAlgorithm["PS512"] = "PS512";
    /** RSASSA-PKCS1-v1_5 using SHA-256, as described in https://tools.ietf.org/html/rfc7518 */
    KnownJsonWebKeySignatureAlgorithm["RS256"] = "RS256";
    /** RSASSA-PKCS1-v1_5 using SHA-384, as described in https://tools.ietf.org/html/rfc7518 */
    KnownJsonWebKeySignatureAlgorithm["RS384"] = "RS384";
    /** RSASSA-PKCS1-v1_5 using SHA-512, as described in https://tools.ietf.org/html/rfc7518 */
    KnownJsonWebKeySignatureAlgorithm["RS512"] = "RS512";
    /** HMAC using SHA-256, as described in  https://tools.ietf.org/html/rfc7518 */
    KnownJsonWebKeySignatureAlgorithm["HS256"] = "HS256";
    /** HMAC using SHA-384, as described in https://tools.ietf.org/html/rfc7518 */
    KnownJsonWebKeySignatureAlgorithm["HS384"] = "HS384";
    /** HMAC using SHA-512, as described in https://tools.ietf.org/html/rfc7518 */
    KnownJsonWebKeySignatureAlgorithm["HS512"] = "HS512";
    /** Reserved */
    KnownJsonWebKeySignatureAlgorithm["Rsnull"] = "RSNULL";
    /** ECDSA using P-256 and SHA-256, as described in https://tools.ietf.org/html/rfc7518. */
    KnownJsonWebKeySignatureAlgorithm["ES256"] = "ES256";
    /** ECDSA using P-384 and SHA-384, as described in https://tools.ietf.org/html/rfc7518 */
    KnownJsonWebKeySignatureAlgorithm["ES384"] = "ES384";
    /** ECDSA using P-521 and SHA-512, as described in https://tools.ietf.org/html/rfc7518 */
    KnownJsonWebKeySignatureAlgorithm["ES512"] = "ES512";
    /** ECDSA using P-256K and SHA-256, as described in https://tools.ietf.org/html/rfc7518 */
    KnownJsonWebKeySignatureAlgorithm["ES256K"] = "ES256K";
})(KnownJsonWebKeySignatureAlgorithm || (exports.KnownJsonWebKeySignatureAlgorithm = KnownJsonWebKeySignatureAlgorithm = {}));
function keyVerifyParametersSerializer(item) {
    return {
        alg: item["algorithm"],
        digest: (0, core_util_1.uint8ArrayToString)(item["digest"], "base64url"),
        value: (0, core_util_1.uint8ArrayToString)(item["signature"], "base64url"),
    };
}
function keyVerifyResultDeserializer(item) {
    return {
        value: item["value"],
    };
}
function keyReleaseParametersSerializer(item) {
    return {
        target: item["targetAttestationToken"],
        nonce: item["nonce"],
        enc: item["enc"],
    };
}
/** The encryption algorithm to use to protected the exported key material */
var KnownKeyEncryptionAlgorithm;
(function (KnownKeyEncryptionAlgorithm) {
    /** The CKM_RSA_AES_KEY_WRAP key wrap mechanism. */
    KnownKeyEncryptionAlgorithm["CkmRsaAesKeyWrap"] = "CKM_RSA_AES_KEY_WRAP";
    /** The RSA_AES_KEY_WRAP_256 key wrap mechanism. */
    KnownKeyEncryptionAlgorithm["RsaAesKeyWrap256"] = "RSA_AES_KEY_WRAP_256";
    /** The RSA_AES_KEY_WRAP_384 key wrap mechanism. */
    KnownKeyEncryptionAlgorithm["RsaAesKeyWrap384"] = "RSA_AES_KEY_WRAP_384";
})(KnownKeyEncryptionAlgorithm || (exports.KnownKeyEncryptionAlgorithm = KnownKeyEncryptionAlgorithm = {}));
function keyReleaseResultDeserializer(item) {
    return {
        value: item["value"],
    };
}
function _deletedKeyListResultDeserializer(item) {
    return {
        value: !item["value"]
            ? item["value"]
            : deletedKeyItemArrayDeserializer(item["value"]),
        nextLink: item["nextLink"],
    };
}
function deletedKeyItemArrayDeserializer(result) {
    return result.map((item) => {
        return deletedKeyItemDeserializer(item);
    });
}
function deletedKeyItemDeserializer(item) {
    return {
        kid: item["kid"],
        attributes: !item["attributes"]
            ? item["attributes"]
            : keyAttributesDeserializer(item["attributes"]),
        tags: item["tags"],
        managed: item["managed"],
        recoveryId: item["recoveryId"],
        scheduledPurgeDate: !item["scheduledPurgeDate"]
            ? item["scheduledPurgeDate"]
            : new Date(item["scheduledPurgeDate"] * 1000),
        deletedDate: !item["deletedDate"]
            ? item["deletedDate"]
            : new Date(item["deletedDate"] * 1000),
    };
}
function keyRotationPolicySerializer(item) {
    return {
        lifetimeActions: !item["lifetimeActions"]
            ? item["lifetimeActions"]
            : lifetimeActionsArraySerializer(item["lifetimeActions"]),
        attributes: !item["attributes"]
            ? item["attributes"]
            : keyRotationPolicyAttributesSerializer(item["attributes"]),
    };
}
function keyRotationPolicyDeserializer(item) {
    return {
        id: item["id"],
        lifetimeActions: !item["lifetimeActions"]
            ? item["lifetimeActions"]
            : lifetimeActionsArrayDeserializer(item["lifetimeActions"]),
        attributes: !item["attributes"]
            ? item["attributes"]
            : keyRotationPolicyAttributesDeserializer(item["attributes"]),
    };
}
function lifetimeActionsArraySerializer(result) {
    return result.map((item) => {
        return lifetimeActionsSerializer(item);
    });
}
function lifetimeActionsArrayDeserializer(result) {
    return result.map((item) => {
        return lifetimeActionsDeserializer(item);
    });
}
function lifetimeActionsSerializer(item) {
    return {
        trigger: !item["trigger"]
            ? item["trigger"]
            : lifetimeActionsTriggerSerializer(item["trigger"]),
        action: !item["action"]
            ? item["action"]
            : lifetimeActionsTypeSerializer(item["action"]),
    };
}
function lifetimeActionsDeserializer(item) {
    return {
        trigger: !item["trigger"]
            ? item["trigger"]
            : lifetimeActionsTriggerDeserializer(item["trigger"]),
        action: !item["action"]
            ? item["action"]
            : lifetimeActionsTypeDeserializer(item["action"]),
    };
}
function lifetimeActionsTriggerSerializer(item) {
    return {
        timeAfterCreate: item["timeAfterCreate"],
        timeBeforeExpiry: item["timeBeforeExpiry"],
    };
}
function lifetimeActionsTriggerDeserializer(item) {
    return {
        timeAfterCreate: item["timeAfterCreate"],
        timeBeforeExpiry: item["timeBeforeExpiry"],
    };
}
function lifetimeActionsTypeSerializer(item) {
    return { type: item["type"] };
}
function lifetimeActionsTypeDeserializer(item) {
    return {
        type: item["type"],
    };
}
function keyRotationPolicyAttributesSerializer(item) {
    return { expiryTime: item["expiryTime"] };
}
function keyRotationPolicyAttributesDeserializer(item) {
    return {
        expiryTime: item["expiryTime"],
        created: !item["created"]
            ? item["created"]
            : new Date(item["created"] * 1000),
        updated: !item["updated"]
            ? item["updated"]
            : new Date(item["updated"] * 1000),
    };
}
function getRandomBytesRequestSerializer(item) {
    return { count: item["count"] };
}
function randomBytesDeserializer(item) {
    return {
        value: typeof item["value"] === "string"
            ? (0, core_util_1.stringToUint8Array)(item["value"], "base64url")
            : item["value"],
    };
}
/** The available API versions. */
var KnownVersions;
(function (KnownVersions) {
    /** The 7.5 API version. */
    KnownVersions["V75"] = "7.5";
    /** The 7.6-preview.2 API version. */
    KnownVersions["V76Preview2"] = "7.6-preview.2";
    /** The 7.6 API version. */
    KnownVersions["V76"] = "7.6";
})(KnownVersions || (exports.KnownVersions = KnownVersions = {}));
//# sourceMappingURL=models.js.map