2 Module : Crypto.Macaroon.Binder
3 Copyright : (c) 2015 Julien Tanguy
6 Maintainer : julien.tanguy@jhome.fr
7 Stability : experimental
13 module Crypto.Macaroon.Binder where
17 import qualified Data.ByteString as BS
19 import Crypto.Macaroon.Internal
21 -- | Datatype for binding discharging and authorizing macaroons together
22 newtype Binder = Binder { bind :: Macaroon -> Macaroon -> BS.ByteString }
25 -- | Binder which concatenates the two signatures and hashes them
27 hashSigs = Binder $ \m m' -> toBytes (HMAC . hash $ BS.append (toBytes $ signature m') (toBytes $ signature m) :: HMAC SHA256)