Add documentation for ASN1_INTEGER_new() and ASN1_INTEGER_free()
[openssl.git] / doc / man3 / CTLOG_STORE_new.pod
1 =pod
2
3 =head1 NAME
4
5 CTLOG_STORE_new_with_libctx,
6 CTLOG_STORE_new, CTLOG_STORE_free,
7 CTLOG_STORE_load_default_file, CTLOG_STORE_load_file -
8 Create and populate a Certificate Transparency log list
9
10 =head1 SYNOPSIS
11
12  #include <openssl/ct.h>
13
14  CTLOG_STORE *CTLOG_STORE_new_with_libctx(OPENSSL_CTX *libctx,
15                                           const char *propq);
16  CTLOG_STORE *CTLOG_STORE_new(void);
17  void CTLOG_STORE_free(CTLOG_STORE *store);
18
19  int CTLOG_STORE_load_default_file(CTLOG_STORE *store);
20  int CTLOG_STORE_load_file(CTLOG_STORE *store, const char *file);
21
22 =head1 DESCRIPTION
23
24 A CTLOG_STORE is a container for a list of CTLOGs (Certificate Transparency
25 logs). The list can be loaded from one or more files and then searched by LogID
26 (see RFC 6962, Section 3.2, for the definition of a LogID).
27
28 CTLOG_STORE_new_with_libctx() creates an empty list of CT logs associated with
29 the library context I<libctx> and the property query string I<propq>.
30
31 CTLOG_STORE_new() does the same thing as CTLOG_STORE_new_with_libctx() but with
32 the default library context and property query string.
33
34 The CTLOG_STORE is then populated by CTLOG_STORE_load_default_file() or
35 CTLOG_STORE_load_file(). CTLOG_STORE_load_default_file() loads from the default
36 file, which is named F<ct_log_list.cnf> in OPENSSLDIR (see the output of
37 L<openssl-version(1)>). This can be overridden using an environment variable
38 named B<CTLOG_FILE>. CTLOG_STORE_load_file() loads from a caller-specified file
39 path instead. Both of these functions append any loaded CT logs to the
40 CTLOG_STORE.
41
42 The expected format of the file is:
43
44  enabled_logs=foo,bar
45
46  [foo]
47  description = Log 1
48  key = <base64-encoded DER SubjectPublicKeyInfo here>
49
50  [bar]
51  description = Log 2
52  key = <base64-encoded DER SubjectPublicKeyInfo here>
53
54 Once a CTLOG_STORE is no longer required, it should be passed to
55 CTLOG_STORE_free(). This will delete all of the CTLOGs stored within, along
56 with the CTLOG_STORE itself.
57
58 =head1 NOTES
59
60 If there are any invalid CT logs in a file, they are skipped and the remaining
61 valid logs will still be added to the CTLOG_STORE. A CT log will be considered
62 invalid if it is missing a "key" or "description" field.
63
64 =head1 RETURN VALUES
65
66 Both B<CTLOG_STORE_load_default_file> and B<CTLOG_STORE_load_file> return 1 if
67 all CT logs in the file are successfully parsed and loaded, 0 otherwise.
68
69 =head1 SEE ALSO
70
71 L<ct(7)>,
72 L<CTLOG_STORE_get0_log_by_id(3)>,
73 L<SSL_CTX_set_ctlog_list_file(3)>
74
75 =head1 HISTORY
76
77 CTLOG_STORE_new_with_libctx was added in OpenSSL 3.0. All other functions were
78 added in OpenSSL 1.1.0.
79
80 =head1 COPYRIGHT
81
82 Copyright 2016-2020 The OpenSSL Project Authors. All Rights Reserved.
83
84 Licensed under the Apache License 2.0 (the "License").  You may not use
85 this file except in compliance with the License.  You can obtain a copy
86 in the file LICENSE in the source distribution or at
87 L<https://www.openssl.org/source/license.html>.
88
89 =cut