pub struct SdJwt { /* private fields */ }
Expand description
Representation of an SD-JWT of the format
<Issuer-signed JWT>~<Disclosure 1>~<Disclosure 2>~...~<Disclosure N>~<optional KB-JWT>
.
Implementations§
Source§impl SdJwt
impl SdJwt
pub fn header(&self) -> &JsonObject
pub fn claims(&self) -> &SdJwtClaims
Sourcepub fn claims_mut(&mut self) -> &mut SdJwtClaims
pub fn claims_mut(&mut self) -> &mut SdJwtClaims
Returns a mutable reference to this SD-JWT’s claims.
§Warning
Modifying the claims might invalidate the signature. Use this method carefully.
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.
Sourcepub fn into_presentation(
self,
hasher: &dyn Hasher,
) -> Result<SdJwtPresentationBuilder>
pub fn into_presentation( self, hasher: &dyn Hasher, ) -> Result<SdJwtPresentationBuilder>
Prepares this SdJwt
for a presentation, returning an SdJwtPresentationBuilder
.
§Errors
Error::InvalidHasher
is returned if the providedhasher
’s algorithm doesn’t match the algorithm specified by SD-JWT’s_sd_alg
claim. “sha-256” is used if the claim is missing.
Sourcepub fn into_disclosed_object(self, hasher: &dyn Hasher) -> Result<JsonObject>
pub fn into_disclosed_object(self, hasher: &dyn Hasher) -> Result<JsonObject>
Returns the JSON object obtained by replacing all disclosures into their corresponding JWT concealable claims.
Trait Implementations§
impl Eq for SdJwt
impl StructuralPartialEq for SdJwt
Auto Trait Implementations§
impl Freeze for SdJwt
impl RefUnwindSafe for SdJwt
impl Send for SdJwt
impl Sync for SdJwt
impl Unpin for SdJwt
impl UnwindSafe for SdJwt
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<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key
and return true
if they are equal.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