.\" ** You probably do not want to edit this file directly ** .\" It was generated using the DocBook XSL Stylesheets (version 1.69.1). .\" Instead of manually editing it, you probably should edit the DocBook XML .\" source for it and then use the DocBook XSL Stylesheets to regenerate it. .TH "NE_SSL_CERT_IDENTITY" "3" "23 May 2006" "neon 0.26.1" "neon API reference" .\" disable hyphenation .nh .\" disable justification (adjust text to left margin only) .ad l .SH "NAME" ne_ssl_cert_identity, ne_ssl_cert_signedby, ne_ssl_cert_issuer, ne_ssl_cert_subject \- functions to access certificate properties .SH "SYNOPSIS" .PP \fB#include \fR .HP 33 \fBconst\ char\ *\fBne_ssl_cert_identity\fR\fR\fB(\fR\fBconst\ ne_ssl_certificate\ *\fR\fB\fIcert\fR\fR\fB);\fR .HP 47 \fBconst\ ne_ssl_certificate\ *\fBne_ssl_cert_signedby\fR\fR\fB(\fR\fBconst\ ne_ssl_certificate\ *\fR\fB\fIcert\fR\fR\fB);\fR .HP 40 \fBconst\ ne_ssl_dname\ *\fBne_ssl_cert_subject\fR\fR\fB(\fR\fBconst\ ne_ssl_certificate\ *\fR\fB\fIcert\fR\fR\fB);\fR .HP 39 \fBconst\ ne_ssl_dname\ *\fBne_ssl_cert_issuer\fR\fR\fB(\fR\fBconst\ ne_ssl_certificate\ *\fR\fB\fIcert\fR\fR\fB);\fR .SH "DESCRIPTION" .PP The function \fBne_ssl_cert_identity\fR retrieves the \(lqidentity\(rq 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 \fIcommon name\fR attribute of the distinguished name of the certificate subject. .PP The functions \fBne_ssl_cert_subject\fR and \fBne_ssl_cert_issuer\fR can be used to access the objects representing the distinguished name of the subject and of the issuer of a certificate, respectively. .PP If a certificate object is part of a certificate chain, then \fBne_ssl_cert_signedby\fR 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. .SH "RETURN VALUE" .PP \fBne_ssl_cert_issuer\fR and \fBne_ssl_cert_subject\fR are guaranteed to never return NULL. \fBne_ssl_cert_identity\fR may return NULL if the certificate has no specific \(lqidentity\(rq. \fBne_ssl_cert_signedby\fR may return NULL as covered above. .SH "EXAMPLES" .PP The following function could be used to display information about a given certificate: .sp .nf 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); } .fi .SH "SEE ALSO" .PP ne_ssl_cert_cmp, ne_ssl_readable_dname