From e12c9a83df999049970403cbbd6a6427f79f889e Mon Sep 17 00:00:00 2001 From: Matthew Wild Date: Mon, 11 Jul 2022 14:30:39 +0100 Subject: util.paseto: Drop custom wrappers around key objects The PASETO spec recommends - no, *requires* - that implementations enforce type safety for keys, and e.g. do not pass them around as arbitrary byte strings. Typed wrapper objects are recommended. I originally followed this advice when starting the lib. However, key wrapping and type safety is now also a feature of util.crypto. All we're doing is duplicating it unnecessarily with this additional wrapper code. --- spec/util_paseto_spec.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'spec') diff --git a/spec/util_paseto_spec.lua b/spec/util_paseto_spec.lua index a57cea18..ec30c6a7 100644 --- a/spec/util_paseto_spec.lua +++ b/spec/util_paseto_spec.lua @@ -73,7 +73,7 @@ describe("util.paseto", function () describe("basic sign/verify", function () local function new_keypair() local kp = paseto.v4_public.new_keypair(); - return kp.private_key:export(), kp.public_key:export(); + return kp:private_pem(), kp:public_pem(); end local privkey1, pubkey1 = new_keypair(); -- cgit v1.2.3