X509_REQ_ADD_EXTENSIONS(3)

NAME
X509_REQ_add_extensions, X509_REQ_add_extensions_nid, X509_REQ_get_extensions, X509_REQ_set_extension_nids, X509_REQ_get_extension_nids, X509_REQ_extension_nid - extensions in certification requests

SYNOPSIS
#include <openssl/x509.h>
int
X509_REQ_add_extensions(X509_REQ *req, STACK_OF(X509_EXTENSION) *extensions);
int
X509_REQ_add_extensions_nid(X509_REQ *req, STACK_OF(X509_EXTENSION) *extensions, int nid);
STACK_OF(X509_EXTENSION) *
X509_REQ_get_extensions(X509_REQ *req);
void
X509_REQ_set_extension_nids(int *nids);
int *
X509_REQ_get_extension_nids(void);
int
X509_REQ_extension_nid(int nid);

DESCRIPTION
X509_REQ_add_extensions() encodes the array of extensions using i2d_X509_EXTENSIONS(3) and adds a new X.501 Attribute object of the type NID_ext_req to req using the equivalent of X509_ATTRIBUTE_create_by_NID(3) with a type of V_ASN1_SEQUENCE.

X509_REQ_add_extensions_nid() is identical except that the specified nid is used as the X.501 Attribute type instead of NID_ext_req.

X509_REQ_get_extensions() retrieves the first value of the first X.501 Attribute of appropriate type. By default, the attribute types NID_ext_req and NID_ms_ext_req are considered appropriate.

X509_REQ_set_extension_nids() replaces the list of attribute types that X509_REQ_get_extensions() considers appropriate for storing extensions. The nids argument is interpreted as a pointer to the first element of a variable-sized array of int. The last element of the array has to be NID_undef. The array needs to remain valid until X509_REQ_set_extension_nids() is called again with a different argument.

X509_REQ_extension_nid() checks whether X509_REQ_get_extensions() regards the nid argument as a type appropriate for storing extensions.

RETURN VALUES
X509_REQ_add_extensions() and X509_REQ_add_extensions_nid() returns 1 for success or 0 for failure.

X509_REQ_get_extensions() returns a newly allocated array of ASN.1 Extension objects or NULL if req is NULL, does not contain CertificationRequestInfo, contains no attribute of an appropriate type, or if decoding or memory allocation fails.

X509_REQ_get_extension_nids() returns the pointer installed with X509_REQ_set_extension_nids() or a pointer to a static array {NID_ext_req, NID_ms_ext_req, NID_undef} by default.

X509_REQ_extension_nid() returns 1 if nid is considered appropriate or 0 otherwise.

SEE ALSO
d2i_X509_EXTENSION(3), STACK_OF(3), X509_EXTENSION_new(3), X509_REQ_new(3), X509V3_extensions_print(3)

HISTORY
These functions first appeared in OpenSSL 0.9.5 and have been available since OpenBSD 2.7.