summaryrefslogtreecommitdiff
path: root/src/Main.hs
diff options
context:
space:
mode:
authorRoman Smrž <roman.smrz@seznam.cz>2019-05-06 21:58:39 +0200
committerRoman Smrž <roman.smrz@seznam.cz>2019-05-06 21:58:39 +0200
commit0fb19186ddd80ae71d694071ed56d192e5bb942c (patch)
tree7f76c27171c502564789f69cf73680ca65595cfb /src/Main.hs
parent1c7e875f67e31c68e76c660294b67078acd4f38f (diff)
Distinct device and owner identities
Diffstat (limited to 'src/Main.hs')
-rw-r--r--src/Main.hs7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/Main.hs b/src/Main.hs
index 9f6cade..40540fe 100644
--- a/src/Main.hs
+++ b/src/Main.hs
@@ -24,9 +24,14 @@ main = do
putStr "Name: "
hFlush stdout
name <- T.getLine
+
(secret, public) <- generateKeys st
+ (devSecret, devPublic) <- generateKeys st
+
+ owner <- wrappedStore st =<< sign secret =<< wrappedStore st (emptyIdentity public) { idName = Just name }
+ base <- signAdd devSecret =<< sign secret =<<
+ wrappedStore st (emptyIdentity devPublic) { idOwner = Just owner }
- base <- sign secret =<< wrappedStore st (Identity name Nothing public)
Right h <- replaceHead base (Left (st, "identity"))
return h
let sidentity = wrappedLoad (headRef idhead) :: Stored Identity