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: FormatVersionThe format fixed with these keys before the first upload attempt.
store_key: KeyIdThe 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
impl WriteObjectPrefix
Sourcepub const MAX_HEADER_END: usize
pub const MAX_HEADER_END: usize
Greatest permitted end of the clear prefix, sealed header, part roots and header signature (D1/D2, D9).
Sourcepub fn header_end(bytes: &[u8]) -> Result<usize, Error>
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.
Sourcepub fn tail_length(parts: usize) -> usize
pub fn tail_length(parts: usize) -> usize
Bytes of the part roots and header signature for this many parts.
Sourcepub fn decode_tail(&self, bytes: &[u8]) -> Result<HeaderTail, Error>
pub fn decode_tail(&self, bytes: &[u8]) -> Result<HeaderTail, Error>
Read exactly the part roots and header signature that follow the sealed header chunk.
Sourcepub fn encoded_length(parts: usize) -> Result<usize, Error>
pub fn encoded_length(parts: usize) -> Result<usize, Error>
Exact prefix size for this many parts, before their key ids are selected.
Sourcepub fn encode(&self) -> Result<Vec<u8>, Error>
pub fn encode(&self) -> Result<Vec<u8>, Error>
Encode kind, version, header key and the counted list of part keys.
Sourcepub fn length(bytes: &[u8]) -> Result<usize, Error>
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.
Sourcepub fn decode(bytes: &[u8]) -> Result<Self, Error>
pub fn decode(bytes: &[u8]) -> Result<Self, Error>
Decode exactly the complete prefix, refusing trailing bytes.
Sourcepub fn header_chunk_length(prefix: &[u8]) -> Result<usize, Error>
pub fn header_chunk_length(prefix: &[u8]) -> Result<usize, Error>
Bound the following header’s length prefix before fetching or allocating.
Sourcepub fn header_chunk(piece: &[u8]) -> Result<&[u8], Error>
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.
Sourcepub fn opened_header(
self,
bytes: &[u8],
part_lengths: Vec<u64>,
) -> Result<WriteObjectLayout, Error>
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
impl Clone for WriteObjectPrefix
Source§fn clone(&self) -> WriteObjectPrefix
fn clone(&self) -> WriteObjectPrefix
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more