ne_ssl_cert_read.3 3.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697
  1. '\" t
  2. .\" Title: ne_ssl_cert_read
  3. .\" Author:
  4. .\" Generator: DocBook XSL Stylesheets vsnapshot <http://docbook.sf.net/>
  5. .\" Date: 20 September 2021
  6. .\" Manual: neon API reference
  7. .\" Source: neon 0.32.1
  8. .\" Language: English
  9. .\"
  10. .TH "NE_SSL_CERT_READ" "3" "20 September 2021" "neon 0.32.1" "neon API reference"
  11. .\" -----------------------------------------------------------------
  12. .\" * Define some portability stuff
  13. .\" -----------------------------------------------------------------
  14. .\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  15. .\" http://bugs.debian.org/507673
  16. .\" http://lists.gnu.org/archive/html/groff/2009-02/msg00013.html
  17. .\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  18. .ie \n(.g .ds Aq \(aq
  19. .el .ds Aq '
  20. .\" -----------------------------------------------------------------
  21. .\" * set default formatting
  22. .\" -----------------------------------------------------------------
  23. .\" disable hyphenation
  24. .nh
  25. .\" disable justification (adjust text to left margin only)
  26. .ad l
  27. .\" -----------------------------------------------------------------
  28. .\" * MAIN CONTENT STARTS HERE *
  29. .\" -----------------------------------------------------------------
  30. .SH "NAME"
  31. ne_ssl_cert_read, ne_ssl_cert_write, ne_ssl_cert_import, ne_ssl_cert_export \- functions to read or write certificates to and from files or strings
  32. .SH "SYNOPSIS"
  33. .sp
  34. .ft B
  35. .nf
  36. #include <ne_ssl\&.h>
  37. .fi
  38. .ft
  39. .HP \w'ne_ssl_certificate\ *ne_ssl_cert_read('u
  40. .BI "ne_ssl_certificate *ne_ssl_cert_read(const\ char\ *" "filename" ");"
  41. .HP \w'int\ ne_ssl_cert_write('u
  42. .BI "int ne_ssl_cert_write(const\ ne_ssl_certificate\ *" "cert" ", const\ char\ *" "filename" ");"
  43. .HP \w'ne_ssl_certificate\ *ne_ssl_cert_import('u
  44. .BI "ne_ssl_certificate *ne_ssl_cert_import(const\ char\ *" "data" ");"
  45. .HP \w'char\ *ne_ssl_cert_export('u
  46. .BI "char *ne_ssl_cert_export(const\ ne_ssl_certificate\ *" "cert" ");"
  47. .SH "DESCRIPTION"
  48. .PP
  49. The
  50. \fBne_ssl_cert_write\fR
  51. function writes a certificate to a file using the PEM encoding\&. The
  52. \fBne_ssl_cert_export\fR
  53. function returns a base64\-encoded
  54. NUL\-terminated string representing the certificate\&. This string is malloc\-allocated and should be destroyed using
  55. \fBfree\fR
  56. by the caller\&.
  57. .PP
  58. The
  59. \fBne_ssl_cert_read\fR
  60. function reads a certificate from a PEM\-encoded file, and returns a certificate object\&. The
  61. \fBne_ssl_cert_import\fR
  62. function returns a certificate object from a base64\-encoded string,
  63. \fIdata\fR, as returned by
  64. \fBne_ssl_cert_export\fR\&. The certificate object returned by these functions should be destroyed using
  65. ne_ssl_cert_free
  66. after use\&.
  67. .SH "RETURN VALUE"
  68. .PP
  69. \fBne_ssl_cert_read\fR
  70. returns
  71. NULL
  72. if a certificate could not be read from the file\&.
  73. \fBne_ssl_cert_write\fR
  74. returns non\-zero if the certificate could not be written to the file\&.
  75. \fBne_ssl_cert_export\fR
  76. always returns a
  77. NUL\-terminated string, and never
  78. NULL\&.
  79. \fBne_ssl_cert_import\fR
  80. returns
  81. NULL
  82. if the string was not a valid base64\-encoded certificate\&.
  83. .SH "ENCODING FORMATS"
  84. .PP
  85. The string produced by
  86. \fBne_ssl_cert_export\fR
  87. is the base64 encoding of the DER representation of the certificate\&. The file written by
  88. \fBne_ssl_cert_write\fR
  89. uses the PEM format: this is the base64 encoding of the DER representation with newlines every 64 characters, and start and end marker lines\&.
  90. .SH "AUTHOR"
  91. .PP
  92. \fBJoe Orton\fR <\&[email protected]\&>
  93. .RS 4
  94. Author.
  95. .RE
  96. .SH "COPYRIGHT"
  97. .br