| 1 |
|
| 2 |
|
| 3 |
import datetime as dt |
| 4 |
import typing |
| 5 |
|
| 6 |
import pydantic |
| 7 |
from ..core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel |
| 8 |
from .encryption_key_state import EncryptionKeyState |
| 9 |
from .encryption_key_type import EncryptionKeyType |
| 10 |
|
| 11 |
|
| 12 |
class EncryptionKey(UniversalBaseModel): |
| 13 |
""" |
| 14 |
Encryption key |
| 15 |
""" |
| 16 |
|
| 17 |
kid: str = pydantic.Field() |
| 18 |
""" |
| 19 |
Key ID |
| 20 |
""" |
| 21 |
|
| 22 |
type: EncryptionKeyType |
| 23 |
state: EncryptionKeyState |
| 24 |
created_at: dt.datetime = pydantic.Field() |
| 25 |
""" |
| 26 |
Key creation timestamp |
| 27 |
""" |
| 28 |
|
| 29 |
updated_at: dt.datetime = pydantic.Field() |
| 30 |
""" |
| 31 |
Key update timestamp |
| 32 |
""" |
| 33 |
|
| 34 |
parent_kid: typing.Optional[str] = pydantic.Field(default=None) |
| 35 |
""" |
| 36 |
ID of parent wrapping key |
| 37 |
""" |
| 38 |
|
| 39 |
public_key: typing.Optional[str] = pydantic.Field(default=None) |
| 40 |
""" |
| 41 |
Public key in PEM format |
| 42 |
""" |
| 43 |
|
| 44 |
if IS_PYDANTIC_V2: |
| 45 |
model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) |
| 46 |
else: |
| 47 |
|
| 48 |
class Config: |
| 49 |
frozen = True |
| 50 |
smart_union = True |
| 51 |
extra = pydantic.Extra.allow |