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

Compact serialization support for JWE API similar to specifying flag -c in command line #69

Closed
bineshtj opened this issue Jul 25, 2019 · 5 comments

Comments

@bineshtj
Copy link

I know that calling jose jwe enc -c -I pt.txt -k rsa_pub.jwk from command line gives a compact serialized output. Is it possible to obtain a similar output from the function jose_jwe_enc in jwe.h? How to achieve it if the purpose is not command line execution but simple function calls from a program?

@nickjwallin
Copy link

I have the same question!

In the meantime I intend on implementing the compact serialization myself, as it doesn't seem too difficult. I will post back here with my results once I figure it out... But just to be clear I am running this library in Swift, so my implementation will probably only slightly help you write your own in C @bineshtj

@bineshtj
Copy link
Author

bineshtj commented Aug 2, 2019

I'm also doing the same in the meantime. Well do post a link of what you achieve.

@sergio-correia
Copy link
Collaborator

The output is actually done by the JSON library we use, jansson (documentation here: https://jansson.readthedocs.io/en/2.12/).

Functions like jose_jwe_enc will work with json_t* types from jansson, and eventually we print its content with functions like json_dumps or json_dumpf, for instance. These functions take flags to control their representation, and one of them is JSON_COMPACT, which seems to be what you are looking for.

@sarroutbi
Copy link
Collaborator

@bineshtj : did the usage of JSON_COMPACT, suggested by @sergio-correia (thanks Sergio) worked for your purpose? Can we close this issue?

@bineshtj
Copy link
Author

bineshtj commented Oct 7, 2021

Yes please. Thanks.

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

No branches or pull requests

4 participants