CTLOG_STORE_new.3ossl 4.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142
  1. .\" -*- mode: troff; coding: utf-8 -*-
  2. .\" Automatically generated by Pod::Man 5.01 (Pod::Simple 3.43)
  3. .\"
  4. .\" Standard preamble:
  5. .\" ========================================================================
  6. .de Sp \" Vertical space (when we can't use .PP)
  7. .if t .sp .5v
  8. .if n .sp
  9. ..
  10. .de Vb \" Begin verbatim text
  11. .ft CW
  12. .nf
  13. .ne \\$1
  14. ..
  15. .de Ve \" End verbatim text
  16. .ft R
  17. .fi
  18. ..
  19. .\" \*(C` and \*(C' are quotes in nroff, nothing in troff, for use with C<>.
  20. .ie n \{\
  21. . ds C` ""
  22. . ds C' ""
  23. 'br\}
  24. .el\{\
  25. . ds C`
  26. . ds C'
  27. 'br\}
  28. .\"
  29. .\" Escape single quotes in literal strings from groff's Unicode transform.
  30. .ie \n(.g .ds Aq \(aq
  31. .el .ds Aq '
  32. .\"
  33. .\" If the F register is >0, we'll generate index entries on stderr for
  34. .\" titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index
  35. .\" entries marked with X<> in POD. Of course, you'll have to process the
  36. .\" output yourself in some meaningful fashion.
  37. .\"
  38. .\" Avoid warning from groff about undefined register 'F'.
  39. .de IX
  40. ..
  41. .nr rF 0
  42. .if \n(.g .if rF .nr rF 1
  43. .if (\n(rF:(\n(.g==0)) \{\
  44. . if \nF \{\
  45. . de IX
  46. . tm Index:\\$1\t\\n%\t"\\$2"
  47. ..
  48. . if !\nF==2 \{\
  49. . nr % 0
  50. . nr F 2
  51. . \}
  52. . \}
  53. .\}
  54. .rr rF
  55. .\" ========================================================================
  56. .\"
  57. .IX Title "CTLOG_STORE_NEW 3ossl"
  58. .TH CTLOG_STORE_NEW 3ossl 2025-01-17 3.4.0 OpenSSL
  59. .\" For nroff, turn off justification. Always turn off hyphenation; it makes
  60. .\" way too many mistakes in technical documents.
  61. .if n .ad l
  62. .nh
  63. .SH NAME
  64. CTLOG_STORE_new_ex,
  65. CTLOG_STORE_new, CTLOG_STORE_free,
  66. CTLOG_STORE_load_default_file, CTLOG_STORE_load_file \-
  67. Create and populate a Certificate Transparency log list
  68. .SH SYNOPSIS
  69. .IX Header "SYNOPSIS"
  70. .Vb 1
  71. \& #include <openssl/ct.h>
  72. \&
  73. \& CTLOG_STORE *CTLOG_STORE_new_ex(OSSL_LIB_CTX *libctx, const char *propq);
  74. \& CTLOG_STORE *CTLOG_STORE_new(void);
  75. \& void CTLOG_STORE_free(CTLOG_STORE *store);
  76. \&
  77. \& int CTLOG_STORE_load_default_file(CTLOG_STORE *store);
  78. \& int CTLOG_STORE_load_file(CTLOG_STORE *store, const char *file);
  79. .Ve
  80. .SH DESCRIPTION
  81. .IX Header "DESCRIPTION"
  82. A CTLOG_STORE is a container for a list of CTLOGs (Certificate Transparency
  83. logs). The list can be loaded from one or more files and then searched by LogID
  84. (see RFC 6962, Section 3.2, for the definition of a LogID).
  85. .PP
  86. \&\fBCTLOG_STORE_new_ex()\fR creates an empty list of CT logs associated with
  87. the library context \fIlibctx\fR and the property query string \fIpropq\fR.
  88. .PP
  89. \&\fBCTLOG_STORE_new()\fR does the same thing as \fBCTLOG_STORE_new_ex()\fR but with
  90. the default library context and property query string.
  91. .PP
  92. The CTLOG_STORE is then populated by \fBCTLOG_STORE_load_default_file()\fR or
  93. \&\fBCTLOG_STORE_load_file()\fR. \fBCTLOG_STORE_load_default_file()\fR loads from the default
  94. file, which is named \fIct_log_list.cnf\fR in OPENSSLDIR (see the output of
  95. \&\fBopenssl\-version\fR\|(1)). This can be overridden using an environment variable
  96. named \fBCTLOG_FILE\fR. \fBCTLOG_STORE_load_file()\fR loads from a caller-specified file
  97. path instead. Both of these functions append any loaded CT logs to the
  98. CTLOG_STORE.
  99. .PP
  100. The expected format of the file is:
  101. .PP
  102. .Vb 1
  103. \& enabled_logs=foo,bar
  104. \&
  105. \& [foo]
  106. \& description = Log 1
  107. \& key = <base64\-encoded DER SubjectPublicKeyInfo here>
  108. \&
  109. \& [bar]
  110. \& description = Log 2
  111. \& key = <base64\-encoded DER SubjectPublicKeyInfo here>
  112. .Ve
  113. .PP
  114. Once a CTLOG_STORE is no longer required, it should be passed to
  115. \&\fBCTLOG_STORE_free()\fR. This will delete all of the CTLOGs stored within, along
  116. with the CTLOG_STORE itself. If the argument is NULL, nothing is done.
  117. .SH NOTES
  118. .IX Header "NOTES"
  119. If there are any invalid CT logs in a file, they are skipped and the remaining
  120. valid logs will still be added to the CTLOG_STORE. A CT log will be considered
  121. invalid if it is missing a "key" or "description" field.
  122. .SH "RETURN VALUES"
  123. .IX Header "RETURN VALUES"
  124. Both \fBCTLOG_STORE_load_default_file\fR and \fBCTLOG_STORE_load_file\fR return 1 if
  125. all CT logs in the file are successfully parsed and loaded, 0 otherwise.
  126. .SH "SEE ALSO"
  127. .IX Header "SEE ALSO"
  128. \&\fBct\fR\|(7),
  129. \&\fBCTLOG_STORE_get0_log_by_id\fR\|(3),
  130. \&\fBSSL_CTX_set_ctlog_list_file\fR\|(3)
  131. .SH HISTORY
  132. .IX Header "HISTORY"
  133. CTLOG_STORE_new_ex was added in OpenSSL 3.0. All other functions were
  134. added in OpenSSL 1.1.0.
  135. .SH COPYRIGHT
  136. .IX Header "COPYRIGHT"
  137. Copyright 2016\-2024 The OpenSSL Project Authors. All Rights Reserved.
  138. .PP
  139. Licensed under the Apache License 2.0 (the "License"). You may not use
  140. this file except in compliance with the License. You can obtain a copy
  141. in the file LICENSE in the source distribution or at
  142. <https://www.openssl.org/source/license.html>.