use cryptographic key pairs for encryption keys (#39)

* use cryptographic key pairs for encryption keys

* use speaking key types

* fix key types

Co-authored-by: Evgeny Poberezkin <2769109+epoberezkin@users.noreply.github.com>
This commit is contained in:
Efim PoberezkinandEvgeny Poberezkin committed 2021-02-26 18:14:22 +04:00
1 parent 0fe41dbf16
commit 469f84bb74
13 files changed
+85 -79

No files matched your search

+5 -5
View File
@@ -11,21 +11,21 @@ import Simplex.Messaging.Types
data QueueRec = QueueRec
{ recipientId :: QueueId,
senderId :: QueueId,
recipientKey :: RecipientKey,
senderKey :: Maybe SenderKey,
recipientKey :: RecipientPublicKey,
senderKey :: Maybe SenderPublicKey,
status :: QueueStatus
}
data QueueStatus = QueueActive | QueueOff
class MonadQueueStore s m where
addQueue :: s -> RecipientKey -> (RecipientId, SenderId) -> m (Either ErrorType ())
addQueue :: s -> RecipientPublicKey -> (RecipientId, SenderId) -> m (Either ErrorType ())
getQueue :: s -> SParty (a :: Party) -> QueueId -> m (Either ErrorType QueueRec)
secureQueue :: s -> RecipientId -> SenderKey -> m (Either ErrorType ())
secureQueue :: s -> RecipientId -> SenderPublicKey -> m (Either ErrorType ())
suspendQueue :: s -> RecipientId -> m (Either ErrorType ())
deleteQueue :: s -> RecipientId -> m (Either ErrorType ())
mkQueueRec :: RecipientKey -> (RecipientId, SenderId) -> QueueRec
mkQueueRec :: RecipientPublicKey -> (RecipientId, SenderId) -> QueueRec
mkQueueRec recipientKey (recipientId, senderId) =
QueueRec
{ recipientId,