initremote: show gpg keys

This commit is contained in:
Joey Hess 2011-04-17 18:18:27 -04:00
parent a91a51fc03
commit 86f7feb278
3 changed files with 13 additions and 4 deletions

View file

@ -13,6 +13,7 @@ module Crypto (
EncryptedCipher,
genCipher,
updateCipher,
describeCipher,
storeCipher,
extractCipher,
decryptCipher,
@ -95,6 +96,13 @@ updateCipher c encipher@(EncryptedCipher _ ks) = do
where
combine (KeyIds a) (KeyIds b) = KeyIds $ a ++ b
describeCipher :: EncryptedCipher -> String
describeCipher (EncryptedCipher _ (KeyIds ks)) =
"with gpg " ++ keys ks ++ " " ++ unwords ks
where
keys [_] = "key"
keys _ = "keys"
{- Stores an EncryptedCipher in a remote's configuration. -}
storeCipher :: RemoteConfig -> EncryptedCipher -> RemoteConfig
storeCipher c (EncryptedCipher t ks) =