NE_SSL_CERT_IDENTITY(3)

πŸ’… NE_SSL_CERT_IDENTITY(3) πŸ’…

ok so this is a page from the neon API reference (yes, the neon library, say hi πŸ‘‹) and it's all about peeking at certificate properties bestie. four whole functions. let's get into it ✨


πŸŽ€ SYNOPSIS πŸŽ€

#include <ne_ssl.h>

const char *ne_ssl_cert_identity(const ne_ssl_certificate *cert);

const ne_ssl_certificate *ne_ssl_cert_signedby(const ne_ssl_certificate *cert);

const ne_ssl_dname *ne_ssl_cert_subject(const ne_ssl_certificate *cert);

const ne_ssl_dname *ne_ssl_cert_issuer(const ne_ssl_certificate *cert);

🌸 NAME 🌸

ne_ssl_cert_identity, ne_ssl_cert_signedby, ne_ssl_cert_issuer, ne_ssl_cert_subject β€” the little handful of functions that let you read certificate properties. that's the whole vibe πŸ’–


πŸ¦‹ DESCRIPTION πŸ¦‹

okay so first up, ne_ssl_cert_identity grabs the "identity" of a certificate. if you're dealing with an SSL server certificate, that identity is literally the hostname the certificate was issued for. and in PKI-speak (iykyk), the identity is the common name attribute of the distinguished name of the certificate subject. love that for us πŸ‘‘

then we've got ne_ssl_cert_subject and ne_ssl_cert_issuer β€” bestie duo 🫢 β€” and they give you the objects that represent the distinguished name of the subject and of the issuer of a certificate, respectively. one's who it's about, one's who signed off on it.

and if a certificate object happens to be part of a certificate chain (main character energy), then ne_ssl_cert_signedby lets you find the certificate that signed that particular certificate. iconic. but listen β€” for a self-signed certificate, or a certificate where the full chain just isn't available, this function will return NULL. no cap, no notes. πŸ’€


⭐ RETURN VALUE ⭐

  • ne_ssl_cert_issuer and ne_ssl_cert_subject are guaranteed to never return NULL. ever. slay πŸ’…
  • ne_ssl_cert_identity may return NULL if the certificate has no specific "identity". it happens.
  • ne_ssl_cert_signedby may return NULL as covered above πŸ‘† (the self-signed / no-full-chain situation, you remember).

🧚 EXAMPLES 🧚

this function right here could be used to display info about a given certificate, and honestly? it ate:

void dump_cert(const ne_ssl_certificate *cert) {
  const char *id = ne_ssl_cert_identity(cert);
  char *dn;

  if (id)
    printf("Certificate was issued for '%s'.\n", id);

  dn = ne_ssl_readable_dname(ne_ssl_cert_subject(cert));
  printf("Subject: %s\n", dn);
  free(dn);

  dn = ne_ssl_readable_dname(ne_ssl_cert_issuer(cert));
  printf("Issuer: %s\n", dn);
  free(dn);
}

not the free(dn) twice, we love a tidy queen πŸŽ€


πŸ”₯ SEE ALSO πŸ”₯

go read those next, they're giving necessary context fr fr 🌈


Copyright Β© 2001-2026 Joe Orton


ok that's the whole page, you're officially certificate-literate bestie πŸ’œ this was the neon API reference, page NE_SSL_CERT_IDENTITY(3), brought to you by neon and dated 03/20/2026 β€” mwah, take care, drink water, and go read your chains πŸ“βœ¨

πŸ“¦ where this page comes from