pub struct VepPacket<'a> { /* private fields */ }Expand description
A high-level view of a VEP packet using zero-copy references.
Implementations§
Source§impl<'a> VepPacket<'a>
impl<'a> VepPacket<'a>
pub fn new(buffer: &'a [u8]) -> Result<Self, &'static str>
pub fn header(&self) -> &VepHeader
Sourcepub fn get_segment_data(&self, segment_type: VepSegmentType) -> Option<&[u8]>
pub fn get_segment_data(&self, segment_type: VepSegmentType) -> Option<&[u8]>
Iterates through segments in the encrypted payload. In Phase 5.3, the segments are stored in a TLV format inside the payload.
Sourcepub fn verify(&self, chora_public_key_bytes: &[u8]) -> Result<bool, String>
pub fn verify(&self, chora_public_key_bytes: &[u8]) -> Result<bool, String>
Verifies the cryptographic integrity of the packet against a CHORA public key. (Phase 3.2)
Following the CHORA Capsule v1 Spec: The signature is over the capsule_root.
Sourcepub fn to_capsule(&self) -> Result<Capsule, String>
pub fn to_capsule(&self) -> Result<Capsule, String>
Reconstructs a full VEX Capsule from the VEP segments.
Auto Trait Implementations§
impl<'a> Freeze for VepPacket<'a>
impl<'a> RefUnwindSafe for VepPacket<'a>
impl<'a> Send for VepPacket<'a>
impl<'a> Sync for VepPacket<'a>
impl<'a> Unpin for VepPacket<'a>
impl<'a> UnsafeUnpin for VepPacket<'a>
impl<'a> UnwindSafe for VepPacket<'a>
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
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
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