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_issuerandne_ssl_cert_subjectare guaranteed to never returnNULL. ever. slay πne_ssl_cert_identitymay returnNULLif the certificate has no specific "identity". it happens.ne_ssl_cert_signedbymay returnNULLas 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 π
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
- arch rolling: neon 0.37.1-1 Β· LGPL-2.0-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms