Skip to main content

SigningBackend

Trait SigningBackend 

Source
pub trait SigningBackend: Send + Sync {
    // Required methods
    fn algorithm(&self) -> SigningAlgorithm;
    fn public_key(&self) -> PublicKey;
    fn sign_bytes(&self, message: &[u8]) -> Result<Signature, Error>;
}
Expand description

Abstraction over Chio signing algorithms.

Every Chio artifact that requires a signature delegates to a SigningBackend implementation. The default backend is Ed25519Backend, which wraps the existing Keypair and preserves byte-identical serialization. Under the fips feature, [P256Backend] and [P384Backend] are available and route through aws-lc-rs.

Backends are expected to be cheap to clone; implementations should store private key material behind reference counting or copy-on-sign semantics as appropriate. The trait is deliberately dyn-compatible so it can be passed as &dyn SigningBackend through artifact signing helpers.

Required Methods§

Source

fn algorithm(&self) -> SigningAlgorithm

Algorithm this backend produces.

Source

fn public_key(&self) -> PublicKey

Public half of this backend’s signing identity.

Source

fn sign_bytes(&self, message: &[u8]) -> Result<Signature, Error>

Produce a detached signature over message.

Implementors§