2.6. 快速 JWT 生成
如果设置了 smallrye.jwt.sign.key.location 或 smallrye.jwt.encrypt.key.location 属性,您可以使用单个调用来保护现有的声明,如 resources, maps, JsonObjects :
// More compact than Jwt.claims("/claims.json").sign();
Jwt.sign("/claims.json");
// More compact than Jwt.claims("/claims.json").jwe().encrypt();
Jwt.encrypt("/claims.json");
// More compact than Jwt.claims("/claims.json").innerSign().encrypt();
Jwt.signAndEncrypt("/claims.json");
如前文所述,如果尚未设置,则会自动添加以下声明: iat (issued at), exp (expires at), jti (token identifier), iss (issuer)和 aud (audience)。