Skip to main content

CoseSigner

Trait CoseSigner 

Source
pub trait CoseSigner {
    // Required methods
    fn alg(&self) -> Algorithm;
    fn kid(&self) -> Vec<u8> ⓘ;
    fn sign(&self, msg: &[u8]) -> Vec<u8> ⓘ;
}
Expand description

Trait abstracting over a signing key.

Implemented for ed25519_dalek::SigningKey below; ML-DSA-65 / PQ support can be added later by implementing this trait + extending alg_for_signer.

Required Methods§

Source

fn alg(&self) -> Algorithm

IANA COSE algorithm identifier (e.g. iana::Algorithm::EdDSA).

Source

fn kid(&self) -> Vec<u8> ⓘ

Stable key identifier used for the COSE kid protected header.

Convention: for Ed25519 signers this is the 32-byte raw verifying key. Verifiers look the signer up by this kid.

Source

fn sign(&self, msg: &[u8]) -> Vec<u8> ⓘ

Sign arbitrary bytes (the COSE Sig_structure value).

Implementations on Foreign Types§

Source§

impl CoseSigner for SigningKey

Source§

fn alg(&self) -> Algorithm

Source§

fn kid(&self) -> Vec<u8> ⓘ

Source§

fn sign(&self, msg: &[u8]) -> Vec<u8> ⓘ

Implementors§