identity_credential/validator/jwt_credential_validation/
decoded_jwt_credential.rs

1// Copyright 2020-2023 IOTA Stiftung
2// SPDX-License-Identifier: Apache-2.0
3
4use crate::credential::Credential;
5use identity_core::common::Object;
6use identity_verification::jose::jws::JwsHeader;
7
8/// Decoded [`Credential`] from a cryptographically verified JWS.
9///
10/// Note that having an instance of this type only means the JWS it was constructed from was verified.
11/// It does not imply anything about a potentially present proof property on the credential itself.
12#[non_exhaustive]
13#[derive(Debug, Clone)]
14pub struct DecodedJwtCredential<T = Object> {
15  /// The decoded credential parsed to the [Verifiable Credentials Data model](https://www.w3.org/TR/vc-data-model/).
16  pub credential: Credential<T>,
17  /// The protected header parsed from the JWS.
18  pub header: Box<JwsHeader>,
19  /// The custom claims parsed from the JWT.
20  pub custom_claims: Option<Object>,
21}