tests/testthat/test_hmac.R

context("HMAC signature")

test_that("ECDSA works", {
  key <- read_jwk("../keys/hmac.json")
  sig <- readBin("../keys/hmac.sig", raw(), 100)
  expect_identical(sig, unclass(openssl::sha256(charToRaw("testje"), key = key)))
})
r-lib/jose documentation built on Oct. 8, 2024, 6:46 p.m.