summaryrefslogtreecommitdiffhomepage
path: root/keysafe.hs
blob: 15deb79c94ab8753d77fc254725b641f7328bc66 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
{-# LANGUAGE OverloadedStrings #-}

module Main where

import Types
import Tunables
import Encryption
import Shard

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"