clientsession-0.7.1: Store session data in a cookie.

Web.ClientSession

Contents

Synopsis

Automatic key generation

data Key Source

Constructors

Key 

Fields

aesKey :: Key
 
hmacKey :: MacKey
 

Instances

data IV Source

Instances

getKeySource

Arguments

:: FilePath

File name where key is stored.

-> IO Key

The actual key.

Get a key from the given text file.

If the file does not exist a random key will be generated and stored in that file.

defaultKeyFile :: StringSource

The default key file.

initKey :: ByteString -> Either String KeySource

Initializes a Key from a random ByteString. It's better to give a ByteString with exactly 64 bytes, but anything with at least 32 bytes will work.

Actual encryption/decryption

encryptSource

Arguments

:: Key 
-> IV 
-> ByteString

data

-> ByteString 

decryptSource

Arguments

:: Key

key

-> ByteString

data

-> Maybe ByteString