summaryrefslogtreecommitdiff
path: root/kiki.hs
diff options
context:
space:
mode:
authorjoe <joe@jerkface.net>2016-04-14 15:22:21 -0400
committerjoe <joe@jerkface.net>2016-04-14 15:22:21 -0400
commit3b74b5dfdac7856efc283d07e5579b3a485c32ed (patch)
tree1a714e6d2277daea3327fe171d8054cfb42324fb /kiki.hs
parentff4a08905f97555049e5f3b4a7a15e7a39575f2a (diff)
Show in DNSKEY presentation format.
Diffstat (limited to 'kiki.hs')
-rw-r--r--kiki.hs18
1 files changed, 14 insertions, 4 deletions
diff --git a/kiki.hs b/kiki.hs
index 316da90..6afcbed 100644
--- a/kiki.hs
+++ b/kiki.hs
@@ -309,9 +309,19 @@ dnsPresentationFromPacket k = do
309 dnskey = DNS.RSA n e 309 dnskey = DNS.RSA n e
310 bin = runPut (DNS.putRSA dnskey) 310 bin = runPut (DNS.putRSA dnskey)
311 qq = Base64.encode (L.unpack bin) 311 qq = Base64.encode (L.unpack bin)
312 return $ 312 ttl = 24*60*60 -- 24 hours in seconds
313 writePEM "FIXME PUBLIC KEY" qq -- ("TODO "++show keyspec) 313 flags = 256 -- (ZONE-key = bit7) TODO: is this a zone key or a key-signing key?
314 314 algo = 8 -- RSASHA256 -- TODO: support other algorithm
315 return $ unwords
316 ["."
317 ,show ttl
318 ,"IN"
319 ,"DNSKEY"
320 ,show flags
321 ,"3" -- protocol MUST be 3 (RFC 4034)
322 ,show algo
323 ,qq
324 ]
315 325
316show_ssh keyspec wkgrip db = either warn putStrLn $ show_ssh' keyspec wkgrip db 326show_ssh keyspec wkgrip db = either warn putStrLn $ show_ssh' keyspec wkgrip db
317 327
@@ -512,7 +522,7 @@ kiki_usage bExport bImport bSecret cmd = putStr $
512 ," is input on stdin in ssh-rsa format." 522 ," is input on stdin in ssh-rsa format."
513 ,"" 523 ,""
514 ," --dns SPEC" 524 ," --dns SPEC"
515 ," Outputs the DNSKEY presentation format (RFC3110) of the public key" 525 ," Outputs the DNSKEY presentation format (RFC4034) of the public key"
516 ," corresponding to SPEC." 526 ," corresponding to SPEC."
517 ," (See 'kiki help spec' for more information.)" 527 ," (See 'kiki help spec' for more information.)"
518 ,"" 528 ,""