Skip to content

Commit

Permalink
[Minor] Add --name parameter to keypair generation
Browse files Browse the repository at this point in the history
  • Loading branch information
vstakhov committed Jan 5, 2023
1 parent 3f5ca5e commit 52abb61
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions lualib/rspamadm/keypair.lua
Expand Up @@ -48,6 +48,9 @@ generate:mutex(
:description "Output UCL"
:default(true)
)
generate:option "--name"
:description "Adds name extension"
:argname "<name>"

-- Sign subcommand

Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 52abb61

Please sign in to comment.