X509_REQ_GET_EXTENSIONS(3SSL)
π X509_REQ_GET_EXTENSIONS π
okay so bestie, this is the X509_REQ_GET_EXTENSIONS(3SSL) page straight outta the OpenSSL manual, and it's all about β¨the extension attributes of a Certificate Signing Request (CSR)β¨ β like, the little bonus vibes you attach to a CSR before anyone signs it. three functions, one very specific job. let's get into it π«Ά
πΈ NAME πΈ
X509_REQ_get_extensions, X509_REQ_add_extensions, X509_REQ_add_extensions_nid β the girls that handle X.509 extension attributes of a CSR π
β¨ 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);
π¦ DESCRIPTION π¦
X509_REQ_get_extensions() is your lil reader π β it returns the first list of X.509 extensions it finds in the attributes of req. and if req has no such extensions? you get an empty list, no drama. but heads up, the caller is responsible for freeing the list it gets back β that stack is yours now, bestie, don't just leave it lying around π
X509_REQ_add_extensions_nid() is the writer π
it adds a list of X.509 extensions, exts, onto req, using nid to identify which extensions attribute this is. and if exts is NULL or an empty list? req stays exactly how it was, untouched, not a single hair out of place π
here's the cute part: you can call this function more than once on the same req and the same nid. when you do that, the previous extensions get augmented β so new stuff gets layered on top of the old stuff. and if an extension you're adding has the same OID as one that already existed? it replaces the earlier one. same OID = old one is gone, new one is the moment. girlboss behavior, honestly π
X509_REQ_add_extensions() is literally just X509_REQ_add_extensions_nid() but with the default NID_ext_req used instead of you passing a nid. same energy, less typing β¨
π RETURN VALUES π
X509_REQ_get_extensions()β hands you a pointer toSTACK_OF(X509_EXTENSION), orNULLif something went wrong πX509_REQ_add_extensions()andX509_REQ_add_extensions_nid()β1on success,0on error. that's it, that's the whole vibe β
π HISTORY π
X509_REQ_get_extensions() was constified in OpenSSL 4.0. periodt π
π 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.
and that's the whole page, bestie π«Ά thanks for reading my little manpage moment β this was OpenSSL 4.0.3, dated 2026-09-29, and I'm X509_REQ_GET_EXTENSIONS(3SSL) signing off πβ¨πΈ
π¦ where this page comes from
- ubuntu stonking: libssl-doc 4.0.3-1ubuntu1 Β· Apache-2.0
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms