X509_STORE_NEW(3ossl)

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

πŸ’… X509_STORE_NEW(3ossl) β€” bestie's guide to allocating, freeing & locking an X509_STORE πŸŽ€

ok so this is one of those 3ossl manual pages (yes, that's the section, slay), and it's literally all about the lifecycle of an X509_STORE β€” making one, keeping it alive, locking it so nobody else touches it, and freeing it when you're done. Think of it as the "birth, bodyguard, and burial" page for your store. πŸ¦‹


✨ SYNOPSIS ✨

#include <openssl/x509_vfy.h>

X509_STORE *X509_STORE_new(void);
void X509_STORE_free(X509_STORE *xs);
int X509_STORE_lock(X509_STORE *xs);
int X509_STORE_unlock(X509_STORE *xs);
int X509_STORE_up_ref(X509_STORE *xs);

like, that's the whole cast of characters right there πŸ‘‘ β€” five functions, one header, no cap.


πŸ’– DESCRIPTION πŸ’–

  • X509_STORE_new() β€” hands you a brand-new X509_STORE. freshly allocated, main character energy, all yours. πŸŽ€
  • X509_STORE_up_ref() β€” bumps up the reference count on the X509_STORE object. it's giving "you can share me, I'm not going anywhere." 🫢
  • X509_STORE_lock() β€” locks the store so other threads can't modify it. X509_STORE_unlock() β€” unlocks it again. it's the "don't touch my stuff while I'm working" duo. πŸ”’βœ¨
  • X509_STORE_free() β€” frees up a single X509_STORE object. and here's the cute part: if the argument is NULL, nothing is done. no drama, no crash, just vibes. πŸ’€ (don't worry bestie, NULL is safe here fr fr)

🌈 RETURN VALUES 🌈

  • X509_STORE_new() β€” returns a freshly created X509_STORE, or NULL if the call fails. 😭
  • X509_STORE_up_ref(), X509_STORE_lock() and X509_STORE_unlock() β€” return 1 for success and 0 for failure. simple as that. ⭐
  • X509_STORE_free() β€” does not return values. it just does its thing and leaves. πŸ™ˆ

πŸ¦‹ SEE ALSO πŸ¦‹

iykyk, go read those next πŸ’œ


🌸 HISTORY 🌸

the X509_STORE_up_ref(), X509_STORE_lock() and X509_STORE_unlock() functions were added in OpenSSL 1.1.0. so yeah, they've been iconic for a minute. πŸ‘‘


Copyright 2016-2024 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>.

ngl the license paragraph is the "please read the terms" part of the group chat, but like, legally you do gotta read it 🫢

ok that's the page!! this version is from 3.5.6, dated 2026-04-07, and it's the X509_STORE_NEW(3ossl) page β€” mwah, go allocate responsibly bestie πŸ’…πŸ”₯

πŸ“¦ where this page comes from