diff options
author | Vsevolod Stakhov <vsevolod@rspamd.com> | 2023-04-07 21:17:44 +0100 |
---|---|---|
committer | Vsevolod Stakhov <vsevolod@rspamd.com> | 2023-04-07 21:17:44 +0100 |
commit | 284b828a145d85efd81e2f7e9a606aa0e7143373 (patch) | |
tree | ef5451cdec3dc25f27504ebf4e36f85567ea2a8f /lualib | |
parent | 1fb491d630da91c2959d574ddc20047ac2aacde7 (diff) | |
download | rspamd-284b828a145d85efd81e2f7e9a606aa0e7143373.tar.gz rspamd-284b828a145d85efd81e2f7e9a606aa0e7143373.zip |
[Minor] Add `dnskey` type of output
Issue: #4429
Diffstat (limited to 'lualib')
-rw-r--r-- | lualib/rspamadm/dkim_keygen.lua | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/lualib/rspamadm/dkim_keygen.lua b/lualib/rspamadm/dkim_keygen.lua index 05be73436..c00371298 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 |