NE_SSL_CERT_CMP(3)

πŸ’… NE_SSL_CERT_CMP(3) β€” the neon API reference, bestie edition πŸŽ€

okay so this is a page straight out of the neon manual (yes, that neon, the API reference one), and it's literally all about certificate objects β€” comparing them, freeing them, fingerprinting them, checking their validity window. six functions, one page, zero skips. let's go ✨


🌸 NAME 🌸

ne_ssl_cert_cmp, ne_ssl_cert_free, ne_ssl_cert_digest, ne_ssl_cert_hdigest, ne_ssl_cert_validity, ne_ssl_cert_validity_time β€” the girlies that operate on certificate objects 🫢


✨ SYNOPSIS ✨

#include <ne_header.h>

int ne_ssl_cert_cmp(const ne_ssl_certificate *c1,
                    const ne_ssl_certificate *c2);

void ne_ssl_cert_free(ne_ssl_certificate *cert);

int ne_ssl_cert_digest(const ne_ssl_certificate *c1, char *digest);

char *ne_ssl_cert_hdigest(const ne_ssl_certificate *c1,
                          unsigned int flags);

void ne_ssl_cert_validity_time(const ne_ssl_certificate *cert,
                               time_t *from, time_t *until);

void ne_ssl_cert_validity(const ne_ssl_certificate *cert, char *from,
                          char *until);

like, screenshot this, it's the whole cast πŸ‘‘


πŸ’– DESCRIPTION πŸ’–

ne_ssl_cert_cmp β€” the vibe check πŸͺž

you use ne_ssl_cert_cmp to compare two certificate objects. it returns zero if they refer to the same certificate, and non-zero otherwise. that's it, that's the whole function, no cap.

ne_ssl_cert_free β€” the goodbye πŸ’”

ne_ssl_cert_free destroys a certificate object once you're done with it and it's no longer needed. be a good citizen and actually call it, bestie. 🧚

ne_ssl_cert_digest β€” fingerprint reveal 😭

ne_ssl_cert_digest writes a human-readable fingerprint as a NUL-terminated string into the digest buffer you hand it, formatted like "aa:bb...:ff". the digest buffer must be at least NE_SSL_DIGESTLEN bytes in length. queen of precision, we stan. πŸ’…

ne_ssl_cert_hdigest β€” the malloc'd twin 🌈

ne_ssl_cert_hdigest returns a human-readable fingerprint for the certificate object. the flags parameter specifies the hash formatting options as if passed to ne_strhash(3) (iykyk). the returned string is malloc-allocated and must be freed after use β€” not me having to remind you to free() your stuff πŸ™ˆ

ne_ssl_cert_validity_time β€” when's the window ⏰

ne_ssl_cert_validity_time retrieves both the time from which the certificate is valid from and until. each time comes back through the from and until parameters, and they're written as (time_t)-1 if either time cannot be represented as a time_t value. tragic, but that's the rule.

ne_ssl_cert_validity β€” same energy, but strings πŸŽ€

ne_ssl_cert_validity similarly writes the validity times into the string buffers you provide, using RFC 1123-style date formatting (not localized β€” we're keeping it universal, periodt). the output parameters must be at least NE_SSL_VDATELEN bytes in length. and the best part: either parameter can be passed as NULL. flexible icon behavior ✨


πŸ”₯ RETURN VALUE πŸ”₯

  • ne_ssl_cert_cmp returns 0 if the certificates are the same, and non-zero otherwise.
  • ne_ssl_cert_digest returns 0 on success or non-zero on error.
  • the return value of ne_ssl_cert_hdigest is a NUL-terminated malloc-allocated string, or NULL if the hash cannot be created. 😭
lowkey important: ne_ssl_cert_free and ne_ssl_cert_validity / ne_ssl_cert_validity_time return nothing β€” they're void, so don't go checking them for status, bestie. πŸ’€

πŸ¦‹ HISTORY πŸ¦‹

ne_ssl_cert_hdigest is available in in neon 0.32.0 and later. (yes it says "in in", we're keeping it, it's iconic, the manpage said it first πŸ‘‘)


⭐ SEE ALSO ⭐

  • ne_strhash(3) β€” go read it, it's giving main character energy 🌟

Copyright Β© 2001-2026 Joe Orton


okay that's the whole page, you're officially a certificate object expert now, no notes 🫢✨

β€” from the neon manual, dated 03/20/2026 πŸŽ€ (that's the source/version and date, folded in cute so the footer stays slay) πŸ’…

πŸ“¦ where this page comes from