Skip to content

Commit

Permalink
[Minor] Add dnskey type of output
Browse files Browse the repository at this point in the history
Issue: #4429
  • Loading branch information
vstakhov committed Apr 7, 2023
1 parent 1fb491d commit 284b828
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion lualib/rspamadm/dkim_keygen.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand Down Expand Up @@ -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

Expand Down

0 comments on commit 284b828

Please sign in to comment.