GithubHelp home page GithubHelp logo

jovfer / sd-jwt-rust Goto Github PK

View Code? Open in Web Editor NEW

This project forked from openwallet-foundation-labs/sd-jwt-rust

0.0 0.0 0.0 93 KB

SD-JWT Rust Reference Implementation

License: Apache License 2.0

Rust 100.00%

sd-jwt-rust's Introduction

SD-JWT Rust Reference Implementation

This is the reference implementation of the IETF SD-JWT specification written in Rust. Supported version: 7.

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.

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.

fn demo() {
    let mut issuer = SDJWTIssuer::new(issuer_key, None);
    let sd_jwt = issuer.issue_sd_jwt(claims, ClaimsForSelectiveDisclosureStrategy::AllLevels, holder_key, add_decoy, SDJWTSerializationFormat::Compact).unwrap();

    let mut holder = SDJWTHolder::new(sd_jwt, SDJWTSerializationFormat::Compact).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, SDJWTSerializationFormat::Compact).unwrap()
                            .verified_claims;
}

See tests/demos.rs for more details;

Repository structure

SD-JWT Rust crate

SD-JWT crate is the root of the repository.

To build the project simply perform:

cargo build

To run tests:

cargo test

Interoperability testing tool

See Generate tool README document.

External Dependencies

Dual license (MIT/Apache 2.0) dependencies: base64, lazy_static log, serde, serde_json, sha2, rand, hmac, thiserror. MIT license dependencies: jsonwebtoken, strum

Note: the list of dependencies may be changed in the future.

Initial Maintainers

  • Sergey Minaev (Github)
  • DSR Corporation Decentralized Systems Team (Github)

sd-jwt-rust's People

Contributors

jovfer avatar alexsdsr avatar abdulbois avatar tkuhrt avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.