summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorjoe <joe@jerkface.net>2014-05-09 21:56:13 -0400
committerjoe <joe@jerkface.net>2014-05-09 21:56:13 -0400
commitae090c58719726fd0027c4c606bc82faf55b1bc9 (patch)
treee799627ba9f83c7bee5c5ad61b4ead0701378275
parent62428c7e9311b0794cf0a87f0276f73e530874de (diff)
--torhash accepts CERTIFICATE pem
-rw-r--r--kiki.hs4
1 files changed, 3 insertions, 1 deletions
diff --git a/kiki.hs b/kiki.hs
index e992087..8d1d7cb 100644
--- a/kiki.hs
+++ b/kiki.hs
@@ -396,7 +396,9 @@ show_torhash pubkey _ = do
396 $ pemParser (Just "RSA PUBLIC KEY") 396 $ pemParser (Just "RSA PUBLIC KEY")
397 pkcs8 = fmap ( parsekey (\f (RSAKey8 n e) -> f n e) . pemBlob ) 397 pkcs8 = fmap ( parsekey (\f (RSAKey8 n e) -> f n e) . pemBlob )
398 $ pemParser (Just "PUBLIC KEY") 398 $ pemParser (Just "PUBLIC KEY")
399 keys = catMaybes $ scanAndParse (pkcs1 <> pkcs8) $ Char8.lines bs 399 cert = fmap (fmap pcertKey . parseCertBlob False . pemBlob)
400 $ pemParser (Just "CERTIFICATE")
401 keys = catMaybes $ scanAndParse (pkcs1 <> pkcs8 <> cert) $ Char8.lines bs
400 mapM_ (putStrLn . addy . torhash) keys 402 mapM_ (putStrLn . addy . torhash) keys
401 403
402 404