X509_STORE_GET0_PARAM(3ossl)

✨ X509_STORE_GET0_PARAM ✨

okay bestie, pull up a chair, because we're doing the X509_STORE_GET0_PARAM(3ossl) page from the OpenSSL manual and honestly?? it's giving ✨certificate-store-gossip✨. it's all about getting stuff out of an X509_STORE and setting stuff into it. setters, getters, the whole friend group 🫢


🌸 NAME 🌸

X509_STORE_get0_param, X509_STORE_set1_param, X509_STORE_get1_objects, X509_STORE_get0_objects, X509_STORE_get1_all_certs β€” the X509_STORE setter and getter squad πŸ’…


πŸŽ€ SYNOPSIS πŸŽ€

like, here's the whole vibe, verbatim, no notes:

#include <openssl/x509_vfy.h>

X509_VERIFY_PARAM *X509_STORE_get0_param(const X509_STORE *xs);
int X509_STORE_set1_param(X509_STORE *xs, const X509_VERIFY_PARAM *pm);
STACK_OF(X509_OBJECT) *X509_STORE_get1_objects(X509_STORE *xs);
STACK_OF(X509_OBJECT) *X509_STORE_get0_objects(const X509_STORE *xs);
STACK_OF(X509) *X509_STORE_get1_all_certs(X509_STORE *xs);

πŸ¦‹ DESCRIPTION πŸ¦‹

okay so, one by one, main character by main character πŸ‘‘

  • X509_STORE_set1_param() sets the verification parameters to pm for xs. like, "here bestie, these are your rules now" πŸ’–
  • X509_STORE_get0_param() retrieves an internal pointer to the verification parameters for xs. and listen β€” the returned pointer must not be freed by the calling application. it's not yours, don't touch it, hands off πŸ™ˆ
  • X509_STORE_get1_objects() returns a snapshot of all objects in the store's X509 cache. the cache contains X509 and X509_CRL objects. this one is yours though β€” the caller is responsible for freeing the returned list, using sk_X509_OBJECT_pop_free(sk, X509_OBJECT_free). so like, you got it, you clean it up 🧹
  • X509_STORE_get0_objects() retrieves an internal pointer to the store's X509 object cache. the cache contains X509 and X509_CRL objects. the returned pointer must not be freed by the calling application. and here's the tea: if the store is shared across multiple threads, it is not safe to use the result of this function. use X509_STORE_get1_objects() instead, which avoids this problem. thread safety said "not today" πŸ’€
  • X509_STORE_get1_all_certs() returns a list of all certificates in the store. the caller is responsible for freeing the returned list with OSSL_STACK_OF_X509_free(). free it bestie, that's the rule 🫢

⭐ RETURN VALUES ⭐

  • X509_STORE_get0_param() returns a pointer to an X509_VERIFY_PARAM structure. πŸŽ€
  • X509_STORE_set1_param() returns 1 for success and 0 for failure. classic binary slay.
  • X509_STORE_get1_objects() returns a pointer to a stack of the retrieved objects on success, else NULL. 😭 when it's NULL it's over fr fr
  • X509_STORE_get0_objects() returns a pointer to a stack of X509_OBJECT.
  • X509_STORE_get1_all_certs() returns a pointer to a stack of the retrieved certificates on success, else NULL.

πŸ’œ SEE ALSO πŸ’œ

go read these next, iykyk:


🌈 HISTORY 🌈

the timeline, periodt:

  • X509_STORE_get0_param and X509_STORE_get0_objects were added in OpenSSL 1.1.0.
  • X509_STORE_get1_certs was added in OpenSSL 3.0.
  • X509_STORE_get1_objects was added in OpenSSL 3.3.

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


aaaand that's the whole page bestie, you ate it up πŸ’…βœ¨ this was version 3.5.9, dated 2026-09-29, straight from the OpenSSL fam β€” mwah, no cap, go forth and get0/ get1 responsibly πŸŽ€πŸ¦‹πŸ’–

πŸ“¦ where this page comes from