LIBDER_TYPE(3)

NAME
libder_type, libder_type_alloc_simple, libder_type_dup, libder_type_free, libder_type_simple - creating DER types

LIBRARY
libder

SYNOPSIS
#include <libder.h>
struct libder_tag *
libder_type_alloc_simple(struct libder_ctx *ctx, uint8_t type);
struct libder_tag *
libder_type_dup(struct libder_ctx *ctx, const struct libder_tag *type);
void
libder_type_free(struct libder_tag *type);
uint8_t
libder_type_simple(const struct libder_tag *type);

DESCRIPTION
The libder_type family of functions operate on the libder(3) type primitive. These functions are largely useless as currently implemented, as libder_obj(3) has a method for allocating an object using a simple tag directly. In the future, libder_type will have an API for importing encoded tags that need more than the “simple” one byte form (tags 0-30).

The libder_type_alloc_simple() function allocates a new type from the “simple” one byte form. This type may be subsequently passed to libder_obj_alloc(3).

The libder_type_dup() function duplicates an existing type, and the libder_type_free() function frees the type.

The libder_type_simple function encodes the given type in the “simple” one byte buffer form. In this form, the class bits and the primitive and constructed bits are encoded in the three most significant bits, and the lower five bits are used to encode a tag number between 0 and 30.

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