CTLOG_STORE_new.pod 2.8 KB

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