summaryrefslogtreecommitdiffhomepage
path: root/keysafe.hs
diff options
context:
space:
mode:
Diffstat (limited to 'keysafe.hs')
-rw-r--r--keysafe.hs20
1 files changed, 17 insertions, 3 deletions
diff --git a/keysafe.hs b/keysafe.hs
index 9f9cb92..15deb79 100644
--- a/keysafe.hs
+++ b/keysafe.hs
@@ -1,8 +1,22 @@
-module Main where
-
{-# LANGUAGE OverloadedStrings #-}
+module Main where
+
import Types
+import Tunables
import Encryption
+import Shard
-main = print $ genKeyEncryptionKey (Password "foo") (Name "bar")
+main :: IO ()
+main = do
+ kek <- genKeyEncryptionKey tunables name password
+ let esk = encrypt kek secretkey
+ let sis = shardIdents tunables name keyid
+ shards <- genShards esk tunables
+ print $ zip (getIdents sis) shards
+ where
+ password = Password "foo"
+ name = Name "bar"
+ tunables = testModeTunables -- defaultTunables
+ keyid = KeyId gpgKey "foobar"
+ secretkey = SecretKey "this is a gpg private key"