# Generated by the protocol buffer compiler.  DO NOT EDIT!
# sources: pbmse/v1/pbmse.proto
# plugin: python-betterproto
from dataclasses import dataclass
from typing import List

import betterproto
from betterproto.grpc.grpclib_server import ServiceBase


class EncryptionMode(betterproto.Enum):
    ENCRYPTION_MODE_UNSPECIFIED = 0
    ENCRYPTION_MODE_DIRECT = 1
    ENCRYPTION_MODE_CONTENT_ENCRYPTION_KEY = 2


class EncryptionAlgorithm(betterproto.Enum):
    ENCRYPTION_ALGORITHM_UNSPECIFIED = 0
    ENCRYPTION_ALGORITHM_XCHACHA20POLY1305 = 1
    ENCRYPTION_ALGORITHM_AES_GCM = 2


@dataclass(eq=False, repr=False)
class SignedMessage(betterproto.Message):
    """JWS Protocol buffer message signing and encryption"""

    payload: bytes = betterproto.bytes_field(1)
    signatures: List["Signature"] = betterproto.message_field(2)


@dataclass(eq=False, repr=False)
class Signature(betterproto.Message):
    header: bytes = betterproto.bytes_field(1)
    signature: bytes = betterproto.bytes_field(3)


@dataclass(eq=False, repr=False)
class SignatureHeader(betterproto.Message):
    algorithm: str = betterproto.string_field(1)
    key_id: str = betterproto.string_field(2)


@dataclass(eq=False, repr=False)
class EncryptedMessage(betterproto.Message):
    iv: bytes = betterproto.bytes_field(1)
    aad: bytes = betterproto.bytes_field(2)
    ciphertext: bytes = betterproto.bytes_field(3)
    tag: bytes = betterproto.bytes_field(4)
    recipients: List["EncryptionRecipient"] = betterproto.message_field(5)


@dataclass(eq=False, repr=False)
class EncryptionHeader(betterproto.Message):
    mode: "EncryptionMode" = betterproto.enum_field(1)
    algorithm: "EncryptionAlgorithm" = betterproto.enum_field(2)
    key_id: str = betterproto.string_field(3)
    sender_key_id: str = betterproto.string_field(4)


@dataclass(eq=False, repr=False)
class EncryptionRecipient(betterproto.Message):
    header: "EncryptionHeader" = betterproto.message_field(1)
    content_encryption_key: bytes = betterproto.bytes_field(2)
