aboutsummaryrefslogtreecommitdiffstats
path: root/lualib
diff options
context:
space:
mode:
authorVsevolod Stakhov <vsevolod@rspamd.com>2023-04-07 21:17:44 +0100
committerVsevolod Stakhov <vsevolod@rspamd.com>2023-04-07 21:17:44 +0100
commit284b828a145d85efd81e2f7e9a606aa0e7143373 (patch)
treeef5451cdec3dc25f27504ebf4e36f85567ea2a8f /lualib
parent1fb491d630da91c2959d574ddc20047ac2aacde7 (diff)
downloadrspamd-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.lua5
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