From: Vsevolod Stakhov Date: Fri, 7 Apr 2023 20:17:44 +0000 (+0100) Subject: [Minor] Add `dnskey` type of output X-Git-Tag: 3.6~163 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=284b828a145d85efd81e2f7e9a606aa0e7143373;p=thirdparty%2Frspamd.git [Minor] Add `dnskey` type of output Issue: #4429 --- diff --git a/lualib/rspamadm/dkim_keygen.lua b/lualib/rspamadm/dkim_keygen.lua index 05be734366..c00371298b 100644 --- a/lualib/rspamadm/dkim_keygen.lua +++ b/lualib/rspamadm/dkim_keygen.lua @@ -52,10 +52,11 @@ parser:option '-t --type' } :default 'rsa' parser:option '-o --output' - :description 'Output public key in the following format: dns or plain' + :description 'Output public key in the following format: dns, dnskey or plain' :convert { ['dns'] = 'dns', ['plain'] = 'plain', + ['dnskey'] = 'dnskey', } :default 'dns' parser:option '--priv-output' @@ -109,6 +110,8 @@ local function print_public_key(opts, pk) io.write("\n") elseif opts.output == 'dns' then print_public_key_dns(opts, base64_pk) + elseif opts.output == 'dnskey' then + io.write(string.format('v=DKIM1; k=rsa; p=%s\n', base64_pk)) end end