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