CTLOG_NEW(3ossl)
π CTLOG_NEW(3ossl) β the CT log glow-up manual
okay so bestie, welcome to the 3ossl manual page for CTLOG_NEW and friends. this is the whole little family of functions that wrap up all the info about a Certificate Transparency (CT) log in one adorable object. let's get into it β¨
πΈ NAME
CTLOG_new_ex, CTLOG_new, CTLOG_new_from_base64, CTLOG_new_from_base64_ex, CTLOG_free, CTLOG_get0_name, CTLOG_get0_log_id, CTLOG_get0_public_key β all of these together encapsulate information about a Certificate Transparency log. that's the whole vibe: one struct, all the log lore π
π SYNOPSIS
#include <openssl/ct.h>
CTLOG *CTLOG_new_ex(EVP_PKEY *public_key, const char *name,
OSSL_LIB_CTX *libctx, const char *propq);
CTLOG *CTLOG_new(EVP_PKEY *public_key, const char *name);
int CTLOG_new_from_base64_ex(CTLOG **ct_log, const char *pkey_base64,
const char *name, OSSL_LIB_CTX *libctx,
const char *propq);
int CTLOG_new_from_base64(CTLOG ** ct_log,
const char *pkey_base64, const char *name);
void CTLOG_free(CTLOG *log);
const char *CTLOG_get0_name(const CTLOG *log);
void CTLOG_get0_log_id(const CTLOG *log, const uint8_t **log_id,
size_t *log_id_len);
EVP_PKEY *CTLOG_get0_public_key(const CTLOG *log);
like, look at that lineup. every one of them is serving π
π¦ DESCRIPTION
CTLOG_new_ex() returns a brand-new CTLOG that represents the Certificate Transparency (CT) log with the given public key, and associates it with the library context libctx and property query string propq. you also must hand it a name β that's the little label that helps users identify this log. and heads up: ownership of the public key is transferred. so like, it's the CTLOG's key now, not yours. no take-backsies π«Ά
CTLOG_new() is literally the same thing as CTLOG_new_ex() except it uses the default library context and the default property query string. the low-effort, default-vibes version. iconic.
CTLOG_new_from_base64_ex() also creates a new CTLOG, but this one takes the public key in base64-encoded DER form and sets the ct_log pointer to point at the new CTLOG. the base64 gets decoded and the public key gets parsed. the CTLOG gets associated with the given library context libctx and property query string propq. β¨
CTLOG_new_from_base64() does the same thing as CTLOG_new_from_base64_ex() except it just uses the default library context and property query string. same energy, fewer args.
no matter whether you used CTLOG_new() or CTLOG_new_from_base64(), it is the caller's responsibility to pass the CTLOG to CTLOG_free() once it's no longer needed. that deletes it β and, if it was created by CTLOG_new(), it also deletes the EVP_PKEY that was passed to it. if the argument to CTLOG_free() is NULL, nothing is done. no drama, no crash. we love a safe no-op π
CTLOG_get0_name() returns the name of the log, exactly as provided when the CTLOG was created. ownership of the string remains with the CTLOG β so don't you dare free it yourself, bestie π
CTLOG_get0_log_id() sets *log_id to point to a string containing that log's LogID (see RFC 6962). it also sets *log_id_len to the length of that LogID. for a v1 CT log, the LogID will be a SHA-256 hash (i.e. 32 bytes long β yes, exactly 32, bestie, count 'em). ownership of the string remains with the CTLOG π
CTLOG_get0_public_key() returns the public key of the CT log. ownership of the EVP_PKEY remains with the CTLOG. again: not yours to free. hands off π€
π₯ RETURN VALUES
CTLOG_new()will returnNULLif an error occurs. πCTLOG_new_from_base64()will return1on success,0otherwise.
that's it, that's the whole vibe check.
π SEE ALSO
ct(7)β go read it, iykyk π
β HISTORY
the functions CTLOG_new_ex() and CTLOG_new_from_base64_ex() were added in OpenSSL 3.0. all the other functions were added in OpenSSL 1.1.0. glow-up timeline fr fr π
π COPYRIGHT
Copyright 2016-2024 The OpenSSL Project Authors. All Rights Reserved.
Licensed under the Apache License 2.0 (the "License"). You may not use this file except in compliance with the License. You can obtain a copy in the file LICENSE in the source distribution or at <https://www.openssl.org/source/license.html>.
ok that's the legal bit, don't skip it, it's literally required π
<div align="center">β¨ okay that's the whole page β¨</div>
and yeah β this masterpiece is from OpenSSL 3.5.0, dated 2026-09-25, and it lives at page CTLOG_NEW(3ossl). mwah π go build something iconic with it π§ββοΈπ
π¦ where this page comes from
- opensuse-leap 16.0: openssl-3-doc 3.5.0-160000.11.1 Β· Apache-2.0
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms