X509_EXTENSION_SET_OBJECT(3ossl)
π X509_EXTENSION_SET_OBJECT π
okay bestie, welcome to the 3ossl manual page for X509_EXTENSION_SET_OBJECT β extension utility functions and your new fave little squad. this is where we set an extensionβs object, criticality, and data; create extensions by NID or OBJ; and get all that info back out. no cap, weβre in the extension internals now. π
β¨ NAME β¨
extension utility functions, bestie β say hi to the whole squad:
X509_EXTENSION_set_objectβ sets the extension object.X509_EXTENSION_set_criticalβ sets the criticality.X509_EXTENSION_set_dataβ sets the extension data.X509_EXTENSION_create_by_NIDβ creates an extension by NID.X509_EXTENSION_create_by_OBJβ creates an extension by OBJ.X509_EXTENSION_get_objectβ gets the extension object.X509_EXTENSION_get_criticalβ gets the criticality.X509_EXTENSION_get_dataβ gets the extension data.
π§ SYNOPSIS π§
int X509_EXTENSION_set_object(X509_EXTENSION *ex, const ASN1_OBJECT *obj);
int X509_EXTENSION_set_critical(X509_EXTENSION *ex, int crit);
int X509_EXTENSION_set_data(X509_EXTENSION *ex, ASN1_OCTET_STRING *data);
X509_EXTENSION *X509_EXTENSION_create_by_NID(X509_EXTENSION **ex,
int nid, int crit,
ASN1_OCTET_STRING *data);
X509_EXTENSION *X509_EXTENSION_create_by_OBJ(X509_EXTENSION **ex,
const ASN1_OBJECT *obj, int crit,
ASN1_OCTET_STRING *data);
ASN1_OBJECT *X509_EXTENSION_get_object(X509_EXTENSION *ex);
int X509_EXTENSION_get_critical(const X509_EXTENSION *ex);
ASN1_OCTET_STRING *X509_EXTENSION_get_data(X509_EXTENSION *ne);
π DESCRIPTION π
X509_EXTENSION_set_object()β sets the extension type ofextoobj. theobjpointer is duplicated internally, soobjshould be freed up after use. π«ΆX509_EXTENSION_set_critical()β sets the criticality ofextocrit. ifcritis zero, the extension is non-critical; otherwise it is critical. π₯X509_EXTENSION_set_data()β sets the data in extensionextodata. thedatapointer is duplicated internally. πX509_EXTENSION_create_by_NID()β creates an extension of typenid, criticalitycrit, usingdataas the data. the created extension is returned and written to*ex, reusing or allocating a new extension if necessary, so*exshould either beNULLor a validX509_EXTENSIONstructure β it must not be an uninitialised pointer. β οΈX509_EXTENSION_create_by_OBJ()β identical toX509_EXTENSION_create_by_NID(), except it creates an extension usingobjinstead of a NID. πX509_EXTENSION_get_object()β returns the extension type ofexas anASN1_OBJECTpointer. the returned pointer is an internal value which must not be freed up. π¦X509_EXTENSION_get_critical()β returns the criticality of extensionex; it returns1for critical and0for non-critical. β¨X509_EXTENSION_get_data()β returns the data of extensionex. the returned pointer is an internal value which must not be freed up. πΈ
π₯ NOTES π₯
these functions manipulate the contents of an extension directly. most applications will want to parse or encode and add an extension: they should use the extension encode and decode functions instead, such as X509_add1_ext_i2d() and X509_get_ext_d2i(). π
direct manipulation is a thing you can do, bestie, but most apps should take the encode/decode route instead. iykyk. π
the data associated with an extension is the extension encoding in an ASN1_OCTET_STRING structure. π§
π RETURN VALUES π
X509_EXTENSION_set_object(),X509_EXTENSION_set_critical(), andX509_EXTENSION_set_data()return1for success and0for failure. π«ΆX509_EXTENSION_create_by_NID()andX509_EXTENSION_create_by_OBJ()return anX509_EXTENSIONpointer orNULLif an error occurs. πX509_EXTENSION_get_object()returns anASN1_OBJECTpointer. βX509_EXTENSION_get_critical()returns0for non-critical and1for critical. πX509_EXTENSION_get_data()returns anASN1_OCTET_STRINGpointer. π
π¦ SEE ALSO π¦
X509V3_get_d2i(3)β go read that one too, bestie. π
π COPYRIGHT π
Copyright 2015-2016 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>. π
thatβs the whole page, bestie π«Ά this beauty is from OpenSSL source version 3.5.6, dated 2026-04-07 β footer handled, periodt. π
π¦ where this page comes from
- freebsd 15.1: base 15.1
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms