程序包 gateway.api

类 JwtContext

java.lang.Object
gateway.api.JwtContext

public class JwtContext extends Object
JWT上下文
作者:
neeker
  • 字段详细资料

    • appToken

      private String appToken
    • tokenLiveSconds

      private int tokenLiveSconds
    • algorithm

      private com.auth0.jwt.algorithms.Algorithm algorithm
  • 构造器详细资料

    • JwtContext

      JwtContext(String appToken, int tokenLiveSconds, com.auth0.jwt.algorithms.Algorithm algorithm)
  • 方法详细资料

    • getAppToken

      public String getAppToken()
      获取应用凭据
      返回:
    • getTokenLiveSconds

      public int getTokenLiveSconds()
      获取令牌存活时间(秒)
      返回:
    • setTokenLiveSconds

      public void setTokenLiveSconds(int tokenLiveSconds)
      设置令牌存活时间(秒)
      参数:
      tokenLiveSconds - 秒
    • createJwtToken

      public JwtToken createJwtToken()
      创建JWT令牌
      返回:
    • create

      public static JwtContext create(String app_token, RSAKey rsa_key, int token_live_seconds)
      创建JWT上下文
      参数:
      app_token - 应用凭据
      rsa_key - RSA私钥
      token_live_seconds - 令牌存活时间
      返回:
    • create

      public static JwtContext create(String app_token, com.auth0.jwt.algorithms.Algorithm algorithm, int token_live_seconds)