package jose

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

JSON Web Algorithm

Link to RFC

type alg = [
  1. | `RS256
    (*

    HMAC using SHA-256

    *)
  2. | `HS256
    (*

    RSASSA-PKCS1-v1_5 using SHA-256

    *)
  3. | `ES256
    (*

    ECDSA using P-256 and SHA-256

    *)
  4. | `ES384
    (*

    ECDSA using P-384 and SHA-384

    *)
  5. | `ES512
    (*

    ECDSA using P-521 and SHA-512

    *)
  6. | `EdDSA
  7. | `RSA_OAEP
    (*

    RSAES OAEP using default parameters

    *)
  8. | `RSA1_5
    (*

    RSA PKCS 1

    *)
  9. | `None
  10. | `Unsupported of string
]

Link to RFC

  • RS256 and HS256 and none is currently the only supported algs for signature - RSA_OAEP is currently the only supported alg for encryption
val alg_to_string : alg -> string
val alg_of_string : string -> alg
val alg_to_json : alg -> Yojson.Safe.t
val alg_of_json : Yojson.Safe.t -> alg
type kty = [
  1. | `oct
    (*

    Octet sequence (used to represent symmetric keys)

    *)
  2. | `RSA
    (*

    RSA Link to RFC

    *)
  3. | `EC
    (*

    Elliptic Curve

    *)
  4. | `OKP
    (*

    Octet Key Pair Link to RFC

    *)
  5. | `Unsupported of string
]
val kty_to_string : kty -> string
val kty_of_string : string -> kty
type enc = [
  1. | `A128CBC_HS256
    (*

    AES_128_CBC_HMAC_SHA_256 authenticated encryption algorithm, https://tools.ietf.org/html/rfc7518#section-5.2.3

    *)
  2. | `A256GCM
    (*

    AES GCM using 256-bit key

    *)
]

https://tools.ietf.org/html/rfc7518#section-5

val enc_to_string : enc -> string
val enc_of_string : string -> enc
OCaml

Innovation. Community. Security.