summaryrefslogtreecommitdiff
path: root/Remote/Helper/Encryptable.hs
diff options
context:
space:
mode:
Diffstat (limited to 'Remote/Helper/Encryptable.hs')
-rw-r--r--Remote/Helper/Encryptable.hs8
1 files changed, 8 insertions, 0 deletions
diff --git a/Remote/Helper/Encryptable.hs b/Remote/Helper/Encryptable.hs
index 9a8e9ba5b..5e342803d 100644
--- a/Remote/Helper/Encryptable.hs
+++ b/Remote/Helper/Encryptable.hs
@@ -16,6 +16,7 @@ module Remote.Helper.Encryptable (
cipherKey,
storeCipher,
extractCipher,
+ describeEncryption,
) where
import qualified Data.Map as M
@@ -157,3 +158,10 @@ extractCipher c = case (M.lookup "cipher" c,
_ -> Nothing
where
readkeys = KeyIds . split ","
+
+describeEncryption :: RemoteConfig -> String
+describeEncryption c = case extractCipher c of
+ Nothing -> "not encrypted"
+ (Just (SharedCipher _)) -> "encrypted (encryption key stored in git repository)"
+ (Just (EncryptedCipher _ _ (KeyIds { keyIds = ks }))) ->
+ "encrypted (to gpg keys: " ++ unwords ks ++ ")"