pub struct SecureContext { /* private fields */ }Expand description
Manages secure content decryption context.
Implementations§
Source§impl SecureContext
impl SecureContext
pub fn new( keystore: KeyStore, private_key: RsaPrivateKey, resource_key_map: HashMap<String, Uuid>, consumer_id: String, ) -> Self
Sourcepub fn decrypt_entry(
&mut self,
archiver: &mut impl ArchiveReader,
path: &str,
) -> Result<Option<Vec<u8>>>
pub fn decrypt_entry( &mut self, archiver: &mut impl ArchiveReader, path: &str, ) -> Result<Option<Vec<u8>>>
Reads and decrypts an entry from the archive if it is covered by the KeyStore.
If the path is not encrypted (not in map), returns None (or error if strictly checking?).
Recommended: Return Ok(Some(data)) if decrypted, Ok(None) if not encrypted, Err if failure.
Auto Trait Implementations§
impl Freeze for SecureContext
impl RefUnwindSafe for SecureContext
impl Send for SecureContext
impl Sync for SecureContext
impl Unpin for SecureContext
impl UnwindSafe for SecureContext
Blanket Implementations§
§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
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
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more