pub struct Cdm { /* private fields */ }Expand description
Provides the core functionality of PlayReady CDM.
The easiest way to construct it is to use Cdm::from_device() function.
Implementations§
Source§impl Cdm
impl Cdm
Sourcepub fn from_device(device: Device) -> Self
pub fn from_device(device: Device) -> Self
Creates CDM from the Device.
Sourcepub fn with_initial_revocation_list_infos(
self,
rev_list_infos: RevocationListInfos,
) -> Self
pub fn with_initial_revocation_list_infos( self, rev_list_infos: RevocationListInfos, ) -> Self
Sets initial revocation list infos.
Sourcepub fn get_current_revocation_list_infos(&self) -> Option<RevocationListInfos>
pub fn get_current_revocation_list_infos(&self) -> Option<RevocationListInfos>
Returns current revocation list infos (after they are parsed from challenge response).
Sourcepub fn get_license_challenge(
&self,
wrm_header: WrmHeader,
custom_data: Option<String>,
) -> Result<String, Error>
pub fn get_license_challenge( &self, wrm_header: WrmHeader, custom_data: Option<String>, ) -> Result<String, Error>
Generates XML containing license acquisition challenge. XML prolog is deliberately missing as sometimes challenge XML is embedded in JSON.
§Arguments
wrm_header - header usually extracted from crate::pssh::Pssh
custom_data - optional custom data. WARNING: content of custom_data is NOT escaped. Passing malformed string may cause to produce invalid XML
Sourcepub fn get_keys_from_challenge_response(
&self,
response: &str,
) -> Result<Vec<(KeyId, ContentKey)>, Error>
pub fn get_keys_from_challenge_response( &self, response: &str, ) -> Result<Vec<(KeyId, ContentKey)>, Error>
Parses response (usually got from the license server) and returns vector of KID and key tuples.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Cdm
impl RefUnwindSafe for Cdm
impl Send for Cdm
impl Sync for Cdm
impl Unpin for Cdm
impl UnsafeUnpin for Cdm
impl UnwindSafe for Cdm
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more