RemoteCdm

class RemoteCdm(client: HttpClient, baseUrl: String, deviceName: String, secret: String, expectedSystemId: Int? = null, expectedSecurityLevel: Int? = null) : CdmApi

A CdmApi backed by a pywidevine-compatible CDM server (pywidevine serve).

The device's private key never reaches this process — every operation is an HTTP call, so one server can hold the device while many clients use it.

The caller supplies the HttpClient, which keeps this module free of any engine choice:

val cdm = RemoteCdm(
client = HttpClient(CIO),
baseUrl = "https://cdm.example.com",
deviceName = "generic_android_device",
secret = "your-api-key",
)

Parameters

baseUrl

the server root, with or without a trailing slash

deviceName

the device the server should use, as named in its config

secret

the value sent as the X-Secret-Key header

expectedSystemId

if given, open rejects a server whose device reports a different Widevine system id

expectedSecurityLevel

if given, open rejects a server whose device reports a different security level

Constructors

Link copied to clipboard
constructor(client: HttpClient, baseUrl: String, deviceName: String, secret: String, expectedSystemId: Int? = null, expectedSecurityLevel: Int? = null)

Properties

Link copied to clipboard

Security level the server reports for deviceName. Populated by the first open.

Link copied to clipboard

System id the server reports for deviceName. Populated by the first open.

Functions

Link copied to clipboard
open suspend override fun close(sessionId: ByteString)
Link copied to clipboard
open suspend override fun getKeys(sessionId: ByteString, type: License.KeyContainer.KeyType?): List<Key>
Link copied to clipboard
open suspend override fun getLicenseChallenge(sessionId: ByteString, pssh: PSSH, licenseType: LicenseType, privacyMode: Boolean, requestType: LicenseRequest.RequestType): ByteArray
Link copied to clipboard
open suspend override fun getServiceCertificateBase64(sessionId: ByteString): String?
Link copied to clipboard
open suspend override fun open(): ByteString
Link copied to clipboard
open suspend override fun parseLicense(sessionId: ByteString, licenseMessage: ByteArray)
Link copied to clipboard
open suspend override fun setServiceCertificate(sessionId: ByteString, certificateBase64: String?): String?