Skip to content
Discussion options

You must be logged in to vote

XMLDsig signature format is only suitable for XML documents. You could apply JSON Web Signature (JWS) which is designed for JSON documents.

JWS Signature

A JWS with compact serialization is represented by (see RFC7515)

BASE64URL(UTF8(JWS Protected Header)) || '.' ||
BASE64URL(JWS Payload) || '.' ||
BASE64URL(JWS Signature)

JWS protected header

The simplest header is composed by . means algorithm RSA with SHA-256algRS256

{"alg":"RS256"}

You can add other parameters such as (X.509 Certificate Chain) or (Content Type)x5ccty

JWS Payload

The payload is your JSON object encoded as base64url

eyJ1cGRhdGVTUlJlcSI6IHsgImluY2lkZW50SUQiOiAiIiwgImNyZWF0ZWRCeSI6ICIwMzcwMjIwMDAwNDIwNDgiLCAiZGVzY3J…

Replies: 2 comments 1 reply

Comment options

You must be logged in to vote
1 reply
@marcialwushu
Comment options

marcialwushu Nov 30, 2021
Maintainer Author

Answer selected by marcialwushu
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
1 participant