summaryrefslogtreecommitdiffhomepage
path: root/Gpg.hs
diff options
context:
space:
mode:
authorJoey Hess <joeyh@joeyh.name>2016-08-12 05:00:17 -0400
committerJoey Hess <joeyh@joeyh.name>2016-08-12 05:00:17 -0400
commit0045c4b162d2a68a85b8e7844dca97834f888dd5 (patch)
tree12cff1c993008797edf261aa18d529bc1fb32954 /Gpg.hs
parentf74151ead49895f86257c9abfbe90c027d91d456 (diff)
downloadkeysafe-0045c4b162d2a68a85b8e7844dca97834f888dd5.tar.gz
separate error code for already exsisting object store
Diffstat (limited to 'Gpg.hs')
-rw-r--r--Gpg.hs21
1 files changed, 21 insertions, 0 deletions
diff --git a/Gpg.hs b/Gpg.hs
new file mode 100644
index 0000000..bf4cbe6
--- /dev/null
+++ b/Gpg.hs
@@ -0,0 +1,21 @@
+{- Copyright 2016 Joey Hess <id@joeyh.name>
+ -
+ - Licensed under the GNU AGPL version 3 or higher.
+ -}
+
+module Gpg where
+
+import Types
+import System.Process
+
+-- | Converts an input KeyId, which can be short, or even a name or email,
+-- to a long-form gpg KeyId of a secret key.
+getFullKeyId :: KeyId -> IO (Maybe KeyId)
+-- gpg --batch --with-colons --list-secret-keys
+-- extract from eg, sec::4096:1:C910D9222512E3C7:...
+
+-- | Check if a given gpg key is present on the keyserver.
+-- (Without downloading the key.)
+knownByKeyServer :: KeyId -> IO Bool
+-- gpg --batch --with-colons --search-keys 2>/dev/null
+-- check if output includes pub: line