1# coding=utf-8
2# --------------------------------------------------------------------------
3# Copyright (c) Microsoft Corporation. All rights reserved.
4# Licensed under the MIT License. See License.txt in the project root for license information.
5# Code generated by Microsoft (R) AutoRest Code Generator.
6# Changes may cause incorrect behavior and will be lost if the code is regenerated.
7# --------------------------------------------------------------------------
8
9import datetime
10from typing import Dict, List, Optional, Union
11
12from azure.core.exceptions import HttpResponseError
13import msrest.serialization
14
15from ._key_vault_client_enums import *
16
17
18class Attributes(msrest.serialization.Model):
19    """The object attributes managed by the KeyVault service.
20
21    Variables are only populated by the server, and will be ignored when sending a request.
22
23    :param enabled: Determines whether the object is enabled.
24    :type enabled: bool
25    :param not_before: Not before date in UTC.
26    :type not_before: ~datetime.datetime
27    :param expires: Expiry date in UTC.
28    :type expires: ~datetime.datetime
29    :ivar created: Creation time in UTC.
30    :vartype created: ~datetime.datetime
31    :ivar updated: Last updated time in UTC.
32    :vartype updated: ~datetime.datetime
33    """
34
35    _validation = {
36        'created': {'readonly': True},
37        'updated': {'readonly': True},
38    }
39
40    _attribute_map = {
41        'enabled': {'key': 'enabled', 'type': 'bool'},
42        'not_before': {'key': 'nbf', 'type': 'unix-time'},
43        'expires': {'key': 'exp', 'type': 'unix-time'},
44        'created': {'key': 'created', 'type': 'unix-time'},
45        'updated': {'key': 'updated', 'type': 'unix-time'},
46    }
47
48    def __init__(
49        self,
50        *,
51        enabled: Optional[bool] = None,
52        not_before: Optional[datetime.datetime] = None,
53        expires: Optional[datetime.datetime] = None,
54        **kwargs
55    ):
56        super(Attributes, self).__init__(**kwargs)
57        self.enabled = enabled
58        self.not_before = not_before
59        self.expires = expires
60        self.created = None
61        self.updated = None
62
63
64class BackupKeyResult(msrest.serialization.Model):
65    """The backup key result, containing the backup blob.
66
67    Variables are only populated by the server, and will be ignored when sending a request.
68
69    :ivar value: The backup blob containing the backed up key.
70    :vartype value: bytes
71    """
72
73    _validation = {
74        'value': {'readonly': True},
75    }
76
77    _attribute_map = {
78        'value': {'key': 'value', 'type': 'base64'},
79    }
80
81    def __init__(
82        self,
83        **kwargs
84    ):
85        super(BackupKeyResult, self).__init__(**kwargs)
86        self.value = None
87
88
89class KeyBundle(msrest.serialization.Model):
90    """A KeyBundle consisting of a WebKey plus its attributes.
91
92    Variables are only populated by the server, and will be ignored when sending a request.
93
94    :param key: The Json web key.
95    :type key: ~azure.keyvault.v7_1.models.JsonWebKey
96    :param attributes: The key management attributes.
97    :type attributes: ~azure.keyvault.v7_1.models.KeyAttributes
98    :param tags: A set of tags. Application specific metadata in the form of key-value pairs.
99    :type tags: dict[str, str]
100    :ivar managed: True if the key's lifetime is managed by key vault. If this is a key backing a
101     certificate, then managed will be true.
102    :vartype managed: bool
103    """
104
105    _validation = {
106        'managed': {'readonly': True},
107    }
108
109    _attribute_map = {
110        'key': {'key': 'key', 'type': 'JsonWebKey'},
111        'attributes': {'key': 'attributes', 'type': 'KeyAttributes'},
112        'tags': {'key': 'tags', 'type': '{str}'},
113        'managed': {'key': 'managed', 'type': 'bool'},
114    }
115
116    def __init__(
117        self,
118        *,
119        key: Optional["JsonWebKey"] = None,
120        attributes: Optional["KeyAttributes"] = None,
121        tags: Optional[Dict[str, str]] = None,
122        **kwargs
123    ):
124        super(KeyBundle, self).__init__(**kwargs)
125        self.key = key
126        self.attributes = attributes
127        self.tags = tags
128        self.managed = None
129
130
131class DeletedKeyBundle(KeyBundle):
132    """A DeletedKeyBundle consisting of a WebKey plus its Attributes and deletion info.
133
134    Variables are only populated by the server, and will be ignored when sending a request.
135
136    :param key: The Json web key.
137    :type key: ~azure.keyvault.v7_1.models.JsonWebKey
138    :param attributes: The key management attributes.
139    :type attributes: ~azure.keyvault.v7_1.models.KeyAttributes
140    :param tags: A set of tags. Application specific metadata in the form of key-value pairs.
141    :type tags: dict[str, str]
142    :ivar managed: True if the key's lifetime is managed by key vault. If this is a key backing a
143     certificate, then managed will be true.
144    :vartype managed: bool
145    :param recovery_id: The url of the recovery object, used to identify and recover the deleted
146     key.
147    :type recovery_id: str
148    :ivar scheduled_purge_date: The time when the key is scheduled to be purged, in UTC.
149    :vartype scheduled_purge_date: ~datetime.datetime
150    :ivar deleted_date: The time when the key was deleted, in UTC.
151    :vartype deleted_date: ~datetime.datetime
152    """
153
154    _validation = {
155        'managed': {'readonly': True},
156        'scheduled_purge_date': {'readonly': True},
157        'deleted_date': {'readonly': True},
158    }
159
160    _attribute_map = {
161        'key': {'key': 'key', 'type': 'JsonWebKey'},
162        'attributes': {'key': 'attributes', 'type': 'KeyAttributes'},
163        'tags': {'key': 'tags', 'type': '{str}'},
164        'managed': {'key': 'managed', 'type': 'bool'},
165        'recovery_id': {'key': 'recoveryId', 'type': 'str'},
166        'scheduled_purge_date': {'key': 'scheduledPurgeDate', 'type': 'unix-time'},
167        'deleted_date': {'key': 'deletedDate', 'type': 'unix-time'},
168    }
169
170    def __init__(
171        self,
172        *,
173        key: Optional["JsonWebKey"] = None,
174        attributes: Optional["KeyAttributes"] = None,
175        tags: Optional[Dict[str, str]] = None,
176        recovery_id: Optional[str] = None,
177        **kwargs
178    ):
179        super(DeletedKeyBundle, self).__init__(key=key, attributes=attributes, tags=tags, **kwargs)
180        self.recovery_id = recovery_id
181        self.scheduled_purge_date = None
182        self.deleted_date = None
183
184
185class KeyItem(msrest.serialization.Model):
186    """The key item containing key metadata.
187
188    Variables are only populated by the server, and will be ignored when sending a request.
189
190    :param kid: Key identifier.
191    :type kid: str
192    :param attributes: The key management attributes.
193    :type attributes: ~azure.keyvault.v7_1.models.KeyAttributes
194    :param tags: A set of tags. Application specific metadata in the form of key-value pairs.
195    :type tags: dict[str, str]
196    :ivar managed: True if the key's lifetime is managed by key vault. If this is a key backing a
197     certificate, then managed will be true.
198    :vartype managed: bool
199    """
200
201    _validation = {
202        'managed': {'readonly': True},
203    }
204
205    _attribute_map = {
206        'kid': {'key': 'kid', 'type': 'str'},
207        'attributes': {'key': 'attributes', 'type': 'KeyAttributes'},
208        'tags': {'key': 'tags', 'type': '{str}'},
209        'managed': {'key': 'managed', 'type': 'bool'},
210    }
211
212    def __init__(
213        self,
214        *,
215        kid: Optional[str] = None,
216        attributes: Optional["KeyAttributes"] = None,
217        tags: Optional[Dict[str, str]] = None,
218        **kwargs
219    ):
220        super(KeyItem, self).__init__(**kwargs)
221        self.kid = kid
222        self.attributes = attributes
223        self.tags = tags
224        self.managed = None
225
226
227class DeletedKeyItem(KeyItem):
228    """The deleted key item containing the deleted key metadata and information about deletion.
229
230    Variables are only populated by the server, and will be ignored when sending a request.
231
232    :param kid: Key identifier.
233    :type kid: str
234    :param attributes: The key management attributes.
235    :type attributes: ~azure.keyvault.v7_1.models.KeyAttributes
236    :param tags: A set of tags. Application specific metadata in the form of key-value pairs.
237    :type tags: dict[str, str]
238    :ivar managed: True if the key's lifetime is managed by key vault. If this is a key backing a
239     certificate, then managed will be true.
240    :vartype managed: bool
241    :param recovery_id: The url of the recovery object, used to identify and recover the deleted
242     key.
243    :type recovery_id: str
244    :ivar scheduled_purge_date: The time when the key is scheduled to be purged, in UTC.
245    :vartype scheduled_purge_date: ~datetime.datetime
246    :ivar deleted_date: The time when the key was deleted, in UTC.
247    :vartype deleted_date: ~datetime.datetime
248    """
249
250    _validation = {
251        'managed': {'readonly': True},
252        'scheduled_purge_date': {'readonly': True},
253        'deleted_date': {'readonly': True},
254    }
255
256    _attribute_map = {
257        'kid': {'key': 'kid', 'type': 'str'},
258        'attributes': {'key': 'attributes', 'type': 'KeyAttributes'},
259        'tags': {'key': 'tags', 'type': '{str}'},
260        'managed': {'key': 'managed', 'type': 'bool'},
261        'recovery_id': {'key': 'recoveryId', 'type': 'str'},
262        'scheduled_purge_date': {'key': 'scheduledPurgeDate', 'type': 'unix-time'},
263        'deleted_date': {'key': 'deletedDate', 'type': 'unix-time'},
264    }
265
266    def __init__(
267        self,
268        *,
269        kid: Optional[str] = None,
270        attributes: Optional["KeyAttributes"] = None,
271        tags: Optional[Dict[str, str]] = None,
272        recovery_id: Optional[str] = None,
273        **kwargs
274    ):
275        super(DeletedKeyItem, self).__init__(kid=kid, attributes=attributes, tags=tags, **kwargs)
276        self.recovery_id = recovery_id
277        self.scheduled_purge_date = None
278        self.deleted_date = None
279
280
281class DeletedKeyListResult(msrest.serialization.Model):
282    """A list of keys that have been deleted in this vault.
283
284    Variables are only populated by the server, and will be ignored when sending a request.
285
286    :ivar value: A response message containing a list of deleted keys in the vault along with a
287     link to the next page of deleted keys.
288    :vartype value: list[~azure.keyvault.v7_1.models.DeletedKeyItem]
289    :ivar next_link: The URL to get the next set of deleted keys.
290    :vartype next_link: str
291    """
292
293    _validation = {
294        'value': {'readonly': True},
295        'next_link': {'readonly': True},
296    }
297
298    _attribute_map = {
299        'value': {'key': 'value', 'type': '[DeletedKeyItem]'},
300        'next_link': {'key': 'nextLink', 'type': 'str'},
301    }
302
303    def __init__(
304        self,
305        **kwargs
306    ):
307        super(DeletedKeyListResult, self).__init__(**kwargs)
308        self.value = None
309        self.next_link = None
310
311
312class Error(msrest.serialization.Model):
313    """The key vault server error.
314
315    Variables are only populated by the server, and will be ignored when sending a request.
316
317    :ivar code: The error code.
318    :vartype code: str
319    :ivar message: The error message.
320    :vartype message: str
321    :ivar inner_error: The key vault server error.
322    :vartype inner_error: ~azure.keyvault.v7_1.models.Error
323    """
324
325    _validation = {
326        'code': {'readonly': True},
327        'message': {'readonly': True},
328        'inner_error': {'readonly': True},
329    }
330
331    _attribute_map = {
332        'code': {'key': 'code', 'type': 'str'},
333        'message': {'key': 'message', 'type': 'str'},
334        'inner_error': {'key': 'innererror', 'type': 'Error'},
335    }
336
337    def __init__(
338        self,
339        **kwargs
340    ):
341        super(Error, self).__init__(**kwargs)
342        self.code = None
343        self.message = None
344        self.inner_error = None
345
346
347class JsonWebKey(msrest.serialization.Model):
348    """As of http://tools.ietf.org/html/draft-ietf-jose-json-web-key-18.
349
350    :param kid: Key identifier.
351    :type kid: str
352    :param kty: JsonWebKey Key Type (kty), as defined in
353     https://tools.ietf.org/html/draft-ietf-jose-json-web-algorithms-40. Possible values include:
354     "EC", "EC-HSM", "RSA", "RSA-HSM", "oct".
355    :type kty: str or ~azure.keyvault.v7_1.models.JsonWebKeyType
356    :param key_ops:
357    :type key_ops: list[str]
358    :param n: RSA modulus.
359    :type n: bytes
360    :param e: RSA public exponent.
361    :type e: bytes
362    :param d: RSA private exponent, or the D component of an EC private key.
363    :type d: bytes
364    :param dp: RSA private key parameter.
365    :type dp: bytes
366    :param dq: RSA private key parameter.
367    :type dq: bytes
368    :param qi: RSA private key parameter.
369    :type qi: bytes
370    :param p: RSA secret prime.
371    :type p: bytes
372    :param q: RSA secret prime, with p < q.
373    :type q: bytes
374    :param k: Symmetric key.
375    :type k: bytes
376    :param t: HSM Token, used with 'Bring Your Own Key'.
377    :type t: bytes
378    :param crv: Elliptic curve name. For valid values, see JsonWebKeyCurveName. Possible values
379     include: "P-256", "P-384", "P-521", "P-256K".
380    :type crv: str or ~azure.keyvault.v7_1.models.JsonWebKeyCurveName
381    :param x: X component of an EC public key.
382    :type x: bytes
383    :param y: Y component of an EC public key.
384    :type y: bytes
385    """
386
387    _attribute_map = {
388        'kid': {'key': 'kid', 'type': 'str'},
389        'kty': {'key': 'kty', 'type': 'str'},
390        'key_ops': {'key': 'key_ops', 'type': '[str]'},
391        'n': {'key': 'n', 'type': 'base64'},
392        'e': {'key': 'e', 'type': 'base64'},
393        'd': {'key': 'd', 'type': 'base64'},
394        'dp': {'key': 'dp', 'type': 'base64'},
395        'dq': {'key': 'dq', 'type': 'base64'},
396        'qi': {'key': 'qi', 'type': 'base64'},
397        'p': {'key': 'p', 'type': 'base64'},
398        'q': {'key': 'q', 'type': 'base64'},
399        'k': {'key': 'k', 'type': 'base64'},
400        't': {'key': 'key_hsm', 'type': 'base64'},
401        'crv': {'key': 'crv', 'type': 'str'},
402        'x': {'key': 'x', 'type': 'base64'},
403        'y': {'key': 'y', 'type': 'base64'},
404    }
405
406    def __init__(
407        self,
408        *,
409        kid: Optional[str] = None,
410        kty: Optional[Union[str, "JsonWebKeyType"]] = None,
411        key_ops: Optional[List[str]] = None,
412        n: Optional[bytes] = None,
413        e: Optional[bytes] = None,
414        d: Optional[bytes] = None,
415        dp: Optional[bytes] = None,
416        dq: Optional[bytes] = None,
417        qi: Optional[bytes] = None,
418        p: Optional[bytes] = None,
419        q: Optional[bytes] = None,
420        k: Optional[bytes] = None,
421        t: Optional[bytes] = None,
422        crv: Optional[Union[str, "JsonWebKeyCurveName"]] = None,
423        x: Optional[bytes] = None,
424        y: Optional[bytes] = None,
425        **kwargs
426    ):
427        super(JsonWebKey, self).__init__(**kwargs)
428        self.kid = kid
429        self.kty = kty
430        self.key_ops = key_ops
431        self.n = n
432        self.e = e
433        self.d = d
434        self.dp = dp
435        self.dq = dq
436        self.qi = qi
437        self.p = p
438        self.q = q
439        self.k = k
440        self.t = t
441        self.crv = crv
442        self.x = x
443        self.y = y
444
445
446class KeyAttributes(Attributes):
447    """The attributes of a key managed by the key vault service.
448
449    Variables are only populated by the server, and will be ignored when sending a request.
450
451    :param enabled: Determines whether the object is enabled.
452    :type enabled: bool
453    :param not_before: Not before date in UTC.
454    :type not_before: ~datetime.datetime
455    :param expires: Expiry date in UTC.
456    :type expires: ~datetime.datetime
457    :ivar created: Creation time in UTC.
458    :vartype created: ~datetime.datetime
459    :ivar updated: Last updated time in UTC.
460    :vartype updated: ~datetime.datetime
461    :ivar recoverable_days: softDelete data retention days. Value should be >=7 and <=90 when
462     softDelete enabled, otherwise 0.
463    :vartype recoverable_days: int
464    :ivar recovery_level: Reflects the deletion recovery level currently in effect for keys in the
465     current vault. If it contains 'Purgeable' the key can be permanently deleted by a privileged
466     user; otherwise, only the system can purge the key, at the end of the retention interval.
467     Possible values include: "Purgeable", "Recoverable+Purgeable", "Recoverable",
468     "Recoverable+ProtectedSubscription", "CustomizedRecoverable+Purgeable",
469     "CustomizedRecoverable", "CustomizedRecoverable+ProtectedSubscription".
470    :vartype recovery_level: str or ~azure.keyvault.v7_1.models.DeletionRecoveryLevel
471    """
472
473    _validation = {
474        'created': {'readonly': True},
475        'updated': {'readonly': True},
476        'recoverable_days': {'readonly': True},
477        'recovery_level': {'readonly': True},
478    }
479
480    _attribute_map = {
481        'enabled': {'key': 'enabled', 'type': 'bool'},
482        'not_before': {'key': 'nbf', 'type': 'unix-time'},
483        'expires': {'key': 'exp', 'type': 'unix-time'},
484        'created': {'key': 'created', 'type': 'unix-time'},
485        'updated': {'key': 'updated', 'type': 'unix-time'},
486        'recoverable_days': {'key': 'recoverableDays', 'type': 'int'},
487        'recovery_level': {'key': 'recoveryLevel', 'type': 'str'},
488    }
489
490    def __init__(
491        self,
492        *,
493        enabled: Optional[bool] = None,
494        not_before: Optional[datetime.datetime] = None,
495        expires: Optional[datetime.datetime] = None,
496        **kwargs
497    ):
498        super(KeyAttributes, self).__init__(enabled=enabled, not_before=not_before, expires=expires, **kwargs)
499        self.recoverable_days = None
500        self.recovery_level = None
501
502
503class KeyCreateParameters(msrest.serialization.Model):
504    """The key create parameters.
505
506    All required parameters must be populated in order to send to Azure.
507
508    :param kty: Required. The type of key to create. For valid values, see JsonWebKeyType. Possible
509     values include: "EC", "EC-HSM", "RSA", "RSA-HSM", "oct".
510    :type kty: str or ~azure.keyvault.v7_1.models.JsonWebKeyType
511    :param key_size: The key size in bits. For example: 2048, 3072, or 4096 for RSA.
512    :type key_size: int
513    :param key_ops:
514    :type key_ops: list[str or ~azure.keyvault.v7_1.models.JsonWebKeyOperation]
515    :param key_attributes: The attributes of a key managed by the key vault service.
516    :type key_attributes: ~azure.keyvault.v7_1.models.KeyAttributes
517    :param tags: A set of tags. Application specific metadata in the form of key-value pairs.
518    :type tags: dict[str, str]
519    :param curve: Elliptic curve name. For valid values, see JsonWebKeyCurveName. Possible values
520     include: "P-256", "P-384", "P-521", "P-256K".
521    :type curve: str or ~azure.keyvault.v7_1.models.JsonWebKeyCurveName
522    """
523
524    _validation = {
525        'kty': {'required': True},
526    }
527
528    _attribute_map = {
529        'kty': {'key': 'kty', 'type': 'str'},
530        'key_size': {'key': 'key_size', 'type': 'int'},
531        'key_ops': {'key': 'key_ops', 'type': '[str]'},
532        'key_attributes': {'key': 'attributes', 'type': 'KeyAttributes'},
533        'tags': {'key': 'tags', 'type': '{str}'},
534        'curve': {'key': 'crv', 'type': 'str'},
535    }
536
537    def __init__(
538        self,
539        *,
540        kty: Union[str, "JsonWebKeyType"],
541        key_size: Optional[int] = None,
542        key_ops: Optional[List[Union[str, "JsonWebKeyOperation"]]] = None,
543        key_attributes: Optional["KeyAttributes"] = None,
544        tags: Optional[Dict[str, str]] = None,
545        curve: Optional[Union[str, "JsonWebKeyCurveName"]] = None,
546        **kwargs
547    ):
548        super(KeyCreateParameters, self).__init__(**kwargs)
549        self.kty = kty
550        self.key_size = key_size
551        self.key_ops = key_ops
552        self.key_attributes = key_attributes
553        self.tags = tags
554        self.curve = curve
555
556
557class KeyImportParameters(msrest.serialization.Model):
558    """The key import parameters.
559
560    All required parameters must be populated in order to send to Azure.
561
562    :param hsm: Whether to import as a hardware key (HSM) or software key.
563    :type hsm: bool
564    :param key: Required. The Json web key.
565    :type key: ~azure.keyvault.v7_1.models.JsonWebKey
566    :param key_attributes: The key management attributes.
567    :type key_attributes: ~azure.keyvault.v7_1.models.KeyAttributes
568    :param tags: A set of tags. Application specific metadata in the form of key-value pairs.
569    :type tags: dict[str, str]
570    """
571
572    _validation = {
573        'key': {'required': True},
574    }
575
576    _attribute_map = {
577        'hsm': {'key': 'Hsm', 'type': 'bool'},
578        'key': {'key': 'key', 'type': 'JsonWebKey'},
579        'key_attributes': {'key': 'attributes', 'type': 'KeyAttributes'},
580        'tags': {'key': 'tags', 'type': '{str}'},
581    }
582
583    def __init__(
584        self,
585        *,
586        key: "JsonWebKey",
587        hsm: Optional[bool] = None,
588        key_attributes: Optional["KeyAttributes"] = None,
589        tags: Optional[Dict[str, str]] = None,
590        **kwargs
591    ):
592        super(KeyImportParameters, self).__init__(**kwargs)
593        self.hsm = hsm
594        self.key = key
595        self.key_attributes = key_attributes
596        self.tags = tags
597
598
599class KeyListResult(msrest.serialization.Model):
600    """The key list result.
601
602    Variables are only populated by the server, and will be ignored when sending a request.
603
604    :ivar value: A response message containing a list of keys in the key vault along with a link to
605     the next page of keys.
606    :vartype value: list[~azure.keyvault.v7_1.models.KeyItem]
607    :ivar next_link: The URL to get the next set of keys.
608    :vartype next_link: str
609    """
610
611    _validation = {
612        'value': {'readonly': True},
613        'next_link': {'readonly': True},
614    }
615
616    _attribute_map = {
617        'value': {'key': 'value', 'type': '[KeyItem]'},
618        'next_link': {'key': 'nextLink', 'type': 'str'},
619    }
620
621    def __init__(
622        self,
623        **kwargs
624    ):
625        super(KeyListResult, self).__init__(**kwargs)
626        self.value = None
627        self.next_link = None
628
629
630class KeyOperationResult(msrest.serialization.Model):
631    """The key operation result.
632
633    Variables are only populated by the server, and will be ignored when sending a request.
634
635    :ivar kid: Key identifier.
636    :vartype kid: str
637    :ivar result:
638    :vartype result: bytes
639    """
640
641    _validation = {
642        'kid': {'readonly': True},
643        'result': {'readonly': True},
644    }
645
646    _attribute_map = {
647        'kid': {'key': 'kid', 'type': 'str'},
648        'result': {'key': 'value', 'type': 'base64'},
649    }
650
651    def __init__(
652        self,
653        **kwargs
654    ):
655        super(KeyOperationResult, self).__init__(**kwargs)
656        self.kid = None
657        self.result = None
658
659
660class KeyOperationsParameters(msrest.serialization.Model):
661    """The key operations parameters.
662
663    All required parameters must be populated in order to send to Azure.
664
665    :param algorithm: Required. algorithm identifier. Possible values include: "RSA-OAEP",
666     "RSA-OAEP-256", "RSA1_5".
667    :type algorithm: str or ~azure.keyvault.v7_1.models.JsonWebKeyEncryptionAlgorithm
668    :param value: Required.
669    :type value: bytes
670    """
671
672    _validation = {
673        'algorithm': {'required': True},
674        'value': {'required': True},
675    }
676
677    _attribute_map = {
678        'algorithm': {'key': 'alg', 'type': 'str'},
679        'value': {'key': 'value', 'type': 'base64'},
680    }
681
682    def __init__(
683        self,
684        *,
685        algorithm: Union[str, "JsonWebKeyEncryptionAlgorithm"],
686        value: bytes,
687        **kwargs
688    ):
689        super(KeyOperationsParameters, self).__init__(**kwargs)
690        self.algorithm = algorithm
691        self.value = value
692
693
694class KeyProperties(msrest.serialization.Model):
695    """Properties of the key pair backing a certificate.
696
697    :param exportable: Not supported in this version. Indicates if the private key can be exported.
698    :type exportable: bool
699    :param key_type: The type of key pair to be used for the certificate. Possible values include:
700     "EC", "EC-HSM", "RSA", "RSA-HSM", "oct".
701    :type key_type: str or ~azure.keyvault.v7_1.models.JsonWebKeyType
702    :param key_size: The key size in bits. For example: 2048, 3072, or 4096 for RSA.
703    :type key_size: int
704    :param reuse_key: Indicates if the same key pair will be used on certificate renewal.
705    :type reuse_key: bool
706    :param curve: Elliptic curve name. For valid values, see JsonWebKeyCurveName. Possible values
707     include: "P-256", "P-384", "P-521", "P-256K".
708    :type curve: str or ~azure.keyvault.v7_1.models.JsonWebKeyCurveName
709    """
710
711    _attribute_map = {
712        'exportable': {'key': 'exportable', 'type': 'bool'},
713        'key_type': {'key': 'kty', 'type': 'str'},
714        'key_size': {'key': 'key_size', 'type': 'int'},
715        'reuse_key': {'key': 'reuse_key', 'type': 'bool'},
716        'curve': {'key': 'crv', 'type': 'str'},
717    }
718
719    def __init__(
720        self,
721        *,
722        exportable: Optional[bool] = None,
723        key_type: Optional[Union[str, "JsonWebKeyType"]] = None,
724        key_size: Optional[int] = None,
725        reuse_key: Optional[bool] = None,
726        curve: Optional[Union[str, "JsonWebKeyCurveName"]] = None,
727        **kwargs
728    ):
729        super(KeyProperties, self).__init__(**kwargs)
730        self.exportable = exportable
731        self.key_type = key_type
732        self.key_size = key_size
733        self.reuse_key = reuse_key
734        self.curve = curve
735
736
737class KeyRestoreParameters(msrest.serialization.Model):
738    """The key restore parameters.
739
740    All required parameters must be populated in order to send to Azure.
741
742    :param key_bundle_backup: Required. The backup blob associated with a key bundle.
743    :type key_bundle_backup: bytes
744    """
745
746    _validation = {
747        'key_bundle_backup': {'required': True},
748    }
749
750    _attribute_map = {
751        'key_bundle_backup': {'key': 'value', 'type': 'base64'},
752    }
753
754    def __init__(
755        self,
756        *,
757        key_bundle_backup: bytes,
758        **kwargs
759    ):
760        super(KeyRestoreParameters, self).__init__(**kwargs)
761        self.key_bundle_backup = key_bundle_backup
762
763
764class KeySignParameters(msrest.serialization.Model):
765    """The key operations parameters.
766
767    All required parameters must be populated in order to send to Azure.
768
769    :param algorithm: Required. The signing/verification algorithm identifier. For more information
770     on possible algorithm types, see JsonWebKeySignatureAlgorithm. Possible values include:
771     "PS256", "PS384", "PS512", "RS256", "RS384", "RS512", "RSNULL", "ES256", "ES384", "ES512",
772     "ES256K".
773    :type algorithm: str or ~azure.keyvault.v7_1.models.JsonWebKeySignatureAlgorithm
774    :param value: Required.
775    :type value: bytes
776    """
777
778    _validation = {
779        'algorithm': {'required': True},
780        'value': {'required': True},
781    }
782
783    _attribute_map = {
784        'algorithm': {'key': 'alg', 'type': 'str'},
785        'value': {'key': 'value', 'type': 'base64'},
786    }
787
788    def __init__(
789        self,
790        *,
791        algorithm: Union[str, "JsonWebKeySignatureAlgorithm"],
792        value: bytes,
793        **kwargs
794    ):
795        super(KeySignParameters, self).__init__(**kwargs)
796        self.algorithm = algorithm
797        self.value = value
798
799
800class KeyUpdateParameters(msrest.serialization.Model):
801    """The key update parameters.
802
803    :param key_ops: Json web key operations. For more information on possible key operations, see
804     JsonWebKeyOperation.
805    :type key_ops: list[str or ~azure.keyvault.v7_1.models.JsonWebKeyOperation]
806    :param key_attributes: The attributes of a key managed by the key vault service.
807    :type key_attributes: ~azure.keyvault.v7_1.models.KeyAttributes
808    :param tags: A set of tags. Application specific metadata in the form of key-value pairs.
809    :type tags: dict[str, str]
810    """
811
812    _attribute_map = {
813        'key_ops': {'key': 'key_ops', 'type': '[str]'},
814        'key_attributes': {'key': 'attributes', 'type': 'KeyAttributes'},
815        'tags': {'key': 'tags', 'type': '{str}'},
816    }
817
818    def __init__(
819        self,
820        *,
821        key_ops: Optional[List[Union[str, "JsonWebKeyOperation"]]] = None,
822        key_attributes: Optional["KeyAttributes"] = None,
823        tags: Optional[Dict[str, str]] = None,
824        **kwargs
825    ):
826        super(KeyUpdateParameters, self).__init__(**kwargs)
827        self.key_ops = key_ops
828        self.key_attributes = key_attributes
829        self.tags = tags
830
831
832class KeyVaultError(msrest.serialization.Model):
833    """The key vault error exception.
834
835    Variables are only populated by the server, and will be ignored when sending a request.
836
837    :ivar error: The key vault server error.
838    :vartype error: ~azure.keyvault.v7_1.models.Error
839    """
840
841    _validation = {
842        'error': {'readonly': True},
843    }
844
845    _attribute_map = {
846        'error': {'key': 'error', 'type': 'Error'},
847    }
848
849    def __init__(
850        self,
851        **kwargs
852    ):
853        super(KeyVaultError, self).__init__(**kwargs)
854        self.error = None
855
856
857class KeyVerifyParameters(msrest.serialization.Model):
858    """The key verify parameters.
859
860    All required parameters must be populated in order to send to Azure.
861
862    :param algorithm: Required. The signing/verification algorithm. For more information on
863     possible algorithm types, see JsonWebKeySignatureAlgorithm. Possible values include: "PS256",
864     "PS384", "PS512", "RS256", "RS384", "RS512", "RSNULL", "ES256", "ES384", "ES512", "ES256K".
865    :type algorithm: str or ~azure.keyvault.v7_1.models.JsonWebKeySignatureAlgorithm
866    :param digest: Required. The digest used for signing.
867    :type digest: bytes
868    :param signature: Required. The signature to be verified.
869    :type signature: bytes
870    """
871
872    _validation = {
873        'algorithm': {'required': True},
874        'digest': {'required': True},
875        'signature': {'required': True},
876    }
877
878    _attribute_map = {
879        'algorithm': {'key': 'alg', 'type': 'str'},
880        'digest': {'key': 'digest', 'type': 'base64'},
881        'signature': {'key': 'value', 'type': 'base64'},
882    }
883
884    def __init__(
885        self,
886        *,
887        algorithm: Union[str, "JsonWebKeySignatureAlgorithm"],
888        digest: bytes,
889        signature: bytes,
890        **kwargs
891    ):
892        super(KeyVerifyParameters, self).__init__(**kwargs)
893        self.algorithm = algorithm
894        self.digest = digest
895        self.signature = signature
896
897
898class KeyVerifyResult(msrest.serialization.Model):
899    """The key verify result.
900
901    Variables are only populated by the server, and will be ignored when sending a request.
902
903    :ivar value: True if the signature is verified, otherwise false.
904    :vartype value: bool
905    """
906
907    _validation = {
908        'value': {'readonly': True},
909    }
910
911    _attribute_map = {
912        'value': {'key': 'value', 'type': 'bool'},
913    }
914
915    def __init__(
916        self,
917        **kwargs
918    ):
919        super(KeyVerifyResult, self).__init__(**kwargs)
920        self.value = None
921