LIBDER_WRITE(3)

NAME
libder_write - writing DER encoded buffers

LIBRARY
libder

SYNOPSIS
#include <libder.h>
uint8_t *
libder_write(struct libder_ctx *ctx, struct libder_object *root, uint8_t *buf, size_t *bufsize);

DESCRIPTION
The libder_write() writes the specified root into the given buf of size bufsize. If a NULL and 0 are passed in, then libder_write() will alllocate a buffer just large enough to fit the encoded root. Upon successful write, libder_write() will return a pointer to the buffer used, and *bufsize is updated to indicate how many bytes were written. On failure, NULL is returned and *bufsize will remain unmodified.

Normalization rules are applied at write time, if specified via libder_set_normalize(3). Note that applications do not typically need to enable normalization, as they are all enabled by default.

SEE ALSO
libder(3), libder_obj(3), libder_read(3), libder_type(3)