hmacaroons-0.5.0.0: Haskell implementation of macaroons

Copyright(c) 2015 Julien Tanguy
LicenseBSD3
Maintainerjulien.tanguy@jhome.fr
Stabilityexperimental
Portabilityportable
Safe HaskellNone
LanguageHaskell2010

Crypto.Macaroon

Contents

Description

Pure haskell implementations of macaroons.

Warning: this implementation has not been audited by security experts. Do not use in production

References:

Synopsis

Types

data Macaroon

Main structure of a macaroon

Instances

Eq Macaroon

Constant-time Eq instance

Show Macaroon

show instance conforming to the inspect "specification"

NFData Macaroon

NFData instance for use in the benchmark

data Caveat

Caveat structure

Instances

Eq Caveat

Constant-time Eq instance

Show Caveat

show instance conforming to the inspect "specification"

NFData Caveat

NFData instance for use in the benchmark

type Secret = ByteString

Type alias for Macaroons secret keys

type Key = ByteString

Type alias for Macaroons and Caveat and identifiers

type Location = ByteString

Type alias for Macaroons and Caveat locations

type Sig = ByteString

Type alias for Macaroons signatures

Accessing functions

Macaroons

location :: Macaroon -> Location

Target location

identifier :: Macaroon -> Key

Macaroon Identifier

caveats :: Macaroon -> [Caveat]

List of caveats

signature :: Macaroon -> Sig

Macaroon HMAC signature

Caveats

cl :: Caveat -> Location

Caveat target location

cid :: Caveat -> Key

Caveat identifier

vid :: Caveat -> Key

Caveat verification key identifier

Create Macaroons

create :: Secret -> Key -> Location -> Macaroon

Create a Macaroon from its key, identifier and location

inspect :: Macaroon -> String

Inspect a macaroon's contents. For debugging purposes.

addFirstPartyCaveat :: Key -> Macaroon -> Macaroon

Add a first party Caveat to a Macaroon, with its identifier

Serialize

Verify