Signer

Trait Signer 

Source
pub trait Signer: Send + Sync {
    // Required methods
    fn algorithm(&self) -> SigningAlgorithm;
    fn key_id(&self) -> &str;
    fn public_key_jwk(&self) -> Result<Jwk>;
    fn sign(&self, payload: &[u8]) -> Result<SignatureEnvelope>;

    // Provided methods
    fn verify(&self, payload: &[u8], signature: &[u8]) -> Result<bool> { ... }
    fn verify_via_backend(
        &self,
        _payload: &[u8],
        _signature: &[u8],
    ) -> Result<bool> { ... }
    fn sign_json(&self, value: &Value) -> Result<SignatureEnvelope> { ... }
}

Required Methods§

Source

fn algorithm(&self) -> SigningAlgorithm

Source

fn key_id(&self) -> &str

Source

fn public_key_jwk(&self) -> Result<Jwk>

Source

fn sign(&self, payload: &[u8]) -> Result<SignatureEnvelope>

Provided Methods§

Source

fn verify(&self, payload: &[u8], signature: &[u8]) -> Result<bool>

Source

fn verify_via_backend(&self, _payload: &[u8], _signature: &[u8]) -> Result<bool>

Source

fn sign_json(&self, value: &Value) -> Result<SignatureEnvelope>

Implementors§