package sihl-core

  1. Overview
  2. Docs
type algorithm = Jwto.algorithm =
  1. | HS256
  2. | HS512
  3. | Unknown
type t = Jwto.t
type payload = (string * string) list
val empty : 'a list
val add_claim : key:'a -> value:'b -> ('a * 'b) list -> ('a * 'b) list
val set_expires_in : now:Ptime.t -> Time.duration -> (string * string) list -> (string * string) list
val encode : Jwto.algorithm -> secret:string -> Jwto.payload -> (string, string) Stdlib.result
val decode : secret:string -> string -> (Jwto.t, string) Stdlib.result
val get_claim : key:string -> Jwto.t -> string option
val is_expired : now:Ptime.t -> ?claim:string -> Jwto.t -> bool
val pp : Stdlib.Format.formatter -> Jwto.t -> unit
val eq : Jwto.t -> Jwto.t -> bool
module Jwto = Jwto
OCaml

Innovation. Community. Security.