diff options
author | joe <joe@jerkface.net> | 2014-04-22 19:17:52 -0400 |
---|---|---|
committer | joe <joe@jerkface.net> | 2014-04-22 19:17:52 -0400 |
commit | bdfc90edae040cefccbe1018f1506c445608e460 (patch) | |
tree | 319b7d2fa8c7b27b1209ee429dd9d5ff9b9b8dd4 /KeyRing.hs | |
parent | 1257ddd6813fc75df11631d653a97eb45035188e (diff) |
more cleanup of module kiki.hs
Diffstat (limited to 'KeyRing.hs')
-rw-r--r-- | KeyRing.hs | 21 |
1 files changed, 20 insertions, 1 deletions
@@ -298,6 +298,20 @@ instance ASN1Object PKCS8_RSAPublicKey where | |||
298 | fromASN1 _ = | 298 | fromASN1 _ = |
299 | Left "fromASN1: RSAPublicKey: unexpected format" | 299 | Left "fromASN1: RSAPublicKey: unexpected format" |
300 | 300 | ||
301 | {- | ||
302 | RSAPrivateKey ::= SEQUENCE { | ||
303 | version Version, | ||
304 | modulus INTEGER, -- n | ||
305 | publicExponent INTEGER, -- e | ||
306 | privateExponent INTEGER, -- d | ||
307 | prime1 INTEGER, -- p | ||
308 | prime2 INTEGER, -- q | ||
309 | exponent1 INTEGER, -- d mod (p1) -- ?? d mod (p-1) | ||
310 | exponent2 INTEGER, -- d mod (q-1) | ||
311 | coefficient INTEGER, -- (inverse of q) mod p | ||
312 | otherPrimeInfos OtherPrimeInfos OPTIONAL | ||
313 | } | ||
314 | -} | ||
301 | data RSAPrivateKey = RSAPrivateKey | 315 | data RSAPrivateKey = RSAPrivateKey |
302 | { rsaN :: MPI | 316 | { rsaN :: MPI |
303 | , rsaE :: MPI | 317 | , rsaE :: MPI |
@@ -2112,7 +2126,12 @@ merge db filename (Message ps) = merge_ db filename qs | |||
2112 | updateTrust _ _ (pre,t) p = (pre,Map.insert filename p t) -- secret | 2126 | updateTrust _ _ (pre,t) p = (pre,Map.insert filename p t) -- secret |
2113 | 2127 | ||
2114 | 2128 | ||
2115 | 2129 | {- | |
2130 | onionName :: KeyData -> (SockAddr,L.ByteString) | ||
2131 | onionName kd = (addr,name) | ||
2132 | where | ||
2133 | (addr,(name:_,_)) = getHostnames kd | ||
2134 | -} | ||
2116 | 2135 | ||
2117 | merge_ :: KeyDB -> FilePath -> [(Packet,Packet,(Packet,Map.Map FilePath Packet))] | 2136 | merge_ :: KeyDB -> FilePath -> [(Packet,Packet,(Packet,Map.Map FilePath Packet))] |
2118 | -> KeyDB | 2137 | -> KeyDB |