类 NacosSignatureAlgorithm

java.lang.Object
com.alibaba.nacos.plugin.auth.impl.jwt.NacosSignatureAlgorithm

public final class NacosSignatureAlgorithm extends Object
SignAlgorithm.
作者:
Weizhan▪Yun
  • 字段详细资料

  • 构造器详细资料

    • NacosSignatureAlgorithm

      private NacosSignatureAlgorithm(String alg, String jcaName, String header)
  • 方法详细资料

    • verify

      public static NacosUser verify(String jwt, Key key) throws AccessException
      verify jwt.
      参数:
      jwt - complete jwt string
      key - for signature
      返回:
      object for payload
      抛出:
      AccessException - access exception
    • verify

      public NacosUser verify(String header, String payload, String signature, Key key) throws AccessException
      verify jwt.
      参数:
      header - header of jwt
      payload - payload of jwt
      signature - signature of jwt
      key - for signature
      返回:
      object for payload
      抛出:
      AccessException - access exception
    • getExpiredTimeInSeconds

      public static long getExpiredTimeInSeconds(String jwt, Key key) throws AccessException
      get jwt expire time in seconds.
      参数:
      jwt - complete jwt string
      key - for signature
      返回:
      expire time in seconds
      抛出:
      AccessException - access exception
    • getExpireTimeInSeconds

      public long getExpireTimeInSeconds(String header, String payload, String signature, Key key) throws AccessException
      get jwt expire time in seconds.
      参数:
      header - header of jwt
      payload - payload of jwt
      signature - signature of jwt
      key - for signature
      返回:
      expire time in seconds
      抛出:
      AccessException - access exception
    • sign

      String sign(NacosJwtPayload nacosJwtPayload, Key key)
    • getMacInstance

      private Mac getMacInstance(Key key)
    • getAlgorithm

      public String getAlgorithm()
    • getJcaName

      public String getJcaName()
    • getHeader

      public String getHeader()