Releases: robjsliwa/sd-jwt
SD-JWT Functionality for WebAssembly
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:
-
New WASM-Compatible Structs and Methods:
SdJwtIssuer
,SdJwtHolder
, andSdJwtVerifier
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.
-
Code Refactoring and Enhancements:
- Refactoring: Adjustments to
HashAlgorithm
andDisclosure
structs to support serialization and improve readability. - Error Handling: Expanded error enum to include
WasmJsValueConversionFailed
for seamless WASM error reporting, with mappings toJsValue
where applicable.
- Refactoring: Adjustments to
-
Build and Dependency Updates:
- Version bump in
Cargo.toml
to0.8.1
and addition of WASM-specific dependencies likeserde-wasm-bindgen
. - Minor updates in
.gitignore
to accommodate new build output.
- Version bump in
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
- 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.
- 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.
- 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.
- 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.