MCPcopy Index your code
hub / github.com/ccxt/ccxt / hmacRaw

Method hmacRaw

java/lib/src/main/java/io/github/ccxt/base/Crypto.java:272–281  ·  view source on GitHub ↗
(String hsName, String data, Object secret)

Source from the content-addressed store, hash-verified

270 }
271
272 private static byte[] hmacRaw(String hsName, String data, Object secret) {
273 // hsName = HS256/HS384/HS512
274 String jce = switch (hsName) {
275 case "HS256" -> "HmacSHA256";
276 case "HS384" -> "HmacSHA384";
277 case "HS512" -> "HmacSHA512";
278 default -> throw new IllegalArgumentException("Unsupported HS algorithm: " + hsName);
279 };
280 return hmac(jce, toUtf8(data), (secret instanceof String) ? toUtf8(secret) : (byte[]) secret);
281 }
282
283 // ====================================================
284 // Raw sign helpers

Callers 1

JwtMethod · 0.95

Calls 2

hmacMethod · 0.95
toUtf8Method · 0.95

Tested by

no test coverage detected