]> git.ipfire.org Git - thirdparty/rspamd.git/commitdiff
[Minor] Add `dnskey` type of output
authorVsevolod Stakhov <vsevolod@rspamd.com>
Fri, 7 Apr 2023 20:17:44 +0000 (21:17 +0100)
committerVsevolod Stakhov <vsevolod@rspamd.com>
Fri, 7 Apr 2023 20:17:44 +0000 (21:17 +0100)
Issue: #4429

lualib/rspamadm/dkim_keygen.lua

index 05be734366dfe830c9e67c9bcb730155c2120bb5..c00371298be7baf746c2e77f27dad9f9fc7f021e 100644 (file)
@@ -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