2.2 Binary Encoding

JSON does not natively support binary data, so a number of string encodings are used to represent binary data, depending on the context.

BASE64URL

A base64 encoding that uses a URL-safe alphabet, as described in RFC 4648 section 5, with trailing padding characters (“=”) removed.

This encoding is used by the JOSE standards and appears in the JWS, JWK and JWE objects, as documented in RFC 7515 section 2.

This encoding is also used in a few other non-JOSE members to maintain consistency.

BASE64URLUINT

A base64url encoding of the value's unsigned big-endian representation as an octet sequence, as described in RFC 4648 section 5.

This encoding is used by the JOSE standards and can be found in the JWK objects used, as documented in RFC 7518 section 2.

BASE64

The standard base64 encoding, as described in RFC 4648 section 4, and includes the trailing padding characters (“=”).

This is used for encoding certificates (JOSE x5c members), to more closely align with the common PEM encoding format used for certificates.

HEXIn some cases, short binary values are expressed as lowercase hex strings. This is to match convention with how these values are typically seen and worked with.