Skip to content

Releases: robjsliwa/sd-jwt

SD-JWT Functionality for WebAssembly

30 Oct 14:15
c671b9e
Compare
Choose a tag to compare

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.

release_v0.8.0

21 Oct 17:16
e7f1c04
Compare
Choose a tag to compare
  1. JWT Backend Migration:
    • Replaced the jsonwebtoken crate with jwt-rustcrypto to improve flexibility and support for RustCrypto-based algorithms.
    • Updated key handling structures (KeyForDecoding, KeyForEncoding) and adjusted the internal algorithm validation logic accordingly.
    • Updated features in Cargo.toml to reflect the new optional jwt-rustcrypto dependency and adjusted the noring and default feature sets.
  2. Refactoring and Simplifications:
    • Removed the ring-based conditional code to focus on a single JWT library (RustCrypto).
    • Simplified the KeyForDecoding and KeyForEncoding structs to handle RSA components and PEM formats consistently across features.
  3. Validation Improvements:
    • Enhanced the Validation struct to include new convenience methods such as without_expiry(), with_audience(), and with_issuer(), providing a more flexible API for users.
    • Replaced direct uses of no_exp with without_expiry() for clarity and consistency in handling token expiration.
  4. Miscellaneous Fixes:
    • Updated the README to reflect the new usage of jwt-rustcrypto and supported algorithms.
    • Addressed linter errors and minor code style issues.
    • Fixed inconsistencies in key generation and conversion methods, particularly in test utilities.
    • Renamed some modules (algorithm to algorithms) and performed other minor refactors to improve code clarity and organization.