identity_credential/validator/jwt_presentation_validation/decoded_jwt_presentation.rs
1// Copyright 2020-2023 IOTA Stiftung
2// SPDX-License-Identifier: Apache-2.0
3
4use identity_core::common::Object;
5use identity_core::common::Timestamp;
6use identity_core::common::Url;
7use identity_verification::jws::JwsHeader;
8
9use crate::presentation::Presentation;
10
11/// Decoded [`Presentation`] from a cryptographically verified JWS.
12///
13/// Note that having an instance of this type only means the JWS it was constructed from was verified.
14/// It does not imply anything about a potentially present proof property on the presentation itself.
15#[non_exhaustive]
16#[derive(Debug, Clone)]
17pub struct DecodedJwtPresentation<CRED, T = Object> {
18 /// The decoded presentation parsed to the [Verifiable Credentials Data model](https://www.w3.org/TR/vc-data-model/).
19 pub presentation: Presentation<CRED, T>,
20 /// The protected header parsed from the JWS.
21 pub header: Box<JwsHeader>,
22 /// The expiration date parsed from the JWT claims.
23 pub expiration_date: Option<Timestamp>,
24 /// The issuance date parsed from the JWT claims.
25 pub issuance_date: Option<Timestamp>,
26 /// The `aud` property parsed from the JWT claims.
27 pub aud: Option<Url>,
28 /// The custom claims parsed from the JWT.
29 pub custom_claims: Option<Object>,
30}