pub struct KeyedPqTrustStore { /* private fields */ }Expand description
In-memory kid-anchored ML-DSA-65 trust store mapping an Ed25519 signer identity to its trusted ML-DSA-65 verifying key.
This is the authoritative anchor for the mesh/streaming/browser SNS composite. Bindings come from the node’s own hybrid identity and from attested peer identities. Entries MUST be established out-of-band (peer attestation / trust-store), never from the self-asserted COSE object.
Implementations§
Source§impl KeyedPqTrustStore
impl KeyedPqTrustStore
Sourcepub fn bind(&mut self, ed25519_pubkey: [u8; 32], ml_dsa_vk: &MlDsaVerifyingKey)
pub fn bind(&mut self, ed25519_pubkey: [u8; 32], ml_dsa_vk: &MlDsaVerifyingKey)
Bind an Ed25519 signer identity to its trusted ML-DSA-65 verifying key (stored as raw vk bytes; re-decoded on lookup).
Anchoring is monotonic and conflict-resistant: once an identity is bound to a specific ML-DSA-65 key, a subsequent attempt to bind it to a different key is refused (not silently overwritten). The same key re-registered is an idempotent no-op. This prevents a stale or hostile seeding source from silently substituting a different PQ identity for an already-anchored peer — the last writer does not win.
Sourcepub fn register(
&mut self,
ed25519_pubkey: [u8; 32],
ml_dsa_vk: Option<&MlDsaVerifyingKey>,
) -> bool
pub fn register( &mut self, ed25519_pubkey: [u8; 32], ml_dsa_vk: Option<&MlDsaVerifyingKey>, ) -> bool
Register an identity that may or may not carry a bound ML-DSA-65 key.
Anchoring is monotonic: a None key never clears or replaces an
anchor already established for that identity. Re-registering a
previously hybrid identity from a classical-only source (a legacy
bootstrap file, a re-enrollment that omitted the PQ half) therefore
cannot silently downgrade the peer back to classical.
Equally, a Some registration with a different PQ key than the one
already anchored is refused (see [bind]) — a rebind is not silent.
Returns whether the identity is anchored after the call.
Sourcepub fn is_anchored(&self, ed25519_pubkey: &[u8; 32]) -> bool
pub fn is_anchored(&self, ed25519_pubkey: &[u8; 32]) -> bool
Whether this identity has an anchored ML-DSA-65 key.
Trait Implementations§
Source§impl Default for KeyedPqTrustStore
impl Default for KeyedPqTrustStore
Source§fn default() -> KeyedPqTrustStore
fn default() -> KeyedPqTrustStore
Source§impl PqTrustStore for KeyedPqTrustStore
impl PqTrustStore for KeyedPqTrustStore
Source§fn ml_dsa_key_for(&self, ed25519_pubkey: &[u8; 32]) -> Option<MlDsaVerifyingKey>
fn ml_dsa_key_for(&self, ed25519_pubkey: &[u8; 32]) -> Option<MlDsaVerifyingKey>
None if no binding is known.Auto Trait Implementations§
impl Freeze for KeyedPqTrustStore
impl RefUnwindSafe for KeyedPqTrustStore
impl Send for KeyedPqTrustStore
impl Sync for KeyedPqTrustStore
impl Unpin for KeyedPqTrustStore
impl UnsafeUnpin for KeyedPqTrustStore
impl UnwindSafe for KeyedPqTrustStore
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<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§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>
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>
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