X509_REQ_ADD_EXTENSIONS(3)
πΈ NAME πΈ
This is a Library Functions Manual page for X509_REQ_ADD_EXTENSIONS(3), and itβs all about extensions in certification requests β periodt. π
The squad is X509_REQ_add_extensions, X509_REQ_add_extensions_nid, X509_REQ_get_extensions, and X509_REQ_extension_nid. Lowkey iconic.
β¨ SYNOPSIS β¨
Bestie, youβre pulling from library βlibcryptoβ and you include #include <openssl/x509.h>. Here are the signatures, exactly:
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);
int
X509_REQ_extension_nid(int nid);
π οΈ DESCRIPTION π οΈ
X509_REQ_add_extensions()β encodes the array of extensions usingi2d_X509_EXTENSIONS(3)and adds a newX.501 Attributeobject of the typeNID_ext_reqtorequsing the equivalent ofX509_ATTRIBUTE_create_by_NID(3)with a type ofV_ASN1_SEQUENCE. Itβs giving βwrap it up and attach itβ energy. πX509_REQ_add_extensions_nid()β identical except that the specifiednidis used as theX.501 Attributetype instead ofNID_ext_req. Same vibe, different NID. β¨X509_REQ_get_extensions()β retrieves the first value of the firstX.501 Attributeof appropriate type. By default, the attribute typesNID_ext_reqandNID_ms_ext_reqare considered appropriate. Itβs literally the βfind the right attributeβ main character. πX509_REQ_extension_nid()β checks whetherX509_REQ_get_extensions()regards thenidargument as a type appropriate for storing extensions. Vibe check for NIDs. π
π RETURN VALUES π
X509_REQ_add_extensions()andX509_REQ_add_extensions_nid()return1for success or0for failure. Slay or flop, no in-between. πX509_REQ_get_extensions()returns a newly allocated array of ASN.1 Extension objects orNULLifreqisNULL, does not containCertificationRequestInfo, contains no attribute of an appropriate type, or if decoding or memory allocation fails. Thatβs a lot of ways to catch aNULL, bestie. πX509_REQ_extension_nid()returns1ifnidis considered appropriate or0otherwise. Simple vibe check. β
π¦ SEE ALSO π¦
The friends of this page, iykyk.
π HISTORY π
These functions first appeared in OpenSSL 0.9.5 and have been available since OpenBSD 2.7. Old-school but still serving. π«Ά
Ok thatβs the whole page, bestie! π This cutie is from Debian, dated June 8, 2025, and the manual is X509_REQ_ADD_EXTENSIONS(3). Bye! π«Άβ¨
π¦ where this page comes from
- alpine 3.24: libressl-doc 4.3.1-r0 Β· custom
- arch rolling: libressl 4.4.0-1 Β· ISC AND custom:OpenSSL
- Copyright (c) 2021 Ingo Schwarze <schwarze@openbsd.org>
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms