pub struct LASecret { /* private fields */ }Expand description
Managed wrapper around Apple’s LASecret.
Implementations§
Source§impl LASecret
impl LASecret
Sourcepub fn load_data(&self) -> Result<Vec<u8>>
pub fn load_data(&self) -> Result<Vec<u8>>
Examples found in repository?
examples/08_persisted_right.rs (line 23)
12fn main() -> Result<(), Box<dyn std::error::Error>> {
13 let store = LARightStore::shared()?;
14 let right = LARight::new()?;
15 let identifier = unique_identifier("persisted");
16
17 match store.save_right_with_secret(&right, &identifier, b"top-secret") {
18 Ok(persisted) => {
19 persisted.set_tag(7)?;
20 println!("persisted state: {:?}", persisted.state()?);
21 println!("persisted tag: {}", persisted.tag()?);
22 println!("persisted preflight: {:?}", persisted.check_can_authorize());
23 println!("secret bytes: {}", persisted.secret()?.load_data()?.len());
24 store.remove_right(&persisted)?;
25 }
26 Err(error) => {
27 println!("persisted-right APIs need entitlements on many systems: {error}");
28 }
29 }
30
31 println!("✅ persisted-right smoke OK");
32 Ok(())
33}Trait Implementations§
Auto Trait Implementations§
impl Freeze for LASecret
impl RefUnwindSafe for LASecret
impl !Send for LASecret
impl !Sync for LASecret
impl Unpin for LASecret
impl UnsafeUnpin for LASecret
impl UnwindSafe for LASecret
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