Vsevolod Stakhov
3 years ago
No known key found for this signature in database
GPG Key ID: 7647B6790081437
1 changed files with
10 additions and
0 deletions
-
test/lua/unit/rsa.lua
|
|
|
@ -37,4 +37,14 @@ context("RSA signature verification test", function() |
|
|
|
assert_not_nil(rsa_sig) |
|
|
|
assert_true(rsa.verify_memory(rsa_key, rsa_sig, h:bin())) |
|
|
|
end) |
|
|
|
|
|
|
|
test("RSA keypair + sign + verify", function() |
|
|
|
local sk, pk = rsa.keypair() |
|
|
|
local sig = rsa.sign_memory(sk, "test") |
|
|
|
assert_true(rsa.verify_memory(pk, sig, "test")) |
|
|
|
assert_false(rsa.verify_memory(pk, sig, "test1")) |
|
|
|
-- Overwrite |
|
|
|
sk, pk = rsa.keypair() |
|
|
|
assert_false(rsa.verify_memory(pk, sig, "test")) |
|
|
|
end) |
|
|
|
end) |