X509_GET0_UIDS(3SSL)

πŸ’– X509_GET0_UIDS πŸ’–

okay so bestie, welcome to the X509_GET0_UIDS(3SSL) page β€” yeah it's an OpenSSL manual, section 3SSL, and it's short but it's lowkey important, so grab your iced coffee and let's go 🫢

✨ NAME ✨

X509_get0_uids, X509_ACERT_get0_issuerUID β€” they get you the unique identifiers off a certificate and off an attribute certificate. that's the whole job. no notes. periodt πŸ’…


✨ SYNOPSIS ✨

first up, the regular certificate flavour β€” you gotta include the x509 header:

#include <openssl/x509.h>

void X509_get0_uids(const X509 *x, const ASN1_BIT_STRING **piuid,
                    const ASN1_BIT_STRING **psuid);

then the attribute certificate flavour, which lives in its own header (iconic of it, honestly):

#include <openssl/x509_acert.h>

ASN1_BIT_STRING *X509_ACERT_get0_issuerUID(X509_ACERT *x);

✨ DESCRIPTION ✨

so here's the tea β˜•

X509_get0_uids() takes the certificate x and it sets *piuid and *psuid to the issuer and subject unique identifiers of that certificate. but bestie, if those fields aren't present? it just sets them to NULL. no drama, no error, just NULL. respect honestly.

X509_ACERT_get0_issuerUID() is the attribute-certificate girlie: it returns the issuer unique identifier of the attribute certificate x, or NULL if that field isn't there. that's it, that's the function πŸ’–


✨ NOTES ✨

ngl, the issuer and subject unique identifier fields are very rarely encountered in practice outside of test cases. like… literally basically never in the wild. it's giving "only shows up in unit tests" energy πŸ™ˆ so don't be shocked if you go your whole career without seeing one.


✨ RETURN VALUES ✨

  • X509_get0_uids() β€” does not return a value. it's a void function, it just fills in your pointers and moves on. main character, zero cardio πŸŽ€
  • X509_ACERT_get0_issuerUID() β€” returns a unique identifier on success, or NULL on failure. so like… always check it, bestie πŸ’€

✨ SEE ALSO ✨

go read these next, they're all connected, iykyk πŸ¦‹

d2i_X509(3), ERR_get_error(3), X509_CRL_get0_by_serial(3), X509_get0_signature(3), X509_get_ext_d2i(3), X509_get_extension_flags(3), X509_get_pubkey(3), X509_get_subject_name(3), X509_get_version(3), X509_NAME_add_entry_by_txt(3), X509_NAME_ENTRY_get_object(3), X509_NAME_get_index_by_NID(3), X509_NAME_print_ex(3), X509_new(3), X509_sign(3), X509V3_get_d2i(3), X509_verify_cert(3)


✨ HISTORY ✨

a lil glow-up timeline for you πŸ’…

  • X509_get0_uids() β€” added in OpenSSL 1.1.0. so it's been around a minute.
  • X509_ACERT_get0_issuerUID() β€” added in OpenSSL 3.4. the new girl on the block ✨

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

bestie this is the legal bit so i'm gonna say it straight: use it only in compliance with the License, fr fr. no cap. πŸ“œ

and that's the whole page!! this was OpenSSL 4.0.3, dated 2026-09-29, from the X509_GET0_UIDS(3SSL) manual β€” slay, thanks for reading, go forth and check your NULLs πŸ’–βœ¨πŸŽ€

πŸ“¦ where this page comes from