spruceid / ssi

Core library for decentralized identity.
https://spruceid.dev
Apache License 2.0
180 stars 54 forks source link

ssi-sd-jwt implementation #529

Closed tristanmiller-spruceid closed 9 months ago

tristanmiller-spruceid commented 10 months ago

This new crate implements the sd-jwt specification as found here:

https://datatracker.ietf.org/doc/draft-ietf-oauth-selective-disclosure-jwt/

This is an RFC PR to provide a base for discussion, particularly around the shape of the public API.

TODO

CLAassistant commented 10 months ago

CLA assistant check
All committers have signed the CLA.

justAnIdentity commented 9 months ago

Am I correct thinking this implementation takes the Flat SD-JWT approach for nested data? I think that's fine, but just want to make sure we take that decision conciously cc @cobward

Voronar commented 9 months ago

Do you plan integration with ssi-vc? Will we see new enum value here https://github.com/spruceid/ssi/blob/main/ssi-vc/src/lib.rs#L282?

tristanmiller-spruceid commented 9 months ago

Do you plan integration with ssi-vc? Will we see new enum value here https://github.com/spruceid/ssi/blob/main/ssi-vc/src/lib.rs#L282?

I imagined that SD-JWT + VC would be a separate pull request, but I can integrate that here if that's required.

tristanmiller-spruceid commented 9 months ago

Am I correct thinking this implementation takes the Flat SD-JWT approach for nested data? I think that's fine, but just want to make sure we take that decision conciously cc @cobward

The highlevel API only supports Flat SD-JWT, but an example of using the lower level API to parse a more complex JWT that is both nested and contains recursive disclosures is given in https://github.com/tristanmiller-spruceid/ssi/blob/5bfe8af2d9ffabe3b7b68db79f5943ffd3c4fb10/ssi-sd-jwt/tests/rfc_examples.rs#L181 and to create and parse a nested JWT is here https://github.com/tristanmiller-spruceid/ssi/blob/5bfe8af2d9ffabe3b7b68db79f5943ffd3c4fb10/ssi-sd-jwt/tests/full_pathway.rs#L119