1NE_SSL_CERT_READ(3)           neon API reference           NE_SSL_CERT_READ(3)
2
3
4

NAME

6       ne_ssl_cert_read,         ne_ssl_cert_write,        ne_ssl_cert_import,
7       ne_ssl_cert_export - functions to read or  write  certificates  to  and
8       from files or strings
9

SYNOPSIS

11       #include <ne_ssl.h>
12
13
14       ne_ssl_certificate *ne_ssl_cert_read (const char *filename);
15
16       int ne_ssl_cert_write (const ne_ssl_certificate *cert,
17                              const char *filename);
18
19       ne_ssl_certificate *ne_ssl_cert_import (const char *data);
20
21       char *ne_ssl_cert_export (const ne_ssl_certificate *cert);
22
23

DESCRIPTION

25       The ne_ssl_cert_write function writes a certificate to a file using the
26       PEM  encoding. The ne_ssl_cert_export function returns a base64-encoded
27       NUL-terminated string representing the certificate. This string is mal‐
28       loc-allocated and should be destroyed using free by the caller.
29
30
31       The  ne_ssl_cert_read  function  reads a certificate from a PEM-encoded
32       file, and returns a certificate object. The ne_ssl_cert_import function
33       returns a certificate object from a base64-encoded string, data, as re‐
34       turned by ne_ssl_cert_export. The certificate object returned by  these
35       functions should be destroyed using ne_ssl_cert_free(3) after use.
36
37

RETURN VALUE

39       ne_ssl_cert_read  returns  NULL if a certificate could not be read from
40       the file. ne_ssl_cert_write returns non-zero if the  certificate  could
41       not  be  written  to  the  file.  ne_ssl_cert_export  always  returns a
42       NUL-terminated string, and never NULL. ne_ssl_cert_import returns  NULL
43       if the string was not a valid base64-encoded certificate.
44
45

ENCODING FORMATS

47       The string produced by ne_ssl_cert_export is the base64 encoding of the
48       DER  representation  of  the   certificate.   The   file   written   by
49       ne_ssl_cert_write  uses  the PEM format: this is the base64 encoding of
50       the DER representation with newlines every 64 characters, and start and
51       end marker lines.
52
53

AUTHOR

55       Joe Orton <neon@webdav.org>.
56
57
58
59neon 0.25.5                     20 January 2006            NE_SSL_CERT_READ(3)
Impressum