diff --git a/bindings/web5_uniffi/src/lib.rs b/bindings/web5_uniffi/src/lib.rs index a7320d04..e4b7fd4c 100644 --- a/bindings/web5_uniffi/src/lib.rs +++ b/bindings/web5_uniffi/src/lib.rs @@ -7,11 +7,7 @@ use web5_uniffi_wrapper::{ VerifiableCredentialCreateOptions as VerifiableCredentialCreateOptionsData, VerifiableCredentialData, }, - verifiable_presentation_1_1::{ - VerifiablePresentation, - VerifiablePresentationCreateOptions as VerifiablePresentationCreateOptionsData, - VerifiablePresentationData, - }, + verifiable_presentation_1_1::VerifiablePresentation, }, crypto::{ dsa::{ @@ -39,8 +35,11 @@ use web5_uniffi_wrapper::{ }; use web5::{ - credentials::CredentialSchema as CredentialSchemaData, - credentials::CredentialStatus as CredentialStatusData, + credentials::{ + CredentialSchema as CredentialSchemaData, CredentialStatus as CredentialStatusData, + VerifiablePresentation as VerifiablePresentationData, + VerifiablePresentationCreateOptions as VerifiablePresentationCreateOptionsData, + }, crypto::{dsa::Dsa, jwk::Jwk as JwkData}, dids::{ data_model::{ diff --git a/bindings/web5_uniffi_wrapper/src/credentials/verifiable_presentation_1_1.rs b/bindings/web5_uniffi_wrapper/src/credentials/verifiable_presentation_1_1.rs index b3a8f9fb..5266ef0a 100644 --- a/bindings/web5_uniffi_wrapper/src/credentials/verifiable_presentation_1_1.rs +++ b/bindings/web5_uniffi_wrapper/src/credentials/verifiable_presentation_1_1.rs @@ -1,16 +1,7 @@ use crate::{dids::bearer_did::BearerDid, errors::Result}; -use std::{sync::Arc, time::SystemTime}; +use std::sync::Arc; use web5::credentials::VerifiablePresentation as InnerVerifiablePresentation; -use web5::credentials::VerifiablePresentationCreateOptions as InnerVerifiablePresentationCreateOptions; - -#[derive(Default)] -pub struct VerifiablePresentationCreateOptions { - pub id: Option, - pub context: Option>, - pub r#type: Option>, - pub issuance_date: Option, - pub expiration_date: Option, -} +use web5::credentials::VerifiablePresentationCreateOptions; pub struct VerifiablePresentation { pub inner_vp: InnerVerifiablePresentation, @@ -22,22 +13,13 @@ impl VerifiablePresentation { vc_jwts: Vec, options: Option, ) -> Result { - let options = options.unwrap_or_default(); - let inner_options = InnerVerifiablePresentationCreateOptions { - id: options.id, - context: options.context, - r#type: options.r#type, - issuance_date: options.issuance_date, - expiration_date: options.expiration_date, - }; - - let inner_vp = InnerVerifiablePresentation::create(holder, vc_jwts, Some(inner_options))?; + let inner_vp = InnerVerifiablePresentation::create(holder, vc_jwts, options)?; Ok(Self { inner_vp }) } - pub fn get_data(&self) -> Result { - Ok(VerifiablePresentationData { + pub fn get_data(&self) -> Result { + Ok(InnerVerifiablePresentation { context: self.inner_vp.context.clone(), id: self.inner_vp.id.clone(), r#type: self.inner_vp.r#type.clone(), @@ -63,14 +45,3 @@ impl VerifiablePresentation { Ok(vp_jwt) } } - -#[derive(Clone)] -pub struct VerifiablePresentationData { - pub context: Vec, - pub id: String, - pub r#type: Vec, - pub holder: String, - pub issuance_date: SystemTime, - pub expiration_date: Option, - pub verifiable_credential: Vec, -} diff --git a/web5-spec b/web5-spec index 748a115b..10f3f2b4 160000 --- a/web5-spec +++ b/web5-spec @@ -1 +1 @@ -Subproject commit 748a115bf607f7ddf02996b678a5b09b4ccbf243 +Subproject commit 10f3f2b4d571b41a3598c4bcc23d081fffd7f1ef