---
name: "ne_ssl_cert_identity"
section: "3"
platform: "linux"
package: "neon"
version: "0.37.1-1"
release: "Arch Linux 2026-11-01"
platforms: ["linux"]
url: "https://new.carta.tech/ne_ssl_cert_identity"
---

# ne\_ssl\_cert\_identity(3)

functions to access certificate properties

## NAME

ne\_ssl\_cert\_identity, ne\_ssl\_cert\_signedby, ne\_ssl\_cert\_issuer, ne\_ssl\_cert\_subject - functions to access certificate properties

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

## DESCRIPTION

The function **ne\_ssl\_cert\_identity** retrieves the “identity” of a certificate; for an SSL server certificate, this will be the hostname for which the certificate was issued. In PKI parlance, the identity is the *common name* attribute of the distinguished name of the certificate subject.

The functions **ne\_ssl\_cert\_subject** and **ne\_ssl\_cert\_issuer** can be used to access the objects representing the distinguished name of the subject and of the issuer of a certificate, respectively.

If a certificate object is part of a certificate chain, then **ne\_ssl\_cert\_signedby** can be used to find the certificate which signed a particular certificate. For a self-signed certificate or a certificate for which the full chain is not available, this function will return NULL.

## RETURN VALUE

**ne\_ssl\_cert\_issuer** and **ne\_ssl\_cert\_subject** are guaranteed to never return NULL. **ne\_ssl\_cert\_identity** may return NULL if the certificate has no specific “identity”. **ne\_ssl\_cert\_signedby** may return NULL as covered above.

## EXAMPLES

The following function could be used to display information about a given certificate:

```
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);
}
```

## SEE ALSO

[**ne\_ssl\_cert\_cmp**(3)](/ne_ssl_cert_cmp/3.md), [**ne\_ssl\_readable\_dname**(3)](/ne_ssl_readable_dname/3.md)

## COPYRIGHT

Copyright © 2001-2026 Joe Orton\
