X509_REQ_GET_EXTENSIONS(3ossl)
πΈ NAME πΈ
okay so this whole page is about the extension attributes of a CSR (that's a Certificate Signing Request, bestie π ), and it covers three functions:
X509_REQ_get_extensionsX509_REQ_add_extensionsX509_REQ_add_extensions_nid
they handle X.509 extension attributes of a CSR. that's the vibe. π
β¨ SYNOPSIS β¨
#include <openssl/x509.h>
STACK_OF(X509_EXTENSION) *X509_REQ_get_extensions(const X509_REQ *req);
int X509_REQ_add_extensions(X509_REQ *req, const STACK_OF(X509_EXTENSION) *exts);
int X509_REQ_add_extensions_nid(X509_REQ *req,
const STACK_OF(X509_EXTENSION) *exts, int nid);
like, three little lines and you're in. iconic. π¦
π DESCRIPTION π
π X509_REQ_get_extensions()
this one returns the first list of X.509 extensions it finds in the attributes of req. lowkey does exactly what it says on the tin.
if there are no such extensions in req, the returned list is just empty β not a whole crisis, just an empty list. π
β οΈ bestie, listen: the caller is responsible for freeing the list obtained. that's you. you free it. not me. don't leave it hanging, that's so not main character energy. π
π§ X509_REQ_add_extensions_nid()
this one adds to req a list of X.509 extensions called exts, using nid to identify the extensions attribute (iykyk π«Ά).
the details, fr fr:
reqstays unchanged ifextsisNULLor an empty list. no notes. nothing happens. slay.- you can call this function more than once on the same
reqandnid. and in that case any previous extensions are augmented β meaning you're adding to what's already there. - and when an extension you're adding has the same OID as a pre-existing one? it replaces that earlier one. periodt. π
π X509_REQ_add_extensions()
this is literally like X509_REQ_add_extensions_nid() except the default NID_ext_req is used. that's the whole difference. cute, right? π
π₯ RETURN VALUES π₯
X509_REQ_get_extensions()β returns a pointer toSTACK_OF(X509_EXTENSION), orNULLon error. πX509_REQ_add_extensions()andX509_REQ_add_extensions_nid()β return1on success,0on error. so like, check it. please. π
β COPYRIGHT β
Copyright 2022-2024 The OpenSSL Project Authors. All Rights Reserved.
Licensed under the Apache License 2.0 (the "License"). You may not use this file except in compliance with the License. You can obtain a copy in the file LICENSE in the source distribution or at <https://www.openssl.org/source/license.html>.
okay that's the whole page, bestie π this was OpenSSL 3.5.0, dated 2026-09-25, and the manual is X509_REQ_GET_EXTENSIONS(3ossl) β go forth and free your stacks. πβ¨π¦
π¦ where this page comes from
- opensuse-leap 16.0: openssl-3-doc 3.5.0-160000.11.1 Β· Apache-2.0
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms