pywidevine/pywidevine/session.py
rlaphoenix 0c85abb2d4 Cdm: Save Service Certificate in SignedMessage form
We may need the signature for external verification, and most APIs require it to be in a SignedMessage to be accepted, even though the SignedMessage is pretty much empty (not even actually signed lol).
2022-08-02 01:48:48 +01:00

15 lines
401 B
Python

from typing import Optional
from Crypto.Random import get_random_bytes
from pywidevine.key import Key
from pywidevine.license_protocol_pb2 import SignedMessage
class Session:
def __init__(self):
self.id = get_random_bytes(16)
self.service_certificate: Optional[SignedMessage] = None
self.context: dict[bytes, tuple[bytes, bytes]] = {}
self.keys: list[Key] = []