pub struct VerifierKey { /* private fields */ }Expand description
A trusted verifier key: the data needed to recognize and check signatures from one key.
Implementations§
Source§impl VerifierKey
impl VerifierKey
Sourcepub fn new_ed25519(name: &str, public_key: &[u8]) -> Result<Self>
pub fn new_ed25519(name: &str, public_key: &[u8]) -> Result<Self>
Build an Ed25519 verifier key from a name and 32-byte public key, computing the key id per the spec.
§Errors
Returns Error::MalformedNote if the name is invalid or the public key
is not 32 bytes.
Sourcepub fn new_hybrid(name: &str, public_key: &[u8]) -> Result<Self>
pub fn new_hybrid(name: &str, public_key: &[u8]) -> Result<Self>
Build a hybrid composite verifier key from a name and the
metamorphic-crypto public key bytes (tag || classical_pk || ml_dsa_pk),
computing the key id per the spec over HYBRID_SIG_IDENTIFIER.
§Errors
Returns Error::MalformedNote if the name is invalid or the public key
is empty.
Sourcepub fn parse(vkey: &str) -> Result<Self>
pub fn parse(vkey: &str) -> Result<Self>
Parse a verifier key string <name>+<hex key id>+<base64(type||key)>.
§Errors
Returns Error::MalformedNote if the structure, hex id, base64, key
length, or recomputed key id is invalid, or Error::MalformedNote for
an unsupported signature type.
Sourcepub fn signature_type(&self) -> SignatureType
pub fn signature_type(&self) -> SignatureType
The signature algorithm.
Sourcepub fn public_key(&self) -> &[u8] ⓘ
pub fn public_key(&self) -> &[u8] ⓘ
The raw public key material (type identifier-stripped): the 32-byte
Ed25519 key, or the metamorphic-crypto composite public key bytes
(tag || classical_pk || ml_dsa_pk) for a hybrid key.
Sourcepub fn hybrid_posture_tag(&self) -> Option<u8>
pub fn hybrid_posture_tag(&self) -> Option<u8>
For a SignatureType::MetamorphicHybrid key, the metamorphic-crypto
composite posture tag — the leading byte of the composite public key
that self-describes its (Suite, SecurityLevel) (e.g. 0x02 = Hybrid
Cat-3). Returns None for non-hybrid keys.
This is informational only; the authoritative posture decode lives in
metamorphic-crypto. It is surfaced so the Slice-5 NamespacePolicy layer
can later reconcile the declared posture against this observed tag
without this crate reimplementing any crypto.
Trait Implementations§
Source§impl Clone for VerifierKey
impl Clone for VerifierKey
Source§fn clone(&self) -> VerifierKey
fn clone(&self) -> VerifierKey
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 VerifierKey
impl Debug for VerifierKey
impl Eq for VerifierKey
Source§impl PartialEq for VerifierKey
impl PartialEq for VerifierKey
Source§fn eq(&self, other: &VerifierKey) -> bool
fn eq(&self, other: &VerifierKey) -> bool
self and other values to be equal, and is used by ==.