datumaro.components.crypter#

Classes

Crypter(key)

NullCrypter()

class datumaro.components.crypter.Crypter(key: str | bytes)[source]#

Bases: object

FERNET_KEY_LEN = 50#
KEY_PREFIX = b'datum-'#
KEY_PREFIX_LEN = 6#
property key: bytes#
decrypt(msg: bytes) bytes[source]#
encrypt(msg: bytes) bytes[source]#
handshake(key: bytes) bool[source]#
classmethod gen_key(key: bytes | None = None) bytes[source]#

If “key” is not None, return the different key with “key”.

property is_null_crypter#
class datumaro.components.crypter.NullCrypter[source]#

Bases: Crypter

decrypt(msg: bytes) bytes[source]#
encrypt(msg: bytes) bytes[source]#
handshake(key: bytes) bool[source]#
property key: None#