ASN1_OBJECT_NEW(3ossl)
π 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 anASN1_OBJECTstructure. brand new, fresh out the box πASN1_OBJECT_free()β frees up theASN1_OBJECTstructure a. and if a isNULL, 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()returnsNULLand sets an error code that you can grab withERR_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'svoid, it does its job, it leaves. no receipts, no notes. π€·ββοΈ
β SEE ALSO β
go read those too, they're the supporting cast π
π COPYRIGHT π
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
- opensuse-leap 16.0: openssl-3-doc 3.5.0-160000.11.1 Β· Apache-2.0
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms