def key.check
bend-kit-webhooks@0.11.0.1 · webhooks.bend:207
import bend-kit-webhooks@0.11.0.1/webhooks.bend as Webhooks
import Base
import bend-kit-bytes@0.3.3.0/bytes.bend as Bytes
207def key.check(k: Maybe<&1, Bytes.Bytes>, +hex: Bool, +sigs: List<&2, String>, msg: Bytes.Bytes) -> IO(Result<&1, &1, Err, Bool>):
208 match k:
209 case None{}:
210 IO.pure(Result<&1, &1, Err, Bool>, Fail{BadSecret{}})
211 case Some{b}:
212 do IO<Result<&1, &1, Err, Bool>>:
213 r : Result<&1, &1, Err, Bytes.Bytes> <- mac(b, msg)
214 key.cmp(r, hex, sigs)