Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support JWS JSON Serialization #242

Open
lukasjhan opened this issue Jun 15, 2024 · 6 comments
Open

Support JWS JSON Serialization #242

lukasjhan opened this issue Jun 15, 2024 · 6 comments
Assignees
Labels
feature New functionality.

Comments

@lukasjhan
Copy link
Member

In sd-jwt draft 09 section 9, JSON Serialization method is added. Let's support this feature in our library

@lukasjhan lukasjhan self-assigned this Jun 15, 2024
@lukasjhan lukasjhan added the feature New functionality. label Jun 15, 2024
@cre8 cre8 self-assigned this Aug 18, 2024
@lukasjhan
Copy link
Member Author

There are two kinds of serialization, flatten and general.

I was thinking about adding the converting function between:

  • SD-JWT <=> JWS flatten serialization
  • SD-JWT <=> JWS general serialization

What do you think about it? @cre8

@cre8
Copy link
Contributor

cre8 commented Aug 19, 2024

That does not make so much sense:
A generalised Json serialisation can have multiple issuer signatures (required for jades signature). So we can not transfer from this to compact when there are more than one. With flattened it should be possible.

I started the implementation that you pass the issuance function a value what kind of type do you want and the return value is based on this.

Then we need to update the decode function and verify so the three options can be consumed. The default one should be compact to not break any existing implementations

@lukasjhan
Copy link
Member Author

Yeah, you're right. A generalised Json serialisation can have multiple signatures. So there is a possibility that it cannot be converted to a compact one.

I think it's better to approach it the way you said. :)

@cre8
Copy link
Contributor

cre8 commented Aug 19, 2024

I have implemented it for the issuance, but decoding and tests are missing. Maybe I am able to create a pr until Friday

@lukasjhan
Copy link
Member Author

To prevent too many changes to the internal implementation, I'm considering creating a new class for JWS JSON-related functions.

@cre8
Copy link
Contributor

cre8 commented Oct 17, 2024

I don't think that is possible, see my current PR. The jwt object needs to hold multiple signatures, so we need to touch some of the core classes

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature New functionality.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants