CTLOG_new.pod 3.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990
  1. =pod
  2. =head1 NAME
  3. CTLOG_new_ex, CTLOG_new, CTLOG_new_from_base64,
  4. CTLOG_new_from_base64_ex, CTLOG_free,
  5. CTLOG_get0_name, CTLOG_get0_log_id, CTLOG_get0_public_key -
  6. encapsulates information about a Certificate Transparency log
  7. =head1 SYNOPSIS
  8. #include <openssl/ct.h>
  9. CTLOG *CTLOG_new_ex(EVP_PKEY *public_key, const char *name,
  10. OSSL_LIB_CTX *libctx, const char *propq);
  11. CTLOG *CTLOG_new(EVP_PKEY *public_key, const char *name);
  12. int CTLOG_new_from_base64_ex(CTLOG **ct_log, const char *pkey_base64,
  13. const char *name, OSSL_LIB_CTX *libctx,
  14. const char *propq);
  15. int CTLOG_new_from_base64(CTLOG ** ct_log,
  16. const char *pkey_base64, const char *name);
  17. void CTLOG_free(CTLOG *log);
  18. const char *CTLOG_get0_name(const CTLOG *log);
  19. void CTLOG_get0_log_id(const CTLOG *log, const uint8_t **log_id,
  20. size_t *log_id_len);
  21. EVP_PKEY *CTLOG_get0_public_key(const CTLOG *log);
  22. =head1 DESCRIPTION
  23. CTLOG_new_ex() returns a new CTLOG that represents the Certificate
  24. Transparency (CT) log with the given public key and associates it with the
  25. library context I<libctx> and property query string I<propq>. A name must also
  26. be provided that can be used to help users identify this log. Ownership of the
  27. public key is transferred.
  28. CTLOG_new() does the same thing as CTLOG_new_ex() but with the default
  29. library context and the default property query string.
  30. CTLOG_new_from_base64_ex() also creates a new CTLOG, but takes the
  31. public key in base64-encoded DER form and sets the ct_log pointer to point to
  32. the new CTLOG. The base64 will be decoded and the public key parsed. The CTLOG
  33. will be associated with the given library context I<libctx> and property query
  34. string I<propq>.
  35. CTLOG_new_from_base64() does the same thing as
  36. CTLOG_new_from_base64_ex() except that the default library context and
  37. property query string are used.
  38. Regardless of whether CTLOG_new() or CTLOG_new_from_base64() is used, it is the
  39. caller's responsibility to pass the CTLOG to CTLOG_free() once it is no longer
  40. needed. This will delete it and, if created by CTLOG_new(), the EVP_PKEY that
  41. was passed to it.
  42. CTLOG_get0_name() returns the name of the log, as provided when the CTLOG was
  43. created. Ownership of the string remains with the CTLOG.
  44. CTLOG_get0_log_id() sets *log_id to point to a string containing that log's
  45. LogID (see RFC 6962). It sets *log_id_len to the length of that LogID. For a
  46. v1 CT log, the LogID will be a SHA-256 hash (i.e. 32 bytes long). Ownership of
  47. the string remains with the CTLOG.
  48. CTLOG_get0_public_key() returns the public key of the CT log. Ownership of the
  49. EVP_PKEY remains with the CTLOG.
  50. =head1 RETURN VALUES
  51. CTLOG_new() will return NULL if an error occurs.
  52. CTLOG_new_from_base64() will return 1 on success, 0 otherwise.
  53. =head1 SEE ALSO
  54. L<ct(7)>
  55. =head1 HISTORY
  56. The functions CTLOG_new_ex() and CTLOG_new_from_base64_ex()
  57. were added in OpenSSL 3.0. All other functions were added in OpenSSL 1.1.0.
  58. =head1 COPYRIGHT
  59. Copyright 2016-2020 The OpenSSL Project Authors. All Rights Reserved.
  60. Licensed under the Apache License 2.0 (the "License"). You may not use
  61. this file except in compliance with the License. You can obtain a copy
  62. in the file LICENSE in the source distribution or at
  63. L<https://www.openssl.org/source/license.html>.
  64. =cut