jose-fmt - Man Page

Converts JSON between serialization formats

Synopsis

jose fmt [Options]

Overview

This jose fmt command provides a mechanism for building and parsing JSON objects from the command line. It operates as a simple stack machine. All commands operate on the TOP item of the stack and, occasionally, the PREV item of the stack. Commands that require a specific type of value will indicate it in parentheses. For example: "TOP (arr.)".

This program returns 0 on success or the index of the option which failed.

Options

Examples

Extract the alg parameter from a JWE Protected Header:

$ jose fmt -j "$jwe" -Og protected -yOg alg -Su-
A128KW

List all JWKs in a JWKSet (one per line):

$ echo "$jwkset" | jose fmt -j- -Og keys -Af-
{"kty":"oct",...}
{"kty":"EC",...}

Change the algorithm in a JWK:

$ echo "$jwk" | jose fmt -j- -j '"A128GCM"' -s alg -Uo-
{"kty":"oct","alg":"A128GCM",...}

Build a JWE template:

$ jose fmt -j '{}' -cs unprotected -q A128KW -s alg -UUo-
{"unprotected":{"alg":"A128KW"}}

Author

Nathaniel McCallum <npmccallum@redhat.com>

Info

02/02/2024