JwkBufferEncoder

Struct JwkBufferEncoder 

Source
pub struct JwkBufferEncoder<'b, B: WriteBuffer> { /* private fields */ }
Expand description

A helper structure which writes a JWK to a buffer

Implementations§

Source§

impl<'b, B: WriteBuffer> JwkBufferEncoder<'b, B>

Source

pub fn new(buffer: &'b mut B, mode: JwkEncoderMode) -> Self

Create a new instance

Source

pub fn alg(self, alg: Option<KeyAlg>) -> Self

Set the key algorithm

Source

pub fn key_ops(self, key_ops: Option<KeyOpsSet>) -> Self

Set the supported key operations

Source

pub fn kid(self, kid: Option<&'b str>) -> Self

Set the key identifier

Source

pub fn finalize(self) -> Result<(), Error>

Complete the JWK output

Trait Implementations§

Source§

impl<'b, B: Debug + WriteBuffer> Debug for JwkBufferEncoder<'b, B>

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<B: WriteBuffer> JwkEncoder for JwkBufferEncoder<'_, B>

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
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

Auto Trait Implementations§

§

impl<'b, B> Freeze for JwkBufferEncoder<'b, B>

§

impl<'b, B> RefUnwindSafe for JwkBufferEncoder<'b, B>
where B: RefUnwindSafe,

§

impl<'b, B> Send for JwkBufferEncoder<'b, B>
where B: Send,

§

impl<'b, B> Sync for JwkBufferEncoder<'b, B>
where B: Sync,

§

impl<'b, B> Unpin for JwkBufferEncoder<'b, B>

§

impl<'b, B> !UnwindSafe for JwkBufferEncoder<'b, B>

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V