ne_ssl_cert_cmp.3 4.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114
  1. '\" t
  2. .\" Title: ne_ssl_cert_cmp
  3. .\" Author:
  4. .\" Generator: DocBook XSL Stylesheets vsnapshot <http://docbook.sf.net/>
  5. .\" Date: 23 November 2025
  6. .\" Manual: neon API reference
  7. .\" Source: neon 0.36.0
  8. .\" Language: English
  9. .\"
  10. .TH "NE_SSL_CERT_CMP" "3" "23 November 2025" "neon 0.36.0" "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_cmp, ne_ssl_cert_free, ne_ssl_cert_digest, ne_ssl_cert_hdigest, ne_ssl_cert_validity, ne_ssl_cert_validity_time \- functions to operate on certificate objects
  32. .SH "SYNOPSIS"
  33. .sp
  34. .ft B
  35. .nf
  36. #include <ne_header\&.h>
  37. .fi
  38. .ft
  39. .HP \w'int\ ne_ssl_cert_cmp('u
  40. .BI "int ne_ssl_cert_cmp(const\ ne_ssl_certificate\ *" "c1" ", const\ ne_ssl_certificate\ *" "c2" ");"
  41. .HP \w'void\ ne_ssl_cert_free('u
  42. .BI "void ne_ssl_cert_free(ne_ssl_certificate\ *" "cert" ");"
  43. .HP \w'int\ ne_ssl_cert_digest('u
  44. .BI "int ne_ssl_cert_digest(const\ ne_ssl_certificate\ *" "c1" ", char\ *" "digest" ");"
  45. .HP \w'char\ *ne_ssl_cert_hdigest('u
  46. .BI "char *ne_ssl_cert_hdigest(const\ ne_ssl_certificate\ *" "c1" ", unsigned\ int\ " "flags" ");"
  47. .HP \w'void\ ne_ssl_cert_validity_time('u
  48. .BI "void ne_ssl_cert_validity_time(const\ ne_ssl_certificate\ *" "cert" ", time_t\ *" "from" ", time_t\ *" "until" ");"
  49. .HP \w'void\ ne_ssl_cert_validity('u
  50. .BI "void ne_ssl_cert_validity(const\ ne_ssl_certificate\ *" "cert" ", char\ *" "from" ", char\ *" "until" ");"
  51. .SH "DESCRIPTION"
  52. .PP
  53. The
  54. \fBne_ssl_cert_cmp\fR
  55. function can be used to compare two certificate objects; it returns zero if they refer to the same certificate, and non\-zero otherwise\&.
  56. .PP
  57. The
  58. \fBne_ssl_cert_free\fR
  59. function can be used to destroy a certificate object when it is no longer needed\&.
  60. .PP
  61. The
  62. \fBne_ssl_cert_digest\fR
  63. function writes a human\-readable fingerprint as a NUL\-terminated string to the
  64. \fIdigest\fR
  65. buffer provided, in the format "aa:bb\&.\&.\&.:ff"\&. The
  66. \fIdigest\fR
  67. buffer must be at least
  68. NE_SSL_DIGESTLEN
  69. bytes in length\&.
  70. .PP
  71. The
  72. \fBne_ssl_cert_hdigest\fR
  73. function returns a human\-readable fingerprint for the certificate object\&. The
  74. \fIflags\fR
  75. parameter specifies the hash formatting options as if passed to
  76. ne_strhash\&. The returned string is malloc\-allocated and must be freed after use\&.
  77. .PP
  78. The
  79. \fBne_ssl_cert_validity_time\fR
  80. function retrieves both the time from which the certificate is valid from and until\&. Each time is returned through the
  81. \fIfrom\fR
  82. and
  83. \fIuntil\fR
  84. parameters, which are written as
  85. (time_t)\-1
  86. if either time cannot be represented as a
  87. time_t
  88. value\&. The
  89. \fBne_ssl_cert_validity\fR
  90. 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
  91. NE_SSL_VDATELEN
  92. bytes in length\&. Either parameter can be passed as
  93. NULL\&.
  94. .SH "RETURN VALUE"
  95. .PP
  96. \fBne_ssl_cert_cmp\fR
  97. returns 0 if the certificates are the same, and non\-zero otherwise\&.
  98. \fBne_ssl_cert_digest\fR
  99. returns 0 on success or non\-zero on error\&. The return value of
  100. \fBne_ssl_cert_hdigest\fR
  101. is a NUL\-terminated malloc\-allocated string, or
  102. NULL
  103. if the hash cannot be created\&.
  104. .SH "HISTORY"
  105. .PP
  106. \fBne_ssl_cert_hdigest\fR
  107. is available in in neon 0\&.32\&.0 and later\&.
  108. .SH "SEE ALSO"
  109. .PP
  110. ne_strhash
  111. .SH "COPYRIGHT"
  112. .br
  113. Copyright \(co 2001-2025 Joe Orton
  114. .br