Struct sd_jwt_payload::Disclosure
source · pub struct Disclosure {
pub salt: String,
pub claim_name: Option<String>,
pub claim_value: Value,
pub disclosure: String,
}Expand description
Represents an elements constructing a disclosure. Object properties and array elements disclosures are supported.
See: https://www.ietf.org/archive/id/draft-ietf-oauth-selective-disclosure-jwt-07.html#name-disclosures
Fields§
§salt: StringThe salt value.
claim_name: Option<String>The claim name, optional for array elements.
claim_value: ValueThe claim Value which can be of any type.
disclosure: StringThe base64url-encoded string.
Implementations§
source§impl Disclosure
impl Disclosure
sourcepub fn new(salt: String, claim_name: Option<String>, claim_value: Value) -> Self
pub fn new(salt: String, claim_name: Option<String>, claim_value: Value) -> Self
Creates a new instance of Disclosure.
Use .to_string() to get the actual disclosure.
sourcepub fn parse(disclosure: String) -> Result<Self, Error>
pub fn parse(disclosure: String) -> Result<Self, Error>
Parses a Base64 encoded disclosure into a Disclosure.
§Error
Returns an Error::InvalidDisclosure if input is not a valid disclosure.
sourcepub fn into_string(self) -> String
pub fn into_string(self) -> String
Convert this object into the actual disclosure.
Trait Implementations§
source§impl Clone for Disclosure
impl Clone for Disclosure
source§fn clone(&self) -> Disclosure
fn clone(&self) -> Disclosure
Returns a copy 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 Disclosure
impl Debug for Disclosure
source§impl<'de> Deserialize<'de> for Disclosure
impl<'de> Deserialize<'de> for Disclosure
source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
source§impl Display for Disclosure
impl Display for Disclosure
source§impl PartialEq for Disclosure
impl PartialEq for Disclosure
source§fn eq(&self, other: &Disclosure) -> bool
fn eq(&self, other: &Disclosure) -> bool
This method tests for
self and other values to be equal, and is used
by ==.source§impl Serialize for Disclosure
impl Serialize for Disclosure
impl Eq for Disclosure
impl StructuralPartialEq for Disclosure
Auto Trait Implementations§
impl Freeze for Disclosure
impl RefUnwindSafe for Disclosure
impl Send for Disclosure
impl Sync for Disclosure
impl Unpin for Disclosure
impl UnwindSafe for Disclosure
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