HEX
Server: Apache
System: Linux iad1-shared-b8-33 6.6.49-grsec-jammy+ #10 SMP Thu Sep 12 23:23:08 UTC 2024 x86_64
User: samfetchero1 (10301780)
PHP: 8.1.33
Disabled: NONE
Upload Files
File: //usr/lib/python3/dist-packages/pymacaroons/field_encryptors/base_field_encryptor.py
from pymacaroons.utils import convert_to_bytes


class BaseFieldEncryptor(object):

    def __init__(self, signifier=None, nonce=None):
        self.signifier = signifier or ''
        self.nonce = nonce

    @property
    def signifier(self):
        return convert_to_bytes(self._signifier)

    @signifier.setter
    def signifier(self, string_or_bytes):
        self._signifier = convert_to_bytes(string_or_bytes)

    def encrypt(self, signature, field_data):
        raise NotImplementedError()

    def decrypt(self, signature, field_data):
        raise NotImplementedError()