ASN1_STRING_NEW(3ossl)

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

πŸ’… ASN1_STRING_NEW β€” it's giving "OpenSSL manual, section 3ossl" ✨

Bestie, welcome to the ASN1_STRING_NEW(3ossl) page β€” yes that's the manual name, section 3ossl, she's an OpenSSL girlie. Sit down, grab a boba, we're allocating structs today 🧚


🌸 NAME 🌸

ASN1_STRING_new, ASN1_STRING_type_new, ASN1_STRING_free β€” the ASN1_STRING allocation functions, aka the holy trinity of "make one", "make one with a vibe", and "bestie, delete it" πŸŽ€


πŸ¦‹ SYNOPSIS πŸ¦‹

Like, the literal receipts, no cap:

#include <openssl/asn1.h>

ASN1_STRING *ASN1_STRING_new(void);
ASN1_STRING *ASN1_STRING_type_new(int type);
void ASN1_STRING_free(ASN1_STRING *a);

πŸ’– DESCRIPTION πŸ’–

Okay so, here's the tea β˜•

  • ASN1_STRING_new() β€” hands you back an allocated ASN1_STRING structure. Its type is undefined, so like... she exists, but she doesn't know who she is yet. Very relatable, honestly 🫢
  • ASN1_STRING_type_new() β€” same deal, allocated ASN1_STRING structure, but this time she's of type type. Main character energy, fully self-actualized ✨
  • ASN1_STRING_free() β€” frees up a. And if a is NULL? Nothing is done. She said "not my problem, no notes" πŸ’…

⭐ NOTES ⭐

Other string types literally call these ASN1_STRING functions β€” it's giving nepotism but make it cryptography πŸ‘‘

For example, ASN1_OCTET_STRING_new() calls ASN1_STRING_type_new(V_ASN1_OCTET_STRING). See? Iconic behavior. Iykyk 😌


πŸ”₯ RETURN VALUES πŸ”₯

  • ASN1_STRING_new() and ASN1_STRING_type_new() return a valid ASN1_STRING structure β€” slay πŸ’– β€” or NULL if an error occurred 😭
  • ASN1_STRING_free() does not return a value. She gives nothing and that's the point πŸŽ€

🌈 SEE ALSO 🌈

  • ERR_get_error(3) β€” for when things go sideways and you need to know why, bestie πŸ™ˆ
Fr fr, bookmark that one. You'll need it.

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


Mwah πŸ’‹ that's the whole page β€” version 3.5.6, dated 2026-04-07, served fresh with love. Go forth and allocate responsibly, queen πŸ¦‹βœ¨

πŸ“¦ where this page comes from