summaryrefslogtreecommitdiff
path: root/src/Identity.hs
diff options
context:
space:
mode:
authorRoman Smrž <roman.smrz@seznam.cz>2019-05-05 13:37:01 +0200
committerRoman Smrž <roman.smrz@seznam.cz>2019-05-06 21:05:50 +0200
commitdc67ee394205802d30d888387dffa7f588099217 (patch)
treef1fa51f2bb8b68c080d2430a07142d92a1035f30 /src/Identity.hs
parent637e70e9d61616e16cb845100538fe2cf4c7fb29 (diff)
Signed identities using ED25519
Diffstat (limited to 'src/Identity.hs')
-rw-r--r--src/Identity.hs12
1 files changed, 9 insertions, 3 deletions
diff --git a/src/Identity.hs b/src/Identity.hs
index 76d0c97..65fec8a 100644
--- a/src/Identity.hs
+++ b/src/Identity.hs
@@ -1,22 +1,28 @@
module Identity (
- Identity(..),
+ Identity, IdentityData(..),
) where
import Data.Text (Text)
+import PubKey
import Storage
-data Identity = Identity
+type Identity = Signed IdentityData
+
+data IdentityData = Identity
{ idName :: Text
, idPrev :: Maybe (Stored Identity)
+ , idKeyIdentity :: Stored PublicKey
}
deriving (Show)
-instance Storable Identity where
+instance Storable IdentityData where
store' idt = storeRec $ do
storeText "name" $ idName idt
storeMbRef "prev" $ idPrev idt
+ storeRef "key-id" $ idKeyIdentity idt
load' = loadRec $ Identity
<$> loadText "name"
<*> loadMbRef "prev"
+ <*> loadRef "key-id"