I want to save with JOSE4J the JSON representation of a RsaJsonWebKey object in JSON format and then recreate a RsaJsonWebKey object from it again. I have the marshalling part:
RsaJsonWebKey rsaJsonWebKey = RsaJwkGenerator.generateJwk(2048);
String jwkjson = rsaJsonWebKey.toJson(JsonWebKey.OutputControlLevel.INCLUDE_PRIVATE);
but how to unmarshall it and recreate RsaJsonWebKey. That is where I'm stuck as I don't see a constructor of RsaJsonWebKey allowing that.
The question is related to this question
JWT becomes invalid after restarting the server
but it doesn't explain how to unmarshall.