Safe Haskell | None |
---|---|
Language | Haskell2010 |
Synopsis
- newtype Credential = Credential Text
- credentialAlphabet :: [Char]
- tokenBase :: Int
- tokenLength :: Int
- randomCredential :: Monad m => RandomGen r => StateT r m Credential
- readCredential :: Text -> Either ErrorToken Credential
- data ErrorToken
- newtype UUID = UUID Text
- randomUUID :: Monad m => RandomGen r => StateT r m UUID
- readUUID :: Text -> Either ErrorToken UUID
- type SecretKey = E
- randomSecretKey :: Reifies c FFC => Monad m => RandomGen r => StateT r m (SecretKey c)
- credentialSecretKey :: Reifies c FFC => UUID -> Credential -> SecretKey c
- type PublicKey = G
- publicKey :: Reifies c FFC => SecretKey c -> PublicKey c
Type Credential
newtype Credential Source #
A Credential
is a word of (
-characters
from a base alphabet of (tokenLength
+1 ==
15)
characters:
"123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz"
(beware the absence of "0", "O", "I", and "l").
The last character is a checksum.
The entropy is: tokenBase
==
58)(
.tokenLength
* log tokenBase
/ log 2) ==
82.01… bits
Instances
credentialAlphabet :: [Char] Source #
tokenLength :: Int Source #
randomCredential :: Monad m => RandomGen r => StateT r m Credential Source #
generates a random randomCredential
Credential
.
readCredential :: Text -> Either ErrorToken Credential Source #
reads and check the well-formedness of a readCredential
Credential
from raw Text
.
Type ErrorToken
data ErrorToken Source #
Instances
Type UUID
randomUUID :: Monad m => RandomGen r => StateT r m UUID Source #
generates a random randomUUID
UUID
.
readUUID :: Text -> Either ErrorToken UUID Source #
reads and check the well-formedness of a readCredential
Credential
from raw Text
.
Type SecretKey
credentialSecretKey :: Reifies c FFC => UUID -> Credential -> SecretKey c Source #
(
returns the credentialSecretKey
uuid cred)SecretKey
derived from given uuid
and cred
using fastPBKDF2_SHA256
.