Browse Source

[Minor] Add --name parameter to keypair generation

tags/3.5
Vsevolod Stakhov 1 year ago
parent
commit
52abb61a10
No account linked to committer's email address
1 changed files with 9 additions and 0 deletions
  1. 9
    0
      lualib/rspamadm/keypair.lua

+ 9
- 0
lualib/rspamadm/keypair.lua View File

@@ -48,6 +48,9 @@ generate:mutex(
:description "Output UCL"
:default(true)
)
generate:option "--name"
:description "Adds name extension"
:argname "<name>"

-- 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

Loading…
Cancel
Save