I am used to using JWTs so when I needed the same behavior but with no plaintext user data I looked at JWE. JWE is very similar to JWT; however, I did not see the exp, nbf or iat fields which limit the time the message is valid for (preventing replays after the exp time).
My question is: in practice how do you protect JWE from being used for replay attacks?
- Is the JWE header signed? Can I just put those time-restrictive fields in it?
- Seems a little sketchy, but could I potentially use the
ivas thenbfand have an implicitexptime of say 1 minute after that? or maybe squeeze thenbfandexpboth as the IV? - If I have to nest the JWE in a JWT to prevent replay, is there a standard way of doing this?