Crate pssh_box

source ·
Expand description

Parsing and serialization support for pssh boxes, as used in DRM systems.

This crate defines Rust data structures allowing you to store, parse and serialize Protection System Specific Header (PSSH) boxes, which provide data for the initialization of a Digital Rights Management (DRM) system. PSSH boxes are used:

  • in an MP4 box of type pssh in an MP4 fragment (CMAF/MP4/ISOBMFF containers)

  • in a <cenc:pssh> element in a DASH MPD manifest

A PSSH box includes information for a single DRM system. This library supports the PSSH data formats for the following DRM systems:

  • Widevine, owned by Google, widely used for DASH streaming
  • PlayReady, owned by Microsoft, widely used for DASH streaming
  • WisePlay, owned by Huawei
  • Irdeto
  • Marlin
  • Nagra
  • FairPlay (the unofficial version used by Netflix)
  • Common Encryption

PSSH boxes contain (depending on the DRM system) information on the key_ID for which to obtain a content key, the encryption scheme used (e.g. cenc, cbc1, cens or cbcs), the URL of the licence server, and checksum data.

Modules§

  • Definitions for PSSH data in the Irdeto DRM system.
  • Definitions for PSSH data in the Nagra DRM system.
  • Definitions for PSSH data in the PlayReady DRM system.
  • Definitions for PSSH data in the Widevine DRM system.
  • Definitions for PSSH data in the WisePlay DRM system.

Structs§

Enums§

  • Data in a PSSH box whose format is dependent on the DRM system used.

Constants§

Traits§

Functions§

  • Locate the positions of a PsshBox in a buffer, if present. Returns an iterator over start positions for PSSH boxes in the buffer.
  • Parse one or more PSSH boxes from some initialization data encoded in base64 format.
  • Read one or more PSSH boxes from a slice of octets, stopping (but not returning an error) when non-PSSH data is found in the slice. An error is returned if the parsing fails.
  • Read one or more PSSH boxes from some initialization data provided as a slice of octets, returning an error if any non-PSSH data is found in the slice or if the parsing fails.
  • Parse one or more PSSH boxes from some initialization data encoded in hex format.
  • Multiline pretty printing of a PsshBox (verbose alternative to to_string() method).
  • The version of this crate.