SdJwtPresentationBuilder

Struct SdJwtPresentationBuilder 

Source
pub struct SdJwtPresentationBuilder { /* private fields */ }

Implementations§

Source§

impl SdJwtPresentationBuilder

Source

pub fn new(sd_jwt: SdJwt, hasher: &dyn Hasher) -> Result<Self>

Source

pub fn conceal(self, path: &str) -> Result<Self>

Removes the disclosure for the property at path, concealing it.

§Notes
  • When concealing a claim more than one disclosure may be removed: the disclosure for the claim itself and the disclosures for any concealable sub-claim.
Source

pub fn conceal_all(self) -> Self

Removes all disclosures from this SD-JWT, resulting in a token that, when presented, will have all selectively-disclosable properties omitted.

Source

pub fn disclose(self, path: &str) -> Result<Self>

Discloses a value that was previously concealed.

§Notes
  • This method may disclose multiple values, if the given path references a disclosable value stored within another disclosable value. That is, disclose will unconceal the selectively disclosable value at path together with all its parents that are disclosable values themselves.
  • By default all disclosable claims are disclosed, therefore this method can only be used to undo any concealment operations previously performed by either Self::conceal or Self::conceal_all.
Source

pub fn attach_key_binding_jwt(self, kb_jwt: KeyBindingJwt) -> Self

Adds a KeyBindingJwt to this SdJwt’s presentation.

Source

pub fn finish(self) -> Result<(SdJwt, Vec<Disclosure>)>

Returns the resulting SdJwt together with all removed disclosures.

§Errors

Methods from Deref<Target = SdJwt>§

Source

pub fn header(&self) -> &JsonObject

Source

pub fn claims(&self) -> &SdJwtClaims

Source

pub fn disclosures(&self) -> &[Disclosure]

Source

pub fn required_key_bind(&self) -> Option<&RequiredKeyBinding>

Source

pub fn key_binding_jwt(&self) -> Option<&KeyBindingJwt>

Source

pub fn presentation(&self) -> String

Serializes the components into the final SD-JWT.

§Error

Returns Error::DeserializationError if parsing fails.

Trait Implementations§

Source§

impl Clone for SdJwtPresentationBuilder

Source§

fn clone(&self) -> SdJwtPresentationBuilder

Returns a duplicate of the value. Read more
1.0.0 · Source§

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

Performs copy-assignment from source. Read more
Source§

impl Debug for SdJwtPresentationBuilder

Source§

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

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

impl Deref for SdJwtPresentationBuilder

Source§

type Target = SdJwt

The resulting type after dereferencing.
Source§

fn deref(&self) -> &Self::Target

Dereferences the value.

Auto Trait Implementations§

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> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. 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> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self>

Converts self into a Left variant of Either<Self, Self> if into_left is true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

Converts self into a Left variant of Either<Self, Self> if into_left(&self) returns true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

impl<P, T> Receiver for P
where P: Deref<Target = T> + ?Sized, T: ?Sized,

Source§

type Target = T

🔬This is a nightly-only experimental API. (arbitrary_self_types)
The target type on which the method may be called.
Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
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