diff options
author | joe <joe@jerkface.net> | 2014-04-18 00:35:30 -0400 |
---|---|---|
committer | joe <joe@jerkface.net> | 2014-04-18 00:35:30 -0400 |
commit | 60f9591a217e07da45b6f16769a9b65a18301754 (patch) | |
tree | 55a296600c770f5daa558de7f5579f33303da655 /KeyRing.hs | |
parent | 67e5ad3df24cea8f16e7cb1f95e557c13b75d4ee (diff) |
export secret keys as pem files
Diffstat (limited to 'KeyRing.hs')
-rw-r--r-- | KeyRing.hs | 9 |
1 files changed, 5 insertions, 4 deletions
@@ -88,7 +88,7 @@ type UsageTag = String | |||
88 | type Initializer = String | 88 | type Initializer = String |
89 | type PassWordFile = InputFile | 89 | type PassWordFile = InputFile |
90 | 90 | ||
91 | data FileType = KeyRingFile PassWordFile | 91 | data FileType = KeyRingFile (Maybe PassWordFile) |
92 | | PEMFile UsageTag | 92 | | PEMFile UsageTag |
93 | | WalletFile -- (Maybe UsageTag) | 93 | | WalletFile -- (Maybe UsageTag) |
94 | 94 | ||
@@ -101,7 +101,7 @@ isring (KeyRingFile {}) = True | |||
101 | isring _ = False | 101 | isring _ = False |
102 | 102 | ||
103 | pwfile (KeyRingFile f) = f | 103 | pwfile (KeyRingFile f) = f |
104 | pwfile _ = HomeSec | 104 | pwfile _ = Nothing |
105 | 105 | ||
106 | iswallet (WalletFile {}) = True | 106 | iswallet (WalletFile {}) = True |
107 | iswallet _ = False | 107 | iswallet _ = False |
@@ -279,6 +279,7 @@ data KikiReportAction = | |||
279 | | ExternallyGeneratedFile | 279 | | ExternallyGeneratedFile |
280 | | UnableToExport KeyAlgorithm String | 280 | | UnableToExport KeyAlgorithm String |
281 | | FailedFileWrite | 281 | | FailedFileWrite |
282 | deriving Show | ||
282 | 283 | ||
283 | data KikiResult a = KikiResult | 284 | data KikiResult a = KikiResult |
284 | { kikiCondition :: KikiCondition a | 285 | { kikiCondition :: KikiCondition a |
@@ -1173,9 +1174,9 @@ runKeyRing keyring = do | |||
1173 | -- TODO: head will throw an exception if a File Descriptor keyring | 1174 | -- TODO: head will throw an exception if a File Descriptor keyring |
1174 | -- file is present. We probably should change OriginMap to use InputFile | 1175 | -- file is present. We probably should change OriginMap to use InputFile |
1175 | -- instead of FilePath. | 1176 | -- instead of FilePath. |
1176 | Traversable.mapM (cachedContents secring pubring . pwfile . snd) | 1177 | Traversable.mapM (cachedContents secring pubring . fromJust . pwfile . snd) |
1177 | (Map.mapKeys (head . resolveInputFile secring pubring) | 1178 | (Map.mapKeys (head . resolveInputFile secring pubring) |
1178 | $ Map.filter (isring . snd) $ kFiles keyring) | 1179 | $ Map.filter (isJust . pwfile . snd) $ kFiles keyring) |
1179 | 1180 | ||
1180 | unkeysRef <- newIORef Map.empty | 1181 | unkeysRef <- newIORef Map.empty |
1181 | 1182 | ||