Skip to main content

WriteObjectPrefix

Struct WriteObjectPrefix 

Source
pub struct WriteObjectPrefix {
    pub format: FormatVersion,
    pub store_key: KeyId,
    pub part_keys: Vec<KeyId>,
}
Expand description

Cleartext key identities, authenticated by the object’s final signature.

Fields§

§format: FormatVersion

The format fixed with these keys before the first upload attempt.

§store_key: KeyId

The store key sealing section 0, the header frame.

§part_keys: Vec<KeyId>

Keys of the audience parts in header order; section i + 1 uses entry i.

Implementations§

Source§

impl WriteObjectPrefix

Source

pub const MAX_HEADER_END: usize

Greatest permitted end of the clear prefix, sealed header, part roots and header signature (D1/D2, D9).

Source

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

Exact end of the header and its tail once its length field is available. A truncated prefix requires the caller’s second bounded read to use MAX_HEADER_END.

Source

pub fn tail_length(parts: usize) -> usize

Bytes of the part roots and header signature for this many parts.

Source

pub fn decode_tail(&self, bytes: &[u8]) -> Result<HeaderTail, Error>

Read exactly the part roots and header signature that follow the sealed header chunk.

Source

pub fn encoded_length(parts: usize) -> Result<usize, Error>

Exact prefix size for this many parts, before their key ids are selected.

Source

pub fn encode(&self) -> Result<Vec<u8>, Error>

Encode kind, version, header key and the counted list of part keys.

Source

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

Determine the complete prefix size from its first 23 bytes, before allocating the counted key list. This is not a plaintext frame prefix.

Source

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

Decode exactly the complete prefix, refusing trailing bytes.

Source

pub fn header_chunk_length(prefix: &[u8]) -> Result<usize, Error>

Bound the following header’s length prefix before fetching or allocating.

Source

pub fn header_chunk(piece: &[u8]) -> Result<&[u8], Error>

Read the length-prefixed sealed header. Open it with store_key, the object’s path, section 0 and index 0, then call Self::opened_header.

Source

pub fn opened_header( self, bytes: &[u8], part_lengths: Vec<u64>, ) -> Result<WriteObjectLayout, Error>

Begin part chunks after the caller authenticates and decodes the header and reads its tail. part_lengths must come from that header, in part order. This layer treats frame bytes as opaque; the header signature and the final signature still must be checked.

Trait Implementations§

Source§

impl Clone for WriteObjectPrefix

Source§

fn clone(&self) -> WriteObjectPrefix

Returns a duplicate 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 WriteObjectPrefix

Source§

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

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

impl PartialEq for WriteObjectPrefix

Source§

fn eq(&self, other: &WriteObjectPrefix) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl Eq for WriteObjectPrefix

Source§

impl StructuralPartialEq for WriteObjectPrefix

Auto Trait Implementations§

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, dest: *mut u8)

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

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

§

fn equivalent(&self, key: &K) -> bool

Checks if this value is equivalent to the given key. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

§

impl<T> Instrument for T

§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided [Span], returning an Instrumented wrapper. Read more
§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
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<T> WithSubscriber for T

§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a [WithDispatch] wrapper. Read more
§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a [WithDispatch] wrapper. Read more
§

impl<T> ErasedDestructor for T
where T: 'static,