SfRFC 8941 Structured Fields (minimal subset for HTTP Signatures)
This module implements the subset of RFC 8941 Structured Fields required for HTTP Message Signatures (RFC 9421).
Only Dictionary and Inner List types are fully supported, as these are used by the Signature-Input and Signature headers.
val item_to_string : item -> stringSerialize an item to its Structured Field representation.
type parameters = (string * item) listParameters are key-value pairs attached to items.
val parameters_to_string : parameters -> stringSerialize parameters (e.g., ;key=value;key2).
type inner_list = (item * parameters) list * parametersAn inner list is a list of parameterized items with list-level parameters. Format: (item1;param item2);listparam=value
val inner_list_to_string : inner_list -> stringSerialize an inner list.
val parse_inner_list : string -> (inner_list, string) resultParse an inner list from its string representation.
type dictionary = (string * list_member) listA dictionary is an ordered map of string keys to list members.
val dictionary_to_string : dictionary -> stringSerialize a dictionary to its Structured Field representation.
val parse_dictionary : string -> (dictionary, string) resultParse a dictionary from its string representation.
val string_item : string -> itemCreate a string item.
val token_item : string -> itemCreate a token item.
val integer_item : int64 -> itemCreate an integer item.
val byte_seq_item : string -> itemCreate a byte sequence item (raw bytes, will be base64 encoded).
val bool_item : bool -> itemCreate a boolean item.