pub struct PinnedIdentity {
pub did: String,
pub public_key_hex: PublicKeyHex,
pub curve: CurveType,
pub kel_tip_said: Option<String>,
pub kel_sequence: Option<u128>,
pub first_seen: DateTime<Utc>,
pub origin: String,
pub trust_level: TrustLevel,
}Expand description
A pinned identity root — what we trusted and when.
This record stores the state of a trusted identity at the time of pinning, including KEL context for rotation-aware verification.
Fields§
§did: StringThe DID being pinned (e.g., “did:keri:EXq5…”)
public_key_hex: PublicKeyHexRoot public key, raw bytes stored as lowercase hex.
curve: CurveTypeCurve of the pinned key. Defaults to P-256 when absent (backward compat with pin files created before this field existed).
kel_tip_said: Option<String>KEL tip SAID at the time of pinning (enables rotation continuity check).
kel_sequence: Option<u128>KEL sequence number at time of pinning.
first_seen: DateTime<Utc>When this pin was created.
origin: StringWhere we learned this identity (repo URL, file path, “manual”, etc.)
trust_level: TrustLevelHow this pin was established.
Implementations§
Source§impl PinnedIdentity
impl PinnedIdentity
Sourcepub fn public_key_bytes(&self) -> Result<Vec<u8>, TrustError>
pub fn public_key_bytes(&self) -> Result<Vec<u8>, TrustError>
Decode the pinned public key to raw bytes.
Validates hex at construction; this should never fail on a well-formed pin.
Sourcepub fn key_matches(&self, presented_pk: &[u8]) -> Result<bool, TrustError>
pub fn key_matches(&self, presented_pk: &[u8]) -> Result<bool, TrustError>
Check if the pinned key matches the given raw bytes.
Comparison is always on decoded bytes, never on string representation. This handles case differences and other encoding variations.
Trait Implementations§
Source§impl Clone for PinnedIdentity
impl Clone for PinnedIdentity
Source§fn clone(&self) -> PinnedIdentity
fn clone(&self) -> PinnedIdentity
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more