Skip to content

Commit

Permalink
Prepare v0.0.1.
Browse files Browse the repository at this point in the history
Signed-off-by: Sergey Minaev <[email protected]>
  • Loading branch information
jovfer committed Dec 18, 2023
1 parent 0bbf2e0 commit 79c3a8c
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 20 deletions.
7 changes: 6 additions & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,9 +1,14 @@
[package]
name = "sd-jwt-rs"
version = "0.1.0"
version = "0.0.1"
edition = "2021"
license = "Apache-2.0 OR MIT"
description = """
Rust reference implementation of the [IETF SD-JWT specification](https://datatracker.ietf.org/doc/draft-ietf-oauth-selective-disclosure-jwt/).
"""
rust-version = "1.74.0"
authors = ["Sergey Minaev <[email protected]>"]
repository = "https://github.com/openwallet-foundation-labs/sd-jwt-rust"

[dependencies]
base64 = "0.21"
Expand Down
45 changes: 26 additions & 19 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,35 @@
# SD-JWT Rust Reference Implementation

This is the reference implementation of the [IETF SD-JWT specification](https://datatracker.ietf.org/doc/draft-ietf-oauth-selective-disclosure-jwt/) written in Rust.
Supported version: 6.

Note: while the project is started as a reference implementation, it is intended to be evolved to a production-ready, high-performance implementations in the long-run.

## Usage
Include the crate in the `[dependencies]` section of your `Cargo.toml`:
```
sd-jwt-payload = "0.0.1"
```

## API
Note: the current version of the crate is 0.0.x, so the API should be considered as experimental.
Proposals about API improvements are highly appreciated.

```rust
fn demo() {
let mut issuer = SDJWTIssuer::new(issuer_key, None);
let sd_jwt = issuer.issue_sd_jwt(claims, SDJWTClaimsStrategy::Full, holder_key, add_decoy, "compact".to_owned()).unwrap();

let mut holder = SDJWTHolder::new(sd_jwt, "compact".to_owned()).unwrap();
let presentation = holder.create_presentation(claims_to_disclosure, None, None, None, None).unwrap();

let verified_claims = SDJWTVerifier::new(presentation, cb_to_resolve_issuer_key, None, None, "compact".to_owned()).unwrap()
.verified_claims;
}
```

See `tests/demos.rs` for more details;

## Repository structure

### SD-JWT Rust crate
Expand All @@ -22,25 +48,6 @@ cargo test
### Interoperability testing tool
TBD

## API
Note: the current version of the crate is 0.0.x, so the API should be considered as experimental.
Proposals about API improvements are highly appreciated.

TBD

## Functionality

Please refer to the list, unchecked items are in progress and will be supported soon
- [x] Issuance of SD-JWT
- [x] Presentation of SD-JWT with custom schema
- [x] Verification of SD-JWT
- [x] CI pipelines for Ubuntu
- [ ] Support of multiple hash / sign algorithms
- [ ] JWT Key Binding support
- [x] Selective disclosure of arrays elements
- [ ] Extended error handling
- [ ] Extended CI/CD

## External Dependencies

Dual license (MIT/Apache 2.0) dependencies: [base64](https://crates.io/crates/base64), [lazy_static](https://crates.io/crates/lazy_static) [log](https://crates.io/crates/log), [serde_json](https://crates.io/crates/serde_json), [sha2](https://crates.io/crates/sha2), [rand](https://crates.io/crates/rand), [hmac](https://crates.io/crates/hmac).
Expand Down

0 comments on commit 79c3a8c

Please sign in to comment.