diff --git a/src/core/response/parameters.rs b/src/core/response/parameters.rs index 39c43ae..f2522d1 100644 --- a/src/core/response/parameters.rs +++ b/src/core/response/parameters.rs @@ -8,7 +8,7 @@ use ssi::{ claims::vc::{self, v2::SpecializedJsonCredential}, json_ld::syntax::Object, one_or_many::OneOrManyRef, - prelude::{AnyDataIntegrity, AnyJsonPresentation}, + prelude::{AnyDataIntegrity, AnyJsonPresentation, AnySuite, DataIntegrity}, OneOrMany, }; @@ -240,3 +240,17 @@ impl From for VpTokenItem { Self::JsonObject(obj) } } + +impl From> for VpTokenItem { + fn from(value: DataIntegrity) -> Self { + let serde_json::Value::Object(obj) = serde_json::to_value(value) + // SAFETY: by definition a VCDM2.0 presentation is a JSON object. + .unwrap() + else { + // SAFETY: by definition a VCDM2.0 presentation is a JSON object. + unreachable!() + }; + + Self::JsonObject(obj) + } +}