Class SignUtils

java.lang.Object
xyz.felh.okx.v5.util.SignUtils

public class SignUtils extends Object
  • Constructor Details

    • SignUtils

      public SignUtils()
  • Method Details

    • signRest

      public static String signRest(String secretKey, String timestamp, String method, String path, String body)
    • signWebsocket

      public static String signWebsocket(LoginArg loginArg, String secretKey)
    • hmacSHA256

      public static byte[] hmacSHA256(byte[] key, byte[] content) throws Exception
      HmacSHA256算法,返回的结果始终是32位
      Parameters:
      key - 加密的键,可以是任何数据
      content - 待加密的内容
      Returns:
      加密后的内容
      Throws:
      Exception - ex