Skip to main content

RotatedNodeCert

Struct RotatedNodeCert 

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

The outcome of a machine-key rotation (NodeCert::rotate): the retiring previous identity and the freshly minted current one.

Because peer_id = SHA-256(SPKI DER) and the SPKI commits the BLS binding, a rotation mints a brand-new key pair and therefore a brand-new peer_id — this is an IDENTITY CHANGE, not a cert renewal. dig-tls is a library and does NOT do networking; it hands back BOTH identities so the CALLER (dig-node) can dual-present — keep accepting inbound on the old peer_id while it re-announces the new peer_id to DHT/PEX/relay — then call retire_previous once the re-announce converges.

The derived Debug renders only each identity’s redacting NodeCert Debug — never key bytes.

Implementations§

Source§

impl RotatedNodeCert

Source

pub fn previous(&self) -> &NodeCert

The retiring identity. Present it (and accept inbound on its peer_id) during the overlap window, until the caller’s re-announce converges and it calls retire_previous.

Source

pub fn current(&self) -> &NodeCert

The freshly minted identity to advertise going forward.

Source

pub fn into_current(self) -> NodeCert

Consume the rotation, keeping only the new current identity (drops + scrubs the previous key).

Trait Implementations§

Source§

impl Debug for RotatedNodeCert

Source§

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

Formats the value using the given formatter. Read more

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<'a, T, E> AsTaggedExplicit<'a, E> for T
where T: 'a,

Source§

fn explicit(self, class: Class, tag: u32) -> TaggedParser<'a, Explicit, Self, E>

Source§

impl<'a, T, E> AsTaggedImplicit<'a, E> for T
where T: 'a,

Source§

fn implicit( self, class: Class, constructed: bool, tag: u32, ) -> TaggedParser<'a, Implicit, Self, E>

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 = 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.