pub struct SdJwtPresentationBuilder { /* private fields */ }
Implementations§
Source§impl SdJwtPresentationBuilder
impl SdJwtPresentationBuilder
pub fn new(sd_jwt: SdJwt, hasher: &dyn Hasher) -> Result<Self>
Sourcepub fn conceal(self, path: &str) -> Result<Self>
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.
Sourcepub fn conceal_all(self) -> Self
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.
Sourcepub fn disclose(self, path: &str) -> Result<Self>
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.
Sourcepub fn attach_key_binding_jwt(self, kb_jwt: KeyBindingJwt) -> Self
pub fn attach_key_binding_jwt(self, kb_jwt: KeyBindingJwt) -> Self
Adds a KeyBindingJwt
to this SdJwt
’s presentation.
Sourcepub fn finish(self) -> Result<(SdJwt, Vec<Disclosure>)>
pub fn finish(self) -> Result<(SdJwt, Vec<Disclosure>)>
Returns the resulting SdJwt
together with all removed disclosures.
§Errors
- Fails with
Error::MissingKeyBindingJwt
if thisSdJwt
requires a key binding but none was provided.
Methods from Deref<Target = SdJwt>§
pub fn header(&self) -> &JsonObject
pub fn claims(&self) -> &SdJwtClaims
pub fn disclosures(&self) -> &[Disclosure]
pub fn required_key_bind(&self) -> Option<&RequiredKeyBinding>
pub fn key_binding_jwt(&self) -> Option<&KeyBindingJwt>
Sourcepub fn presentation(&self) -> String
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
impl Clone for SdJwtPresentationBuilder
Source§fn clone(&self) -> SdJwtPresentationBuilder
fn clone(&self) -> SdJwtPresentationBuilder
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreSource§impl Debug for SdJwtPresentationBuilder
impl Debug for SdJwtPresentationBuilder
Auto Trait Implementations§
impl Freeze for SdJwtPresentationBuilder
impl RefUnwindSafe for SdJwtPresentationBuilder
impl Send for SdJwtPresentationBuilder
impl Sync for SdJwtPresentationBuilder
impl Unpin for SdJwtPresentationBuilder
impl UnwindSafe for SdJwtPresentationBuilder
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
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 moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
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