JwkEncoder

Trait JwkEncoder 

Source
pub trait JwkEncoder {
    // Required methods
    fn alg(&self) -> Option<KeyAlg>;
    fn add_str(&mut self, key: &str, value: &str) -> Result<(), Error>;
    fn add_as_base64(&mut self, key: &str, value: &[u8]) -> Result<(), Error>;
    fn mode(&self) -> JwkEncoderMode;

    // Provided methods
    fn is_public(&self) -> bool { ... }
    fn is_secret(&self) -> bool { ... }
    fn is_thumbprint(&self) -> bool { ... }
}
Expand description

Common interface for JWK encoders

Required Methods§

Source

fn alg(&self) -> Option<KeyAlg>

Get the requested algorithm for the JWK

Source

fn add_str(&mut self, key: &str, value: &str) -> Result<(), Error>

Add a string attribute

Source

fn add_as_base64(&mut self, key: &str, value: &[u8]) -> Result<(), Error>

Add a binary attribute to be encoded as unpadded base64-URL

Source

fn mode(&self) -> JwkEncoderMode

Accessor for the encoder mode

Provided Methods§

Source

fn is_public(&self) -> bool

Check if the mode is public

Source

fn is_secret(&self) -> bool

Check if the mode is secret

Source

fn is_thumbprint(&self) -> bool

Check if the mode is thumbprint

Implementors§