CTLOG_STORE_new.pod 2.4 KB

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