Skip to main content

JwsSigner

Trait JwsSigner 

Source
pub trait JwsSigner:
    Debug
    + Send
    + Sync {
    // Required methods
    fn algorithm(&self) -> &dyn JwsAlgorithm;
    fn key_id(&self) -> Option<&str>;
    fn signature_len(&self) -> usize;
    fn sign(&self, message: &[u8]) -> Result<Vec<u8>, JoseError>;
    fn box_clone(&self) -> Box<dyn JwsSigner>;
}

Required Methods§

Source

fn algorithm(&self) -> &dyn JwsAlgorithm

Return the source algorithm instance.

Source

fn key_id(&self) -> Option<&str>

Return the source key ID. The default value is a value of kid parameter in JWK.

Source

fn signature_len(&self) -> usize

Return the signature length of JWS.

Source

fn sign(&self, message: &[u8]) -> Result<Vec<u8>, JoseError>

Return a signature of the data.

§Arguments
  • message - The message data to sign.
Source

fn box_clone(&self) -> Box<dyn JwsSigner>

Trait Implementations§

Source§

impl Clone for Box<dyn JwsSigner>

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more

Dyn Compatibility§

This trait is dyn compatible.

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

Implementors§