commit 284b828: [Minor] Add `dnskey` type of output

Vsevolod Stakhov vsevolod at rspamd.com
Fri Apr 7 20:21:03 UTC 2023


Author: Vsevolod Stakhov
Date: 2023-04-07 21:17:44 +0100
URL: https://github.com/rspamd/rspamd/commit/284b828a145d85efd81e2f7e9a606aa0e7143373 (HEAD -> master)

[Minor] Add `dnskey` type of output
Issue: #4429

---
 lualib/rspamadm/dkim_keygen.lua | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

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
 


More information about the Commits mailing list