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 -
in DRM initialization data passed to the Encrypted Media Extension of a web browser
-
in an EXT-X-SESSION-KEY field of an m3u8 playlist.
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§
- irdeto
- Definitions for PSSH data in the Irdeto DRM system.
- nagra
- Definitions for PSSH data in the Nagra DRM system.
- playready
- Definitions for PSSH data in the PlayReady DRM system.
- widevine
- Definitions for PSSH data in the Widevine DRM system.
- wiseplay
- Definitions for PSSH data in the WisePlay DRM system.
Structs§
- DRMKey
Id - The Content Key or default_KID.
- DRMSystem
Id - The identifier for a DRM system.
- PsshBox
- A PSSH box, also called a ProtectionSystemSpecificHeaderBox in ISO 23001-7:2012.
- Pssh
BoxVec
Enums§
- Pssh
Data - Data in a PSSH box whose format is dependent on the DRM system used.
Constants§
- CENC_
SYSTEM_ ID - COMMON_
SYSTEM_ ID - FAIRPLAYNFLX_
SYSTEM_ ID - IRDETO_
SYSTEM_ ID - MARLIN_
SYSTEM_ ID - NAGRA_
SYSTEM_ ID - PLAYREADY_
SYSTEM_ ID - WIDEVINE_
SYSTEM_ ID - WISEPLAY_
SYSTEM_ ID
Traits§
Functions§
- find_
iter - Locate the positions of a PsshBox in a buffer, if present. Returns an iterator over start positions for PSSH boxes in the buffer.
- from_
base64 - Parse one or more PSSH boxes from some initialization data encoded in base64 format.
- from_
buffer - 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.
- from_
bytes - 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.
- from_
hex - Parse one or more PSSH boxes from some initialization data encoded in hex format.
- pprint
- Multiline pretty printing of a PsshBox (verbose alternative to
to_string()
method). - version
- The version of this crate.