forked from LBRYCommunity/lbry-sdk
11 lines
No EOL
412 B
Python
11 lines
No EOL
412 B
Python
import struct
|
|
from collections import namedtuple
|
|
from .flags import SignatureSerializationFlag
|
|
|
|
|
|
class Signature(namedtuple("Signature", "flags signature certificate_id")):
|
|
def deserialize(cls, payload):
|
|
flag = struct.unpack("<b", payload[0])[0]
|
|
if not SignatureSerializationFlag.is_flag_valid(flag):
|
|
return Signature(SignatureSerializationFlag.ECDSA_LEGACY, )
|
|
certificate |