identity_credential/validator/jwt_presentation_validation/
decoded_jwt_presentation.rs

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
// Copyright 2020-2023 IOTA Stiftung
// SPDX-License-Identifier: Apache-2.0

use identity_core::common::Object;
use identity_core::common::Timestamp;
use identity_core::common::Url;
use identity_verification::jws::JwsHeader;

use crate::presentation::Presentation;

/// Decoded [`Presentation`] from a cryptographically verified JWS.
///
/// Note that having an instance of this type only means the JWS it was constructed from was verified.
/// It does not imply anything about a potentially present proof property on the presentation itself.
#[non_exhaustive]
#[derive(Debug, Clone)]
pub struct DecodedJwtPresentation<CRED, T = Object> {
  /// The decoded presentation parsed to the [Verifiable Credentials Data model](https://www.w3.org/TR/vc-data-model/).
  pub presentation: Presentation<CRED, T>,
  /// The protected header parsed from the JWS.
  pub header: Box<JwsHeader>,
  /// The expiration date parsed from the JWT claims.
  pub expiration_date: Option<Timestamp>,
  /// The issuance date parsed from the JWT claims.
  pub issuance_date: Option<Timestamp>,
  /// The `aud` property parsed from the JWT claims.
  pub aud: Option<Url>,
  /// The custom claims parsed from the JWT.
  pub custom_claims: Option<Object>,
}