pub struct FileGrant { /* private fields */ }Expand description
No Debug, Serialize, or public key accessor: exporting a grant must be explicit.
Implementations§
Source§impl FileGrant
impl FileGrant
pub fn descriptor(&self) -> &FileDescriptor
pub fn chunk_count(&self) -> u32
pub fn ciphertext_len(&self, index: u32) -> Result<usize>
pub fn ciphertext_bytes(&self) -> u64
Sourcepub fn encode_private(&self) -> Result<Zeroizing<Vec<u8>>>
pub fn encode_private(&self) -> Result<Zeroizing<Vec<u8>>>
Secret output: only trusted local storage or an encrypted wire record.
Sourcepub fn decode_private(bytes: &[u8]) -> Result<Self>
pub fn decode_private(bytes: &[u8]) -> Result<Self>
Call only after authenticating the enclosing message and its recipient.
Sourcepub fn decrypt_chunk(
&self,
index: u32,
ciphertext: &[u8],
) -> Result<Zeroizing<Vec<u8>>>
pub fn decrypt_chunk( &self, index: u32, ciphertext: &[u8], ) -> Result<Zeroizing<Vec<u8>>>
Authenticating one chunk supports resumable downloads. Call open() before exposing a complete file; it also checks the whole-file SHA-256 digest.
pub fn open(&self, chunks: &[Vec<u8>]) -> Result<Zeroizing<Vec<u8>>>
Auto Trait Implementations§
impl Forget for FileGrant
impl Freeze for FileGrant
impl Move for FileGrant
impl RefUnwindSafe for FileGrant
impl Send for FileGrantwhere
RawVecInner: Send,
impl Sync for FileGrantwhere
RawVecInner: Sync,
impl Unpin for FileGrant
impl UnsafeUnpin for FileGrant
impl UnwindSafe for FileGrantwhere
RawVecInner: UnwindSafe,
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