From 6a53b3e324c54ebb2c03948fd5e4c9a4e458f64a Mon Sep 17 00:00:00 2001 From: Ivan Leshchenko Date: Fri, 6 Sep 2024 17:00:35 -0400 Subject: [PATCH] feat: expose more SSI api in teddybear_vc (#82) --- crates/teddybear-js/src/lib.rs | 6 ++++-- crates/teddybear-vc/src/lib.rs | 25 +++++++++++++------------ 2 files changed, 17 insertions(+), 14 deletions(-) diff --git a/crates/teddybear-js/src/lib.rs b/crates/teddybear-js/src/lib.rs index 7c7b275..f3f3f68 100644 --- a/crates/teddybear-js/src/lib.rs +++ b/crates/teddybear-js/src/lib.rs @@ -27,8 +27,10 @@ use teddybear_jwe::{A256Gcm, XC20P}; use wasm_bindgen::prelude::*; use teddybear_vc::{ - issue_vc, present_vp, verify, ContextLoader as InnerContextLoader, JsonPresentation, - SpecializedJsonCredential, DI, + issue_vc, present_vp, + ssi_json_ld::ContextLoader as InnerContextLoader, + ssi_vc::v2::syntax::{JsonPresentation, SpecializedJsonCredential}, + verify, DI, }; const OBJECT_SERIALIZER: Serializer = Serializer::new().serialize_maps_as_objects(true); diff --git a/crates/teddybear-vc/src/lib.rs b/crates/teddybear-vc/src/lib.rs index b287228..b9f3428 100644 --- a/crates/teddybear-vc/src/lib.rs +++ b/crates/teddybear-vc/src/lib.rs @@ -9,9 +9,16 @@ use ssi_claims::{ StandardCryptographicSuite, }, Invalid, InvalidClaims, ProofValidationError, SignatureEnvironment, SignatureError, - ValidateProof, VerificationParameters, + ValidateClaims, ValidateProof, VerifiableClaims, VerificationParameters, +}; +use ssi_json_ld::{ContextLoader, Expandable, IriBuf, JsonLdNodeObject}; +use ssi_vc::{ + v2::{ + syntax::{JsonPresentation, SpecializedJsonCredential}, + Credential, Presentation, + }, + Identified, }; -use ssi_json_ld::IriBuf; use ssi_verification_methods::{ Ed25519VerificationKey2020, ProofPurpose, ReferenceOrOwned, SingleSecretSigner, VerificationMethodResolutionError, VerificationMethodResolver, @@ -20,16 +27,10 @@ use teddybear_crypto::{default_did_method, CustomVerificationMethodDIDResolver, use crate::credential_ref::CredentialRef; -pub use ssi_claims::{ValidateClaims, VerifiableClaims}; -pub use ssi_json_ld::{ContextLoader, Expand, Expandable, JsonLdNodeObject, ValidId}; -pub use ssi_vc::{ - syntax::{RequiredContext, RequiredContextList, RequiredType, RequiredTypeSet}, - v2::{ - syntax::{JsonPresentation, SpecializedJsonCredential}, - Credential, Presentation, - }, - Identified, -}; +pub use ssi_claims; +pub use ssi_json_ld; +pub use ssi_vc; +pub use ssi_verification_methods; pub type DI = DataIntegrity;