package jose

  1. Overview
  2. Docs
Legend:
Library
Module
Module type
Parameter
Class
Class type

JSON Web Signature

Link to RFC

type signature = string
type t = {
  1. header : Header.t;
  2. raw_header : string;
  3. payload : string;
  4. signature : signature;
}
type serialization = [
  1. | `Compact
  2. | `General
  3. | `Flattened
]
val of_string : string -> (t, [> `Msg of string | `Not_json | `Not_supported ]) Stdlib.result
val to_string : ?serialization:serialization -> t -> string
val validate : jwk:'a Jwk.t -> t -> (t, [> `Invalid_signature | `Msg of string ]) Stdlib.result

validate jwk t validates the signature

val sign : ?header:Header.t -> payload:string -> Jwk.priv Jwk.t -> (t, [> `Msg of string ]) Stdlib.result

sign header payload priv creates a signed JWT from header and payload

We will start using a private JWK instead of a Mirage_crypto_pk.Rsa.priv soon

OCaml

Innovation. Community. Security.