playready::device

Struct Device

Source
pub struct Device { /* private fields */ }
Expand description

Represents PlayReady device. Usually created from .prd file.

Implementations§

Source§

impl Device

Source

pub fn new( group_key: Option<SigningKey>, encryption_key: Keypair<Generic<NistP256>>, signing_key: SigningKey, cert_chain: CertificateChain, ) -> Self

Creates new Device.

Source

pub fn from_bytes(bytes: &[u8]) -> Result<Self, Error>

Creates new Device from bytes.

Source

pub fn from_prd(path: impl AsRef<Path>) -> Result<Self, Error>

Creates new Device from .prd file.

§Arguments

path - path to .prd file

Source

pub fn signing_key(&self) -> &SigningKey

Returns device signing key.

Source

pub fn encryption_key(&self) -> &Keypair<Generic<NistP256>>

Returns device encryption key.

Source

pub fn group_certificate(&self) -> &[u8]

Returns device group certificate.

Source

pub fn group_key(&self) -> Option<&SigningKey>

Returns device group key.

Source

pub fn name(&self) -> Result<String, Error>

Returns name of the device parsed from certificate chain.

Source

pub fn security_level(&self) -> Result<u32, Error>

Returns security level (SL????) of the device parsed from certificate chain.

Source

pub fn verify_certificates(&self) -> Result<(), Error>

Performs signature verification of certificates bundled in CertificateChain.

Source

pub fn provision( cert_chain: CertificateChain, group_key: SigningKey, ) -> Result<Self, Error>

Creates and provisions device from certificate chain and group key.

Source

pub fn reprovision(self) -> Result<Self, Error>

Generates reprovisioned Device.

Source

pub fn provision_from_files( group_cert_path: impl AsRef<Path>, group_key_path: impl AsRef<Path>, ) -> Result<Self, Error>

Creates and provisions device from file containing certificate chain (usually named bgroupcert.dat) and file with group key (usually zgpriv.dat).

Source

pub fn write_to_file(&self, path: impl AsRef<Path>) -> Result<(), Error>

Serializes and writes device to file specified by path.

Trait Implementations§

Source§

impl Clone for Device

Source§

fn clone(&self) -> Device

Returns a copy of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for Device

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl TryFrom<&[u8]> for Device

Source§

type Error = Error

The type returned in the event of a conversion error.
Source§

fn try_from(value: &[u8]) -> Result<Self, Self::Error>

Performs the conversion.

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> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dst: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dst. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

§

fn vzip(self) -> V