JWT content is compiled by JWTBuilder, which is divided into two parts: JWTHeader and Claims. These two parts are filled separately. JWT or JWS Token String is obtained eventually according to whether the package is signed or not.
To gain a better understanding, this method is introduced in JWT module. DID Document provides a method to create JWTBuilder and get the JWT compilation mode.
voidJWTBuilder_Destroy(JWTBuilder *builder);
JWTBuilder object needs to be destroyed after using.
This method adds the elements of Claims in JWT. If the value type of the added elements is not string, you can also choose JWT Builder _ SetClaimwithJSON, JWT Builder _ SetClaimwithIntegar and JWTBuilder_SetClaimWithBoolean. Refer to the API documentation for specific methods.