Skip to main content

SignatureVerifier

Trait SignatureVerifier 

Source
pub trait SignatureVerifier {
    // Required method
    fn verify(&self, spki_der: &[u8], message: &[u8], signature: &[u8]) -> bool;
}
Expand description

The signature-verification capability a caller injects (SPEC §3.4.3).

dig-pex is deliberately sans-IO and carries no signature crypto of its own: it defines the field and the canonical bytes, and the embedding node or relay supplies the primitive matching the key type in use (ECDSA P-256, as dig-tls issues today). The peer_id-to-key binding is not delegated — PaymentClaim::verify recomputes SHA-256(SPKI) == peer_id itself, so a permissive verifier can never be talked into naming the wrong payee.

Required Methods§

Source

fn verify(&self, spki_der: &[u8], message: &[u8], signature: &[u8]) -> bool

Whether signature is a valid signature over message by the public key encoded in spki_der. MUST return false — never panic — on a malformed key or signature.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§

Source§

impl<F> SignatureVerifier for F
where F: Fn(&[u8], &[u8], &[u8]) -> bool,