X509v3_add_ext

Insert a duplicate of an extension into an X.509v3 extension stack.

Synopsis

Declared in <openssl/x509.h>

stack_st_X509_EXTENSION*
X509v3_add_ext(
    stack_st_X509_EXTENSION** x,
    X509_EXTENSION* ex,
    int loc);

Return Value

The (possibly newly allocated) extension stack, or NULL on error.

Parameters

NameDescription
xAddress of a STACK_OF(X509_EXTENSION) pointer; may point to NULL to allocate a new stack.
exExtension to duplicate into the stack (ownership retained by the caller).
locInsertion index, or -1 to append.