ASN1_OBJECT_NEW(3ossl)

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

πŸ’… ASN1_OBJECT_NEW(3ossl)

okay so bestie, you're looking at the OpenSSL manual page for ASN1_OBJECT_NEW β€” yes, the whole thing is about the ASN1_OBJECT object allocation functions, and honestly it's short and sweet. Let's get into it πŸ’–


✨ NAME ✨

ASN1_OBJECT_new, ASN1_OBJECT_free β€” the object allocation functions, aka the birth and departure committee for ASN1_OBJECT πŸŽ€


🌸 SYNOPSIS 🌸

#include <openssl/asn1.h>

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

like, that's it. that's the whole API. two functions. iconic minimalism ✨


πŸ¦‹ DESCRIPTION πŸ¦‹

So the ASN1_OBJECT allocation routines allocate and free an ASN1_OBJECT structure, which is the little guy that represents an ASN1 OBJECT IDENTIFIER. yes, the dotted-number thing. main character of ASN.1 if we're being real πŸ‘‘

  • ASN1_OBJECT_new() β€” allocates and initializes an ASN1_OBJECT structure. brand new, fresh out the box 🎁
  • ASN1_OBJECT_free() β€” frees up the ASN1_OBJECT structure a. and if a is NULL, nothing is done. no crash, no drama, no nothing. we love a graceful no-op πŸ’…

🧚 NOTES 🧚

ngl, this is the part where it gets a little humbling: even though ASN1_OBJECT_new() does allocate a new ASN1_OBJECT structure, it's almost never used in applications. like, basically never. the ASN1 object utility functions β€” things like OBJ_nid2obj() β€” are what people actually reach for instead. so if you came here thinking ASN1_OBJECT_new() was the move, the manpage is gently telling you it's not the vibe. use the utility functions, bestie 🫢


🌈 RETURN VALUES 🌈

  • If the allocation fails, ASN1_OBJECT_new() returns NULL and sets an error code that you can grab with ERR_get_error(3). so like, always check, ok? 😭 Otherwise it returns a pointer to the newly allocated structure. slay.
  • ASN1_OBJECT_free() returns no value. it's void, it does its job, it leaves. no receipts, no notes. πŸ€·β€β™€οΈ

⭐ SEE ALSO ⭐

go read those too, they're the supporting cast πŸ’œ


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

fr fr read the license before you go wild, it's the rules πŸ“

and that's the whole page, bestie!! this one's from OpenSSL 3.5.0, dated 2026-09-25 β€” so go forth, allocate responsibly, and remember: OBJ_nid2obj() is probably what you actually wanted πŸ’–βœ¨πŸŽ€

πŸ“¦ where this page comes from