pub struct SdJwt { /* private fields */ }Expand description
Representation of an SD-JWT of the format
<Issuer-signed JWT>~<D.1>~<D.2>~...~<D.N>~<optional KB-JWT>.
Implementations§
Source§impl SdJwt
impl SdJwt
pub fn headers(&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.
Sourcepub fn disclosures(&self) -> &[Disclosure]
pub fn disclosures(&self) -> &[Disclosure]
Returns the disclosures of this SD-JWT.
Sourcepub fn required_key_bind(&self) -> Option<&RequiredKeyBinding>
pub fn required_key_bind(&self) -> Option<&RequiredKeyBinding>
Returns the required key binding of this SD-JWT, if any.
Sourcepub fn key_binding_jwt(&self) -> Option<&KeyBindingJwt>
pub fn key_binding_jwt(&self) -> Option<&KeyBindingJwt>
Returns the key binding JWT of this SD-JWT, if any.
Sourcepub fn attach_key_binding_jwt(&mut self, kb_jwt: KeyBindingJwt)
pub fn attach_key_binding_jwt(&mut self, kb_jwt: KeyBindingJwt)
Attaches a KeyBindingJwt to this SD-JWT.
§Notes
This method overwrites any existing KeyBindingJwt and does not perform any sort of validation of the passed KB-JWT.
Sourcepub fn presentation(&self) -> String
pub fn presentation(&self) -> String
Serializes the components into the final SD-JWT.
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::InvalidHasheris returned if the providedhasher’s algorithm doesn’t match the algorithm specified by SD-JWT’s_sd_algclaim. “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 UnsafeUnpin 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
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
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>
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>
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