ne_ssl_cert_cmp(3)

ne_ssl_cert_cmp3

Functions to operate on certificate objects

Usage

#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);

Overview

The ne_ssl_cert_cmp function can be used to compare two certificate objects; it returns zero if they refer to the same certificate, and non-zero otherwise.

The ne_ssl_cert_free function can be used to destroy a certificate object when it is no longer needed.

The ne_ssl_cert_digest function writes a human-readable fingerprint as a NUL-terminated string to the digest buffer provided, in the format "aa:bb...:ff". The digest buffer must be at least NE_SSL_DIGESTLEN bytes in length.

The ne_ssl_cert_hdigest function returns a human-readable fingerprint for the certificate object. The flags parameter specifies the hash formatting options as if passed to ne_strhash(3). The returned string is malloc-allocated and must be freed after use.

The ne_ssl_cert_validity_time function retrieves both the time from which the certificate is valid from and until. Each time is returned through the from and until parameters, which are written as (time_t)-1 if either time cannot be represented as a time_t value. The ne_ssl_cert_validity function similarly writes the validity times to the string buffers provided, using RFC 1123-style date formatting (not localized). The output parameters must be at least NE_SSL_VDATELEN bytes in length. Either parameter can be passed as NULL.

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.

Releases

11 releases since Debian 4.0 (Etch); the text changed 9 times.

  1. 4.0
  2. 5.0
  3. 6.0
  4. 7
  5. 8
  6. 9–10
  7. 11
  8. 12
  9. 13
  10. Arch

History

ne_ssl_cert_hdigest is available in in neon 0.32.0 and later.

From neon 0.37.1-1 in Arch Linux 2026-11-01. Parsed by carta from the page's man source.