rswidevine

Crates.iorswidevine
lib.rsrswidevine
version0.1.1
created_at2026-01-01 00:19:16.757991+00
updated_at2026-01-01 00:40:22.901686+00
descriptionWidevine CDM (Content Decryption Module) implementation in Rust.
homepagehttps://github.com/waki285/rswidevine
repositoryhttps://github.com/waki285/rswidevine
max_upload_size
id2015535
size360,938
すずねーう (waki285)

documentation

README

rswidevine

A Rust implementation of the Widevine CDM (Content Decryption Module) APIs and data formats. This project is a Rust port of pywidevine and is intended for authorized device/content validation and interoperability work.

Status

  • Actively porting the core functionality from pywidevine.
  • The CLI and library APIs are usable for device, PSSH, and license workflow validation.

Highlights

  • Parse/export Widevine device files (.wvd).
  • CDM session management and license processing.
  • PSSH parsing and generation (with optional PlayReady parsing).
  • Optional remote CDM client and HTTP serve API.
  • Tracing-based logging for CLI.

Install

cargo add rswidevine

Or build the repo directly:

cargo build

Usage (Library)

use rswidevine::device::Device;
use rswidevine::pssh::Pssh;

let device = Device::from_path("./device.wvd")?;
let pssh = Pssh::from_base64("<pssh_base64>")?;
let key_ids = pssh.key_ids()?;
# anyhow::Ok(())

Usage (CLI)

Build with the default cli feature:

cargo run --features cli -- --help

Examples:

# Inspect a device file
cargo run --features cli --example device_info ./device.wvd

# Inspect a PSSH (base64)
cargo run --features cli --example pssh_inspect <pssh_base64>

The CLI also provides helper subcommands for license requests, device creation/export, and basic CDM checks. See --help for full usage.

Feature Flags

Feature Description
cli CLI binary support (default).
tracing Tracing subscriber for CLI logs (default).
chrono Use chrono for date handling in CLI.
playready PlayReady XML parsing/conversion.
remote Remote CDM client support.
serve HTTP serve API.
full Enables cli, chrono, playready, remote, serve, tracing.

License

GPL-3.0-only. See LICENSE.

Legal / Ethical Use

This repository is intended for authorized testing and interoperability. Do not use it to bypass DRM or access content without permission.

Commit count: 0

cargo fmt