Struct ssi_vc_jose_cose::SdJwtVp
source · pub struct SdJwtVp<T = JsonPresentation<EnvelopedVerifiableCredential>>(pub T);
Expand description
SD-JWT VP claims.
Tuple Fields§
§0: T
Implementations§
source§impl<T> SdJwtVp<T>
impl<T> SdJwtVp<T>
sourcepub fn as_jwt_claims(&self) -> JWTClaims<&Self>
pub fn as_jwt_claims(&self) -> JWTClaims<&Self>
Returns this presentation as JWT claims.
These are the claims that will be encoded in the SD-JWT.
sourcepub fn into_jwt_claims(self) -> JWTClaims<Self>
pub fn into_jwt_claims(self) -> JWTClaims<Self>
Turns this presentation into JWT claims.
These claims can then be encoded in the SD-JWT.
source§impl<T: Serialize> SdJwtVp<T>
impl<T: Serialize> SdJwtVp<T>
sourcepub async fn sign(
&self,
signer: &impl JwsSigner,
) -> Result<SdJwtBuf, SignatureError>
pub async fn sign( &self, signer: &impl JwsSigner, ) -> Result<SdJwtBuf, SignatureError>
Signs the presentation into an SD-JWT without any concealed claims.
The generated SD-JWT will not have any disclosures.
Use Self::conceal_and_sign
to select the claims to be concealed.
sourcepub async fn conceal_and_sign(
&self,
sd_alg: SdAlg,
pointers: &[impl Borrow<JsonPointer>],
signer: &impl JwsSigner,
) -> Result<SdJwtBuf, SignatureError>
pub async fn conceal_and_sign( &self, sd_alg: SdAlg, pointers: &[impl Borrow<JsonPointer>], signer: &impl JwsSigner, ) -> Result<SdJwtBuf, SignatureError>
Signs the presentation while concealing the claims selected by the given JSON pointers.
You can use Self::sign
directly if you don’t need to conceal
anything.
sourcepub async fn sign_into_enveloped(
&self,
signer: &impl JwsSigner,
) -> Result<EnvelopedVerifiableCredential, SignatureError>
pub async fn sign_into_enveloped( &self, signer: &impl JwsSigner, ) -> Result<EnvelopedVerifiableCredential, SignatureError>
Signs the presentation into an enveloped verifiable presentation (with an SD-JWT identifier) without concealing any claim.
The generated SD-JWT, encoded in the presentation identifier, will not have any disclosures.
Use Self::conceal_and_sign_into_enveloped
to select the claims to be
concealed.
sourcepub async fn conceal_and_sign_into_enveloped(
&self,
sd_alg: SdAlg,
pointers: &[impl Borrow<JsonPointer>],
signer: &impl JwsSigner,
) -> Result<EnvelopedVerifiableCredential, SignatureError>
pub async fn conceal_and_sign_into_enveloped( &self, sd_alg: SdAlg, pointers: &[impl Borrow<JsonPointer>], signer: &impl JwsSigner, ) -> Result<EnvelopedVerifiableCredential, SignatureError>
Signs the presentation into an enveloped verifiable presentation (with an SD-JWT identifier) while concealing the claims selected by the given JSON pointers.
The generated SD-JWT, encoded in the presentation identifier, will not have any disclosures.
Use Self::conceal_and_sign_into_enveloped
to select the claims to be
concealed.
source§impl<T: DeserializeOwned> SdJwtVp<T>
impl<T: DeserializeOwned> SdJwtVp<T>
sourcepub fn decode_reveal(
sd_jwt: &SdJwt,
) -> Result<RevealedSdJwt<'_, Self>, RevealError>
pub fn decode_reveal( sd_jwt: &SdJwt, ) -> Result<RevealedSdJwt<'_, Self>, RevealError>
Decodes a SD-JWT VP, revealing its disclosed claims.
This function requires the T
parameter, representing the presentation
type, to be known. If you don’t know what T
you should use, use the
Self::decode_reveal_any
.
source§impl SdJwtVp
impl SdJwtVp
sourcepub fn decode_reveal_any(
sd_jwt: &SdJwt,
) -> Result<RevealedSdJwt<'_, Self>, RevealError>
pub fn decode_reveal_any( sd_jwt: &SdJwt, ) -> Result<RevealedSdJwt<'_, Self>, RevealError>
Decodes a SD-JWT VP, revealing its disclosed claims.
This function uses JsonPresentation<EnvelopedVerifiableCredential>
as presentation type. If you need to use a custom presentation type, use
the Self::decode_reveal
function.
Trait Implementations§
source§impl<T> ClaimSet for SdJwtVp<T>
impl<T> ClaimSet for SdJwtVp<T>
fn contains<C>(&self) -> boolwhere
C: Claim,
fn try_get<C>(&self) -> Result<Option<Cow<'_, C>>, InvalidClaimValue>where
C: Claim,
fn try_set<C>(&mut self, claim: C) -> Result<Result<(), C>, InvalidClaimValue>where
C: Claim,
fn try_remove<C>(&mut self) -> Result<Option<C>, InvalidClaimValue>where
C: Claim,
fn validate_registered_claims<E>(&self, env: &E) -> Result<(), InvalidClaims>where
E: DateTimeProvider,
source§impl<'de, T> Deserialize<'de> for SdJwtVp<T>where
T: Deserialize<'de>,
impl<'de, T> Deserialize<'de> for SdJwtVp<T>where
T: Deserialize<'de>,
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>,
source§impl<T> InfallibleClaimSet for SdJwtVp<T>
impl<T> InfallibleClaimSet for SdJwtVp<T>
source§impl<T: MaybeIdentified> MaybeIdentified for SdJwtVp<T>
impl<T: MaybeIdentified> MaybeIdentified for SdJwtVp<T>
source§impl<T: Ord> Ord for SdJwtVp<T>
impl<T: Ord> Ord for SdJwtVp<T>
1.21.0 · source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
source§impl<T: PartialOrd> PartialOrd for SdJwtVp<T>
impl<T: PartialOrd> PartialOrd for SdJwtVp<T>
source§impl<T: Presentation> Presentation for SdJwtVp<T>
impl<T: Presentation> Presentation for SdJwtVp<T>
source§type Credential = <T as Presentation>::Credential
type Credential = <T as Presentation>::Credential
source§type Holder = <T as Presentation>::Holder
type Holder = <T as Presentation>::Holder
source§fn additional_types(&self) -> &[String]
fn additional_types(&self) -> &[String]
VerifiablePresentation
type.fn types(&self) -> PresentationTypes<'_>
fn verifiable_credentials(&self) -> &[Self::Credential]
fn holders(&self) -> &[Self::Holder]
source§impl<E, P, T: ValidateClaims<E, P>> ValidateClaims<E, P> for SdJwtVp<T>
impl<E, P, T: ValidateClaims<E, P>> ValidateClaims<E, P> for SdJwtVp<T>
fn validate_claims(&self, environment: &E, proof: &P) -> ClaimsValidity
impl<T: Copy> Copy for SdJwtVp<T>
impl<T: Eq> Eq for SdJwtVp<T>
impl<T> StructuralPartialEq for SdJwtVp<T>
Auto Trait Implementations§
impl<T> Freeze for SdJwtVp<T>where
T: Freeze,
impl<T> RefUnwindSafe for SdJwtVp<T>where
T: RefUnwindSafe,
impl<T> Send for SdJwtVp<T>where
T: Send,
impl<T> Sync for SdJwtVp<T>where
T: Sync,
impl<T> Unpin for SdJwtVp<T>where
T: Unpin,
impl<T> UnwindSafe for SdJwtVp<T>where
T: UnwindSafe,
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> BorrowUnordered for T
impl<T> BorrowUnordered for T
fn as_unordered(&self) -> &Unordered<T>
source§impl<T> CallHasher for T
impl<T> CallHasher for T
source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
clone_to_uninit
)source§impl<Q, K> Comparable<K> for Q
impl<Q, K> Comparable<K> for Q
source§impl<'de, T, C> DeserializeTyped<'de, C> for Twhere
T: Deserialize<'de>,
impl<'de, T, C> DeserializeTyped<'de, C> for Twhere
T: Deserialize<'de>,
fn deserialize_typed<S>(
_: &C,
deserializer: S,
) -> Result<T, <S as Deserializer<'de>>::Error>where
S: Deserializer<'de>,
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<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
fn equivalent(&self, key: &K) -> bool
source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
source§impl<T> FmtForward for T
impl<T> FmtForward for T
source§fn fmt_binary(self) -> FmtBinary<Self>where
Self: Binary,
fn fmt_binary(self) -> FmtBinary<Self>where
Self: Binary,
self
to use its Binary
implementation when Debug
-formatted.source§fn fmt_display(self) -> FmtDisplay<Self>where
Self: Display,
fn fmt_display(self) -> FmtDisplay<Self>where
Self: Display,
self
to use its Display
implementation when
Debug
-formatted.source§fn fmt_lower_exp(self) -> FmtLowerExp<Self>where
Self: LowerExp,
fn fmt_lower_exp(self) -> FmtLowerExp<Self>where
Self: LowerExp,
self
to use its LowerExp
implementation when
Debug
-formatted.source§fn fmt_lower_hex(self) -> FmtLowerHex<Self>where
Self: LowerHex,
fn fmt_lower_hex(self) -> FmtLowerHex<Self>where
Self: LowerHex,
self
to use its LowerHex
implementation when
Debug
-formatted.source§fn fmt_octal(self) -> FmtOctal<Self>where
Self: Octal,
fn fmt_octal(self) -> FmtOctal<Self>where
Self: Octal,
self
to use its Octal
implementation when Debug
-formatted.source§fn fmt_pointer(self) -> FmtPointer<Self>where
Self: Pointer,
fn fmt_pointer(self) -> FmtPointer<Self>where
Self: Pointer,
self
to use its Pointer
implementation when
Debug
-formatted.source§fn fmt_upper_exp(self) -> FmtUpperExp<Self>where
Self: UpperExp,
fn fmt_upper_exp(self) -> FmtUpperExp<Self>where
Self: UpperExp,
self
to use its UpperExp
implementation when
Debug
-formatted.source§fn fmt_upper_hex(self) -> FmtUpperHex<Self>where
Self: UpperHex,
fn fmt_upper_hex(self) -> FmtUpperHex<Self>where
Self: UpperHex,
self
to use its UpperHex
implementation when
Debug
-formatted.source§impl<T> Instrument for T
impl<T> Instrument for T
source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
source§impl<T, U, C> IntoWithContext<U, C> for Twhere
U: FromWithContext<T, C>,
impl<T, U, C> IntoWithContext<U, C> for Twhere
U: FromWithContext<T, C>,
source§impl<T> Pipe for Twhere
T: ?Sized,
impl<T> Pipe for Twhere
T: ?Sized,
source§fn pipe<R>(self, func: impl FnOnce(Self) -> R) -> Rwhere
Self: Sized,
fn pipe<R>(self, func: impl FnOnce(Self) -> R) -> Rwhere
Self: Sized,
source§fn pipe_ref<'a, R>(&'a self, func: impl FnOnce(&'a Self) -> R) -> Rwhere
R: 'a,
fn pipe_ref<'a, R>(&'a self, func: impl FnOnce(&'a Self) -> R) -> Rwhere
R: 'a,
self
and passes that borrow into the pipe function. Read moresource§fn pipe_ref_mut<'a, R>(&'a mut self, func: impl FnOnce(&'a mut Self) -> R) -> Rwhere
R: 'a,
fn pipe_ref_mut<'a, R>(&'a mut self, func: impl FnOnce(&'a mut Self) -> R) -> Rwhere
R: 'a,
self
and passes that borrow into the pipe function. Read moresource§fn pipe_borrow<'a, B, R>(&'a self, func: impl FnOnce(&'a B) -> R) -> R
fn pipe_borrow<'a, B, R>(&'a self, func: impl FnOnce(&'a B) -> R) -> R
source§fn pipe_borrow_mut<'a, B, R>(
&'a mut self,
func: impl FnOnce(&'a mut B) -> R,
) -> R
fn pipe_borrow_mut<'a, B, R>( &'a mut self, func: impl FnOnce(&'a mut B) -> R, ) -> R
source§fn pipe_as_ref<'a, U, R>(&'a self, func: impl FnOnce(&'a U) -> R) -> R
fn pipe_as_ref<'a, U, R>(&'a self, func: impl FnOnce(&'a U) -> R) -> R
self
, then passes self.as_ref()
into the pipe function.source§fn pipe_as_mut<'a, U, R>(&'a mut self, func: impl FnOnce(&'a mut U) -> R) -> R
fn pipe_as_mut<'a, U, R>(&'a mut self, func: impl FnOnce(&'a mut U) -> R) -> R
self
, then passes self.as_mut()
into the pipe
function.source§fn pipe_deref<'a, T, R>(&'a self, func: impl FnOnce(&'a T) -> R) -> R
fn pipe_deref<'a, T, R>(&'a self, func: impl FnOnce(&'a T) -> R) -> R
self
, then passes self.deref()
into the pipe function.source§impl<T> PipeAsRef for T
impl<T> PipeAsRef for T
source§impl<T> PipeBorrow for T
impl<T> PipeBorrow for T
source§impl<T> PipeDeref for T
impl<T> PipeDeref for T
source§impl<T> PipeRef for T
impl<T> PipeRef for T
source§impl<T> ResourceProvider<()> for T
impl<T> ResourceProvider<()> for T
source§fn get_resource(&self) -> &()
fn get_resource(&self) -> &()
T
.source§impl<T> Tap for T
impl<T> Tap for T
source§fn tap_borrow<B>(self, func: impl FnOnce(&B)) -> Self
fn tap_borrow<B>(self, func: impl FnOnce(&B)) -> Self
Borrow<B>
of a value. Read moresource§fn tap_borrow_mut<B>(self, func: impl FnOnce(&mut B)) -> Self
fn tap_borrow_mut<B>(self, func: impl FnOnce(&mut B)) -> Self
BorrowMut<B>
of a value. Read moresource§fn tap_ref<R>(self, func: impl FnOnce(&R)) -> Self
fn tap_ref<R>(self, func: impl FnOnce(&R)) -> Self
AsRef<R>
view of a value. Read moresource§fn tap_ref_mut<R>(self, func: impl FnOnce(&mut R)) -> Self
fn tap_ref_mut<R>(self, func: impl FnOnce(&mut R)) -> Self
AsMut<R>
view of a value. Read moresource§fn tap_deref<T>(self, func: impl FnOnce(&T)) -> Self
fn tap_deref<T>(self, func: impl FnOnce(&T)) -> Self
Deref::Target
of a value. Read moresource§fn tap_deref_mut<T>(self, func: impl FnOnce(&mut T)) -> Self
fn tap_deref_mut<T>(self, func: impl FnOnce(&mut T)) -> Self
Deref::Target
of a value. Read moresource§fn tap_dbg(self, func: impl FnOnce(&Self)) -> Self
fn tap_dbg(self, func: impl FnOnce(&Self)) -> Self
.tap()
only in debug builds, and is erased in release builds.source§fn tap_mut_dbg(self, func: impl FnOnce(&mut Self)) -> Self
fn tap_mut_dbg(self, func: impl FnOnce(&mut Self)) -> Self
.tap_mut()
only in debug builds, and is erased in release
builds.source§fn tap_borrow_dbg<B>(self, func: impl FnOnce(&B)) -> Self
fn tap_borrow_dbg<B>(self, func: impl FnOnce(&B)) -> Self
.tap_borrow()
only in debug builds, and is erased in release
builds.source§fn tap_borrow_mut_dbg<B>(self, func: impl FnOnce(&mut B)) -> Self
fn tap_borrow_mut_dbg<B>(self, func: impl FnOnce(&mut B)) -> Self
.tap_borrow_mut()
only in debug builds, and is erased in release
builds.source§fn tap_ref_dbg<R>(self, func: impl FnOnce(&R)) -> Self
fn tap_ref_dbg<R>(self, func: impl FnOnce(&R)) -> Self
.tap_ref()
only in debug builds, and is erased in release
builds.source§fn tap_ref_mut_dbg<R>(self, func: impl FnOnce(&mut R)) -> Self
fn tap_ref_mut_dbg<R>(self, func: impl FnOnce(&mut R)) -> Self
.tap_ref_mut()
only in debug builds, and is erased in release
builds.source§fn tap_deref_dbg<T>(self, func: impl FnOnce(&T)) -> Self
fn tap_deref_dbg<T>(self, func: impl FnOnce(&T)) -> Self
.tap_deref()
only in debug builds, and is erased in release
builds.source§impl<T> Tap for T
impl<T> Tap for T
source§fn tap<F, R>(self, func: F) -> Selfwhere
F: FnOnce(&Self) -> R,
fn tap<F, R>(self, func: F) -> Selfwhere
F: FnOnce(&Self) -> R,
source§fn tap_dbg<F, R>(self, func: F) -> Selfwhere
F: FnOnce(&Self) -> R,
fn tap_dbg<F, R>(self, func: F) -> Selfwhere
F: FnOnce(&Self) -> R,
tap
in debug builds, and does nothing in release builds.source§fn tap_mut<F, R>(self, func: F) -> Selfwhere
F: FnOnce(&mut Self) -> R,
fn tap_mut<F, R>(self, func: F) -> Selfwhere
F: FnOnce(&mut Self) -> R,
source§fn tap_mut_dbg<F, R>(self, func: F) -> Selfwhere
F: FnOnce(&mut Self) -> R,
fn tap_mut_dbg<F, R>(self, func: F) -> Selfwhere
F: FnOnce(&mut Self) -> R,
tap_mut
in debug builds, and does nothing in release builds.source§impl<T, U> TapAsRef<U> for Twhere
U: ?Sized,
impl<T, U> TapAsRef<U> for Twhere
U: ?Sized,
source§fn tap_ref<F, R>(self, func: F) -> Self
fn tap_ref<F, R>(self, func: F) -> Self
source§fn tap_ref_dbg<F, R>(self, func: F) -> Self
fn tap_ref_dbg<F, R>(self, func: F) -> Self
tap_ref
in debug builds, and does nothing in release builds.source§fn tap_ref_mut<F, R>(self, func: F) -> Self
fn tap_ref_mut<F, R>(self, func: F) -> Self
source§impl<T, U> TapBorrow<U> for Twhere
U: ?Sized,
impl<T, U> TapBorrow<U> for Twhere
U: ?Sized,
source§fn tap_borrow<F, R>(self, func: F) -> Self
fn tap_borrow<F, R>(self, func: F) -> Self
source§fn tap_borrow_dbg<F, R>(self, func: F) -> Self
fn tap_borrow_dbg<F, R>(self, func: F) -> Self
tap_borrow
in debug builds, and does nothing in release builds.source§fn tap_borrow_mut<F, R>(self, func: F) -> Self
fn tap_borrow_mut<F, R>(self, func: F) -> Self
source§impl<T> TapDeref for T
impl<T> TapDeref for T
source§fn tap_deref_dbg<F, R>(self, func: F) -> Self
fn tap_deref_dbg<F, R>(self, func: F) -> Self
tap_deref
in debug builds, and does nothing in release builds.source§fn tap_deref_mut<F, R>(self, func: F) -> Self
fn tap_deref_mut<F, R>(self, func: F) -> Self
self
for modification.