ASN1_OBJECT_NEW(3ossl)

πŸ“¦
version 15.1 Β· 3 versions
, in freebsd 15.1

πŸ’… ASN1_OBJECT_NEW(3ossl) β€” like, the object allocation girlies

okay so bestie, this is the 3ossl manual page for ASN1_OBJECT_new and ASN1_OBJECT_free, and it's genuinely a short one so we're gonna get through it together, mmkay? ✨


🌸 NAME 🌸

ASN1_OBJECT_new, ASN1_OBJECT_free β€” the object allocation functions, aka the glow-up and the goodbye πŸ’–


πŸŽ€ SYNOPSIS πŸŽ€

#include <openssl/asn1.h>

ASN1_OBJECT *ASN1_OBJECT_new(void);
void ASN1_OBJECT_free(ASN1_OBJECT *a);

like, that's it. two whole functions. slay. 🫢


✨ DESCRIPTION ✨

so the ASN1_OBJECT allocation routines allocate and free an ASN1_OBJECT structure, and that structure is literally the representation of an ASN1 OBJECT IDENTIFIER. iconic behaviour honestly. πŸ‘‘

  • ASN1_OBJECT_new() β€” allocates and initializes an ASN1_OBJECT structure. fresh out the box, ready to go ✨
  • ASN1_OBJECT_free() β€” frees up the ASN1_OBJECT structure a. and like, if a is NULL, nothing is done. no drama, no crash, just vibes πŸ’…

πŸ¦‹ NOTES πŸ¦‹

ngl bestie, this is the part where I have to be real with you: even though ASN1_OBJECT_new() allocates a brand-new ASN1_OBJECT structure, it is almost never used in applications. like, it's giving "exists but doesn't get picked for the group project" 😭

the ASN1 object utility functions β€” for example OBJ_nid2obj() β€” are what you use instead. that's the main character energy right there πŸ‘‘


πŸ’œ RETURN VALUES πŸ’œ

  • if the allocation fails, ASN1_OBJECT_new() returns NULL and sets an error code that you can obtain with ERR_get_error(3). sad girl hours 😭
  • otherwise it returns a pointer to the newly allocated structure. we love a happy ending πŸŽ€
  • ASN1_OBJECT_free() returns no value. it's void. it says nothing. it just does its job. periodt. πŸ’€

🌈 SEE ALSO 🌈

go read those too, iykyk 🧚


Copyright 2002-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>.


and that's the whole page bestie!! πŸ“ version 3.5.6, dated 2026-04-07, brought to you by the 3ossl girlies β€” mwah, go allocate responsibly πŸ’–βœ¨

πŸ“¦ where this page comes from