I am using jose4j
to encrypt a String with JWE, following this documentation https://bitbucket.org/b_c/jose4j/wiki/JWE%20Examples
In the example, they used {\"kty\":\"oct\",\"k\":\"Fdh9u8rINxfivbrianbbVT1u232VQBZYKx1HGAGPt2I\"}
It works well, but how to use RSA as kty ? Should I generate myself a key and put it in the "k" parameter ?
no, a JWK representation of an RSA key has different parameters e.g.:
See RFC7517 : https://www.rfc-editor.org/rfc/rfc7517