pub struct Device { /* private fields */ }Expand description
Widevine device
Implementations§
Source§impl Device
impl Device
Sourcepub fn new(
device_type: DeviceType,
security_level: SecurityLevel,
private_key: RsaPrivateKey,
client_id: &[u8],
) -> Result<Self, Error>
pub fn new( device_type: DeviceType, security_level: SecurityLevel, private_key: RsaPrivateKey, client_id: &[u8], ) -> Result<Self, Error>
Create a new Widevine device
Sourcepub fn read_wvd<R: Read>(reader: R) -> Result<Self, Error>
pub fn read_wvd<R: Read>(reader: R) -> Result<Self, Error>
Read a Widevine device from a .wvd file, as used by pywidevine
let file = File::open(&path).unwrap();
let device = Device::read_wvd(BufReader::new(file)).unwrap();Sourcepub fn write_wvd<W: Write>(&self, writer: W) -> Result<(), Error>
pub fn write_wvd<W: Write>(&self, writer: W) -> Result<(), Error>
Write a Widevine device to a .wvd file, as used by pywidevine
let mut file = File::create(&dest_path).unwrap();
device.write_wvd(BufWriter::new(file)).unwrap();Sourcepub fn device_type(&self) -> DeviceType
pub fn device_type(&self) -> DeviceType
Get the device type (Chrome/Android) of the Widevine device
assert_eq!(device.device_type(), DeviceType::ANDROID);Sourcepub fn security_level(&self) -> SecurityLevel
pub fn security_level(&self) -> SecurityLevel
Get the security level (L1-3) of the Widevine device
assert_eq!(device.security_level(), SecurityLevel::L3);Sourcepub fn metadata(&self) -> ClientMetadata
pub fn metadata(&self) -> ClientMetadata
Get the full metadata of the Widevine device
Trait Implementations§
Auto Trait Implementations§
impl !Freeze for Device
impl RefUnwindSafe for Device
impl Send for Device
impl Sync for Device
impl Unpin for Device
impl UnwindSafe for Device
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