#[non_exhaustive]pub enum PresentedCredentialV2 {
Jwt(Box<DecodedCredentialV2>),
SdJwt(Box<SdJwtCredentialV2>),
}Available on crate feature
vc only.Expand description
A credential unwrapped from an EnvelopedVerifiableCredential of a VCDM 2.0
presentation: secured as a JWT (application/vc+jwt) or, with the sd-jwt feature, with
SD-JWT (application/vc+sd-jwt).
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
Jwt(Box<DecodedCredentialV2>)
A vc+jwt credential, decoded.
SdJwt(Box<SdJwtCredentialV2>)
Available on crate feature
sd-jwt only.A vc+sd-jwt credential, with the disclosures it was presented with applied.
Implementations§
Source§impl PresentedCredentialV2
impl PresentedCredentialV2
Sourcepub fn credential(&self) -> &CredentialV2
pub fn credential(&self) -> &CredentialV2
The credential, whichever way it was secured.
Sourcepub fn header(&self) -> &JwsHeader
pub fn header(&self) -> &JwsHeader
The header of the JWT securing it (the issuer-signed JWT, for SD-JWT).
Sourcepub fn as_jwt(&self) -> Option<&DecodedCredentialV2>
pub fn as_jwt(&self) -> Option<&DecodedCredentialV2>
The decoded JWT, when the credential was secured as one.
Sourcepub fn as_sd_jwt(&self) -> Option<&SdJwtCredentialV2>
Available on crate feature sd-jwt only.
pub fn as_sd_jwt(&self) -> Option<&SdJwtCredentialV2>
sd-jwt only.The SD-JWT credential, when the credential was secured with SD-JWT.
Trait Implementations§
Source§impl Clone for PresentedCredentialV2
impl Clone for PresentedCredentialV2
Auto Trait Implementations§
impl Freeze for PresentedCredentialV2
impl RefUnwindSafe for PresentedCredentialV2
impl Send for PresentedCredentialV2
impl Sync for PresentedCredentialV2
impl Unpin for PresentedCredentialV2
impl UnsafeUnpin for PresentedCredentialV2
impl UnwindSafe for PresentedCredentialV2
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