From 86f7feb2784221459d4015b0d70f537dbf2e9bb7 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Sun, 17 Apr 2011 18:18:27 -0400 Subject: initremote: show gpg keys --- Crypto.hs | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'Crypto.hs') diff --git a/Crypto.hs b/Crypto.hs index 6b5d1218a..1617f5aad 100644 --- a/Crypto.hs +++ b/Crypto.hs @@ -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) = -- cgit v1.2.3