mirror of
https://github.com/jart/cosmopolitan.git
synced 2025-07-12 14:09:12 +00:00
Fix tests
This commit is contained in:
parent
c1be35a820
commit
b4b7c9e5b7
1 changed files with 2 additions and 2 deletions
|
@ -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
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue