larley 17c69027e0 + Added support for RevLists
+ Updated RemoteCdm/Serve to support RevLists
  + Added Storage class for RevList persistence
+ Added support for ExtData objects in BCerts + signature verification
+ Added an Xml Builder class (instead of xmltodict)
+ Added a SOAP Builder/Parser class (instead of xmltodict)
+ Refactored WRMHeader class to use ET (instead of xmltodict)
+ Upgraded ServerException detection
+ Removed dependencies: xmltodict, lxml
+ Added Util class
+ Minor Crypto/ElGamal class changes
2025-10-05 13:25:22 +02:00

23 lines
709 B
Python

from ecpy.curves import Point, Curve
from pyplayready.crypto.ecc_key import ECCKey
from pyplayready.system.util import Util
class XmlKey:
"""Represents a PlayReady XMLKey"""
def __init__(self):
self.curve = Curve.get_curve("secp256r1")
self._shared_point = ECCKey.generate()
self.shared_key_x = self._shared_point.key.pointQ.x
self.shared_key_y = self._shared_point.key.pointQ.y
self._shared_key_x_bytes = Util.to_bytes(int(self.shared_key_x))
self.aes_iv = self._shared_key_x_bytes[:16]
self.aes_key = self._shared_key_x_bytes[16:]
def get_point(self) -> Point:
return Point(self.shared_key_x, self.shared_key_y, self.curve)