From 52abb61a10d81cbf98940a64167494b07b603dfd Mon Sep 17 00:00:00 2001 From: Vsevolod Stakhov Date: Thu, 5 Jan 2023 09:44:44 +0000 Subject: [PATCH] [Minor] Add --name parameter to keypair generation --- lualib/rspamadm/keypair.lua | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/lualib/rspamadm/keypair.lua b/lualib/rspamadm/keypair.lua index 62f2909b7..27dfd59a3 100644 --- a/lualib/rspamadm/keypair.lua +++ b/lualib/rspamadm/keypair.lua @@ -48,6 +48,9 @@ generate:mutex( :description "Output UCL" :default(true) ) +generate:option "--name" + :description "Adds name extension" + :argname "" -- Sign subcommand @@ -191,6 +194,12 @@ local function generate_handler(opts) -- TODO: probably, do it in a more safe way local kp = rspamd_keypair.create(mode, alg):totable() + if opts.name then + kp.keypair.extensions = { + name = opts.name + } + end + local format = 'ucl' if opts.json then -- 2.39.5