widevine-rs
Rust implementation of Google's Widevine DRM CDM (Content Decryption Module). The CDM allows you to build applications that can access DRM-protected media.
This is a port of the pywidevine library by rlaphoenix.
To use the CDM you need a valid Google-provisioned Private Key and Client Identification blob (plain or bundled as a *.wvd file).
Example:
Bitmovin DRM demo video: https://bitmovin.com/demos/drm
use File;
use BufReader;
use ReadResponseExt;
use hex;
use ;
# let wvd_path = match var ;
// Instantiate a new CDM
let device = read_wvd.unwrap;
let cdm = new;
/// Create a new CDM request
let pssh = from_b64.unwrap;
let request = cdm
.open
.get_license_request
.unwrap;
let challenge = request.challenge.unwrap;
// Send the request to the license server
let mut resp = post.unwrap;
let resp_data = resp.bytes.unwrap;
// Decrypt the received keys and select the key with the required ID
let keys = request.get_keys.unwrap;
let key = keys.content_key.unwrap;
assert_eq!;