pub struct TrustedKey {
pub key_id: String,
pub public_key: String,
}Expand description
An Ed25519 public key a host trusts for one provider.
public_key is lowercase hex rather than raw bytes for the reason
ProvenanceAttestation::signature is: one encoding across the whole
surface, and a key an operator can paste out of a provider’s README into a
config file without a base64 detour.
Fields§
§key_id: StringThe key_id an attestation must name to be checked against this key.
Rotation is a new key_id, never a reused one (SPEC.md §6.5), so a
store may hold several keys for one provider at once.
public_key: StringThe raw public key, lowercase hex.
Implementations§
Source§impl TrustedKey
impl TrustedKey
Sourcepub fn ed25519_hex(
key_id: impl Into<String>,
public_key: impl Into<String>,
) -> Option<Self>
pub fn ed25519_hex( key_id: impl Into<String>, public_key: impl Into<String>, ) -> Option<Self>
A trusted Ed25519 key from a key_id and a 64-character lowercase-hex
public key.
Returns None for anything that is not a well-formed Ed25519 public
key encoding, so a typo in a config file fails where a person is reading
the error rather than months later as an unexplained MalformedKey in
an audit.
Sourcepub fn ed25519_bytes(key_id: impl Into<String>, public_key: &[u8; 32]) -> Self
pub fn ed25519_bytes(key_id: impl Into<String>, public_key: &[u8; 32]) -> Self
A trusted Ed25519 key from raw public-key bytes — the form
contextgraph_types::public_key_for returns.
Sourcepub fn fingerprint(&self) -> Option<String>
pub fn fingerprint(&self) -> Option<String>
A sha256:<hex> fingerprint over the key bytes — the short string a host
shows a person next to the consent prompt, so “I consent to this
provider” and “I trust this key” are one decision (ADR 0016 §2).
Over the decoded bytes, so two spellings of the same key cannot fingerprint differently. A key whose hex does not decode has no fingerprint to show.
Trait Implementations§
Source§impl Clone for TrustedKey
impl Clone for TrustedKey
Source§fn clone(&self) -> TrustedKey
fn clone(&self) -> TrustedKey
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more