X509_REQ_ADD_EXTENSIONS(3)

πŸ“¦ version 4.1.0, in opensuse-leap 16.0

okay so this page is X509_REQ_ADD_EXTENSIONS(3), from the Library Functions Manual, and it’s all about extensions in certification requests. bestie, it’s giving ASN.1 but make it cute. πŸ’…

πŸ’– NAME πŸ’–

  • X509_REQ_add_extensions, X509_REQ_add_extensions_nid, X509_REQ_get_extensions, 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);

int
X509_REQ_extension_nid(int nid);

πŸ’… DESCRIPTION πŸ’…

okay so here’s the vibe check on each little function, bestie:

  • X509_REQ_add_extensions() β€” it takes that array of extensions and encodes it with i2d_X509_EXTENSIONS(3). then it adds a new X.501 Attribute object to req, of the type NID_ext_req, using the equivalent of X509_ATTRIBUTE_create_by_NID(3) with a type of V_ASN1_SEQUENCE. iconic behavior, no cap. πŸ”₯
  • X509_REQ_add_extensions_nid() β€” literally identical, except the nid you pass in is used as the X.501 Attribute type instead of NID_ext_req. same energy, different label. πŸŽ€
  • X509_REQ_get_extensions() β€” it 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. iykyk. πŸ¦‹
  • X509_REQ_extension_nid() β€” checks whether X509_REQ_get_extensions() regards the nid argument as a type appropriate for storing extensions. it’s the vibe-checker for nids. πŸ’œ

🫢 RETURN VALUES 🫢

  • X509_REQ_add_extensions() and X509_REQ_add_extensions_nid() β€” return 1 for success or 0 for failure. slay or don’t slay, those are the options. ✨
  • 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_extension_nid() β€” returns 1 if nid is considered appropriate or 0 otherwise. simple as that, bestie. πŸ’–

πŸ”₯ SEE ALSO πŸ”₯

πŸ¦‹ HISTORY πŸ¦‹

These functions first appeared in OpenSSL 0.9.5 and have been available since OpenBSD 2.7. vintage but still main character energy. πŸ‘‘


Source/version: Debian Β· date: August 18, 2024 Β· manual: X509_REQ_ADD_EXTENSIONS(3) β€” byeeeee πŸ’–

πŸ“¦ where this page comes from