pub struct SigHeaders {
pub sig_b64: Option<String>,
pub kid: Option<String>,
pub alg: Option<String>,
pub at_ms: Option<String>,
}Expand description
The signature headers carried alongside a message body.
Extracted from the transport by the caller so this module stays free of a NATS dependency and is testable without a broker.
Fields§
§sig_b64: Option<String>§kid: Option<String>§alg: Option<String>§at_ms: Option<String>Decimal milliseconds since the Unix epoch, as sent. Parsed rather than trusted — it is covered by the signature, so a value that does not reconstruct the signed material simply fails verification.
Implementations§
Source§impl SigHeaders
impl SigHeaders
Sourcepub fn is_absent(&self) -> bool
pub fn is_absent(&self) -> bool
True only when the message makes no signing claim at all.
Any one of these headers means the sender is asserting the message is
signed, so a partial set is a broken claim rather than an absent one.
alg counts for the same reason kid does: the rule has to be “no
signing headers at all”, not “none of the two I happened to think of”,
or stripping whichever header is unchecked reclassifies a malformed
message as an unsigned one — and unsigned is the accepted case for the
whole of stages 1-2.
Trait Implementations§
Source§impl Clone for SigHeaders
impl Clone for SigHeaders
Source§fn clone(&self) -> SigHeaders
fn clone(&self) -> SigHeaders
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for SigHeaders
impl Debug for SigHeaders
Source§impl Default for SigHeaders
impl Default for SigHeaders
Source§fn default() -> SigHeaders
fn default() -> SigHeaders
impl Eq for SigHeaders
Source§impl PartialEq for SigHeaders
impl PartialEq for SigHeaders
impl StructuralPartialEq for SigHeaders
Auto Trait Implementations§
impl Freeze for SigHeaders
impl RefUnwindSafe for SigHeaders
impl Send for SigHeaders
impl Sync for SigHeaders
impl Unpin for SigHeaders
impl UnsafeUnpin for SigHeaders
impl UnwindSafe for SigHeaders
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.