Cdm
Widevine CDM helper that can:
open/close sessions
build signed license requests from a PSSH
parse signed license responses and expose decrypted Keys
Typical flow:
Construct from a Widevine Device via fromDevice
open a session and optionally setServiceCertificate
Build a license challenge with getLicenseChallenge
Send the challenge to a license server (not provided by this library)
Parse the response with parseLicense
This class is Kotlin Multiplatform and uses the same protobuf models as pywidevine.
Properties
Functions
Unwrap the content keys carried by an ENTITLED_KEY PSSH.
The license parsed by the most recent parseLicense call for this session, or null when none has been parsed.
Build and sign a Widevine license request for the provided pssh. Stores internal request context needed to later parseLicense for this session.
The service certificate set for the session, re-encoded as Base64, or null.
Parse and verify a Widevine license response for the provided sessionId. This consumes the previously stored request context created by getLicenseChallenge, decrypts contained keys and stores them on the session.
Set or clear a service certificate for a session. When set and privacyMode is true in getLicenseChallenge, the client_id will be encrypted with this certificate as per Widevine privacy mode.
Overload of setServiceCertificate accepting a Base64-encoded certificate string. Pass null to clear the currently set certificate.