Skip to content

SD-JWT Functionality for WebAssembly

Latest
Compare
Choose a tag to compare
@robjsliwa robjsliwa released this 30 Oct 14:15
c671b9e

This release introduces support for SD-JWT operations within a WebAssembly (WASM) environment, expanding functionality to enable secure interactions between Issuers, Holders, and Verifiers in WebAssembly builds. Specifically, the additions expose SdJwtIssuer, SdJwtHolder, and SdJwtVerifier modules, which allow clients to perform encoding, presentation creation, and verification of SD-JWTs directly in WASM.

Key Changes:

  1. New WASM-Compatible Structs and Methods:

    • SdJwtIssuer, SdJwtHolder, and SdJwtVerifier are now WASM-compatible, enabling:
      • Encoding: Issuers can encode claims with specified signing keys and algorithms.
      • Verification: Holders can verify issuer tokens and create selective presentations, while Verifiers confirm holder presentations using configurable public keys and algorithms.
    • Methods leverage wasm_bindgen to expose APIs, ensuring accessibility and compatibility for WebAssembly consumers.
  2. Code Refactoring and Enhancements:

    • Refactoring: Adjustments to HashAlgorithm and Disclosure structs to support serialization and improve readability.
    • Error Handling: Expanded error enum to include WasmJsValueConversionFailed for seamless WASM error reporting, with mappings to JsValue where applicable.
  3. Build and Dependency Updates:

    • Version bump in Cargo.toml to 0.8.1 and addition of WASM-specific dependencies like serde-wasm-bindgen.
    • Minor updates in .gitignore to accommodate new build output.

Impact:

This enhancement broadens the usage scenarios for SD-JWTs, enabling developers to leverage these features in web applications with WebAssembly. The changes promote interoperability and allow for flexible credential management within WASM contexts.