Fix tests

This commit is contained in:
Miguel Terron 2025-06-02 15:35:51 +12:00
parent c1be35a820
commit b4b7c9e5b7

View file

@ -55,14 +55,14 @@ end
local function test_csr_generation() local function test_csr_generation()
local priv_key, pub_key = crypto.generatekeypair("rsa", 2048) local priv_key, pub_key = crypto.generatekeypair("rsa", 2048)
local subject_name = "CN=example.com,O=Example Org,C=US" local subject_name = "CN=example.com,O=Example Org,C=US"
local csr = crypto.csrGenerate(priv_key, subject_name) local csr = crypto.generateCsr(priv_key, subject_name)
assert_equal(type(csr), "string", "CSR generation") assert_equal(type(csr), "string", "CSR generation")
end end
-- Test PemToJwk conversion -- Test PemToJwk conversion
local function test_pem_to_jwk() local function test_pem_to_jwk()
local priv_key, pub_key = crypto.generatekeypair("rsa", 2048) local priv_key, pub_key = crypto.generatekeypair("rsa", 2048)
local jwk = crypto.PemToJwk(pub_key) local jwk = crypto.convertPemToJwk(pub_key)
assert_equal(type(jwk), "table", "PEM to JWK conversion") assert_equal(type(jwk), "table", "PEM to JWK conversion")
assert_equal(jwk.kty, "RSA", "JWK key type") assert_equal(jwk.kty, "RSA", "JWK key type")
end end