OBJ_obj2txt

Format an ASN1_OBJECT as text (dotted OID and/or registered name).

Synopsis

Declared in <openssl/objects.h>

int
OBJ_obj2txt(
    char* buf,
    int buf_len,
    ASN1_OBJECT const* a,
    int no_name);

Return Value

Length of the text (excluding NUL) that was or would be written, or -1 on error.

Parameters

NameDescription
bufDestination buffer for the NUL-terminated text, or NULL to measure length only.
buf_lenCapacity of buf in bytes when non-NULL.
aObject identifier to render.
no_nameWhen non-zero, always emit numeric OID form; when zero, prefer a known name.