baseid_vc/
presentation.rs

1//! Verifiable Presentation types.
2
3use serde::{Deserialize, Serialize};
4
5use crate::credential::VerifiableCredential;
6
7/// A W3C Verifiable Presentation.
8#[derive(Debug, Clone, Serialize, Deserialize)]
9#[serde(rename_all = "camelCase")]
10pub struct VerifiablePresentation {
11    /// JSON-LD context.
12    #[serde(rename = "@context")]
13    pub context: Vec<String>,
14
15    /// Presentation types.
16    pub r#type: Vec<String>,
17
18    /// The enclosed verifiable credentials.
19    #[serde(default, skip_serializing_if = "Vec::is_empty")]
20    pub verifiable_credential: Vec<VerifiableCredential>,
21
22    /// Holder of the presentation.
23    #[serde(skip_serializing_if = "Option::is_none")]
24    pub holder: Option<String>,
25
26    /// Cryptographic proof.
27    #[serde(skip_serializing_if = "Option::is_none")]
28    pub proof: Option<serde_json::Value>,
29}