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