Skip to main content

FileGrant

Struct FileGrant 

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

No Debug, Serialize, or public key accessor: exporting a grant must be explicit.

Implementations§

Source§

impl FileGrant

Source

pub fn descriptor(&self) -> &FileDescriptor

Source

pub fn chunk_count(&self) -> u32

Source

pub fn ciphertext_len(&self, index: u32) -> Result<usize>

Source

pub fn ciphertext_bytes(&self) -> u64

Source

pub fn encode_private(&self) -> Result<Zeroizing<Vec<u8>>>

Secret output: only trusted local storage or an encrypted wire record.

Source

pub fn decode_private(bytes: &[u8]) -> Result<Self>

Call only after authenticating the enclosing message and its recipient.

Source

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.

Source

pub fn open(&self, chunks: &[Vec<u8>]) -> Result<Zeroizing<Vec<u8>>>

Auto Trait Implementations§

§

impl Forget for FileGrant

§

impl Freeze for FileGrant
where *const u8 is !null: Freeze, PhantomData<u8>: Freeze,

§

impl Move for FileGrant

§

impl RefUnwindSafe for FileGrant

§

impl Send for FileGrant
where RawVecInner: Send,

§

impl Sync for FileGrant
where RawVecInner: Sync,

§

impl Unpin for FileGrant
where *const u8 is !null: Unpin,

§

impl UnsafeUnpin for FileGrant

§

impl UnwindSafe for FileGrant
where RawVecInner: UnwindSafe,

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> 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, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

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

fn try_from(value: U) -> Result<T, !>

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.