jose\_b64(3) Library Functions Manual jose\_b64(3)

# [NAME](#NAME)

jose\_b64 - URL-safe Base64 Encoding & Decoding.

# [SYNOPSIS](#SYNOPSIS)

## [Functions](#Functions)

size\_t **jose\_b64\_dec** (const json\_t \*i, void \*o, size\_t ol)  
Decodes a URL-safe Base64 JSON string to a buffer. **jose\_io\_t** * **jose\_b64\_dec\_io** (**jose\_io\_t** \*next)  
Creates a new IO object which performs URL-safe Base64 decoding. size\_t **jose\_b64\_dec\_buf** (const void \*i, size\_t il, void \*o, size\_t ol)  
Decodes a URL-safe Base64 buffer to an output buffer. json\_t * **jose\_b64\_dec\_load** (const json\_t \*i)  
Decodes a JSON string from a URL-safe Base64 JSON string. json\_t * **jose\_b64\_enc** (const void \*i, size\_t il)  
Encodes data to a URL-safe Base64 JSON string. **jose\_io\_t** * **jose\_b64\_enc\_io** (**jose\_io\_t** \*next)  
Creates a new IO object which performs URL-safe Base64 encoding. size\_t **jose\_b64\_enc\_buf** (const void \*i, size\_t il, void \*o, size\_t ol)  
Encodes data to a URL-safe Base64 buffer. json\_t * **jose\_b64\_enc\_dump** (const json\_t \*i)  
Encodes the input JSON as a URL-safe Base64 JSON string.

# [Detailed Description](#Detailed_Description)

URL-safe Base64 Encoding & Decoding.

# [Function Documentation](#Function_Documentation)

## [size\_t jose\_b64\_dec (const json\_t * i, void * o, size\_t ol)](#size_t_jose_b64_dec_%28const_json_t_*_i,_void_*_o,_size_t_ol%29)

Decodes a URL-safe Base64 JSON string to a buffer. If o **is NULL, the number of output bytes necessary is returned.**

This function will never write more than ol **bytes. If the output buffer is too small, an error will occur.**

**Parameters:**

*i* The input URL-safe Base64 JSON string.  
*o* The output buffer (may be NULL).  
*ol* The size of the output buffer.

**Returns:**

The number of bytes that were (or would be) written. If an error occurs, SIZE\_MAX is returned.

## **jose\_io\_t*** jose\_b64\_dec\_io (**jose\_io\_t** * next)

Creates a new IO object which performs URL-safe Base64 decoding. All data written to the returned IO object will be decoded before passing it on to the next IO object in the chain.

**Parameters:**

*next* The next IO object in the chain.

**Returns:**

The new IO object or NULL on error.

## [size\_t jose\_b64\_dec\_buf (const void * i, size\_t il, void * o, size\_t ol)](#size_t_jose_b64_dec_buf_%28const_void_*_i,_size_t_il,_void_*_o,_size_t_ol%29)

Decodes a URL-safe Base64 buffer to an output buffer. If o **is NULL, the number of output bytes necessary is returned.**

This function will never write more than ol **bytes. If the output buffer is too small, an error will occur.**

**Parameters:**

*i* The input URL-safe Base64 buffer.  
*il* The size of the data in the input buffer.  
*o* The output buffer.  
*ol* The size of the output buffer.

**Returns:**

The number of bytes that were (or would be) written. If an error occurs, SIZE\_MAX is returned.

## [json\_t* jose\_b64\_dec\_load (const json\_t * i)](#json_t*_jose_b64_dec_load_%28const_json_t_*_i%29)

Decodes a JSON string from a URL-safe Base64 JSON string.

**Parameters:**

*i* The input URL-safe Base64 JSON string containing JSON data.

**Returns:**

The output JSON data.

## [json\_t* jose\_b64\_enc (const void * i, size\_t il)](#json_t*_jose_b64_enc_%28const_void_*_i,_size_t_il%29)

Encodes data to a URL-safe Base64 JSON string.

**Parameters:**

*i* The input buffer.  
*il* The size of the data in the input buffer.

**Returns:**

The decoded JSON data. If an error occurs, NULL is returned.

## **jose\_io\_t*** jose\_b64\_enc\_io (**jose\_io\_t** * next)

Creates a new IO object which performs URL-safe Base64 encoding. All data written to the returned IO object will be encoded before passing it on to the next IO object in the chain.

**Parameters:**

*next* The next IO object in the chain.

**Returns:**

The new IO object or NULL on error.

## [size\_t jose\_b64\_enc\_buf (const void * i, size\_t il, void * o, size\_t ol)](#size_t_jose_b64_enc_buf_%28const_void_*_i,_size_t_il,_void_*_o,_size_t_ol%29)

Encodes data to a URL-safe Base64 buffer. If o **is NULL, the number of output bytes necessary is returned.**

This function will never write more than ol **bytes. If the output buffer is too small, an error will occur.**

**Parameters:**

*i* The input buffer.  
*il* The size of the data in the input buffer.  
*o* The output URL-safe Base64 buffer.  
*ol* The size of the output buffer.

**Returns:**

The number of bytes that were (or would be) written. If an error occurs, SIZE\_MAX is returned.

## [json\_t* jose\_b64\_enc\_dump (const json\_t * i)](#json_t*_jose_b64_enc_dump_%28const_json_t_*_i%29)

Encodes the input JSON as a URL-safe Base64 JSON string.

**Parameters:**

*i* The input JSON data.

**Returns:**

The output URL-safe Base64 JSON string.

# [Author](#Author)

Generated automatically by Doxygen for José from the source code.

Tue May 30 2017 José

---

Document: jose_b64(3) from libjose 15-r4 (Chainguard OS)
Source: https://github.com/latchset/jose.git
