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