xref: /freebsd/crypto/openssl/doc/man3/CTLOG_new.pod (revision a7148ab39c03abd4d1a84997c70bf96f15dd2a09)
1e71b7053SJung-uk Kim=pod
2e71b7053SJung-uk Kim
3e71b7053SJung-uk Kim=head1 NAME
4e71b7053SJung-uk Kim
5b077aed3SPierre ProncheryCTLOG_new_ex, CTLOG_new, CTLOG_new_from_base64,
6b077aed3SPierre ProncheryCTLOG_new_from_base64_ex, CTLOG_free,
7e71b7053SJung-uk KimCTLOG_get0_name, CTLOG_get0_log_id, CTLOG_get0_public_key -
8e71b7053SJung-uk Kimencapsulates information about a Certificate Transparency log
9e71b7053SJung-uk Kim
10e71b7053SJung-uk Kim=head1 SYNOPSIS
11e71b7053SJung-uk Kim
12e71b7053SJung-uk Kim #include <openssl/ct.h>
13e71b7053SJung-uk Kim
14b077aed3SPierre Pronchery CTLOG *CTLOG_new_ex(EVP_PKEY *public_key, const char *name,
15b077aed3SPierre Pronchery                     OSSL_LIB_CTX *libctx, const char *propq);
16e71b7053SJung-uk Kim CTLOG *CTLOG_new(EVP_PKEY *public_key, const char *name);
17b077aed3SPierre Pronchery
18b077aed3SPierre Pronchery int CTLOG_new_from_base64_ex(CTLOG **ct_log, const char *pkey_base64,
19b077aed3SPierre Pronchery                              const char *name, OSSL_LIB_CTX *libctx,
20b077aed3SPierre Pronchery                              const char *propq);
21e71b7053SJung-uk Kim int CTLOG_new_from_base64(CTLOG ** ct_log,
22e71b7053SJung-uk Kim                           const char *pkey_base64, const char *name);
23e71b7053SJung-uk Kim void CTLOG_free(CTLOG *log);
24e71b7053SJung-uk Kim const char *CTLOG_get0_name(const CTLOG *log);
25e71b7053SJung-uk Kim void CTLOG_get0_log_id(const CTLOG *log, const uint8_t **log_id,
26e71b7053SJung-uk Kim                        size_t *log_id_len);
27e71b7053SJung-uk Kim EVP_PKEY *CTLOG_get0_public_key(const CTLOG *log);
28e71b7053SJung-uk Kim
29e71b7053SJung-uk Kim=head1 DESCRIPTION
30e71b7053SJung-uk Kim
31b077aed3SPierre ProncheryCTLOG_new_ex() returns a new CTLOG that represents the Certificate
32b077aed3SPierre ProncheryTransparency (CT) log with the given public key and associates it with the
33b077aed3SPierre Proncherylibrary context I<libctx> and property query string I<propq>. A name must also
34b077aed3SPierre Proncherybe provided that can be used to help users identify this log. Ownership of the
35b077aed3SPierre Proncherypublic key is transferred.
36e71b7053SJung-uk Kim
37b077aed3SPierre ProncheryCTLOG_new() does the same thing as CTLOG_new_ex() but with the default
38b077aed3SPierre Proncherylibrary context and the default property query string.
39b077aed3SPierre Pronchery
40b077aed3SPierre ProncheryCTLOG_new_from_base64_ex() also creates a new CTLOG, but takes the
41b077aed3SPierre Proncherypublic key in base64-encoded DER form and sets the ct_log pointer to point to
42b077aed3SPierre Proncherythe new CTLOG. The base64 will be decoded and the public key parsed. The CTLOG
43b077aed3SPierre Proncherywill be associated with the given library context I<libctx> and property query
44b077aed3SPierre Proncherystring I<propq>.
45b077aed3SPierre Pronchery
46b077aed3SPierre ProncheryCTLOG_new_from_base64() does the same thing as
47b077aed3SPierre ProncheryCTLOG_new_from_base64_ex() except that the default library context and
48b077aed3SPierre Proncheryproperty query string are used.
49e71b7053SJung-uk Kim
50e71b7053SJung-uk KimRegardless of whether CTLOG_new() or CTLOG_new_from_base64() is used, it is the
51e71b7053SJung-uk Kimcaller's responsibility to pass the CTLOG to CTLOG_free() once it is no longer
52e71b7053SJung-uk Kimneeded. This will delete it and, if created by CTLOG_new(), the EVP_PKEY that
53*a7148ab3SEnji Cooperwas passed to it. If the argument to CTLOG_free() is NULL, nothing is done.
54e71b7053SJung-uk Kim
55e71b7053SJung-uk KimCTLOG_get0_name() returns the name of the log, as provided when the CTLOG was
56e71b7053SJung-uk Kimcreated. Ownership of the string remains with the CTLOG.
57e71b7053SJung-uk Kim
58e71b7053SJung-uk KimCTLOG_get0_log_id() sets *log_id to point to a string containing that log's
59e71b7053SJung-uk KimLogID (see RFC 6962). It sets *log_id_len to the length of that LogID. For a
60e71b7053SJung-uk Kimv1 CT log, the LogID will be a SHA-256 hash (i.e. 32 bytes long). Ownership of
61e71b7053SJung-uk Kimthe string remains with the CTLOG.
62e71b7053SJung-uk Kim
63e71b7053SJung-uk KimCTLOG_get0_public_key() returns the public key of the CT log. Ownership of the
64e71b7053SJung-uk KimEVP_PKEY remains with the CTLOG.
65e71b7053SJung-uk Kim
66e71b7053SJung-uk Kim=head1 RETURN VALUES
67e71b7053SJung-uk Kim
68e71b7053SJung-uk KimCTLOG_new() will return NULL if an error occurs.
69e71b7053SJung-uk Kim
70e71b7053SJung-uk KimCTLOG_new_from_base64() will return 1 on success, 0 otherwise.
71e71b7053SJung-uk Kim
72e71b7053SJung-uk Kim=head1 SEE ALSO
73e71b7053SJung-uk Kim
74e71b7053SJung-uk KimL<ct(7)>
75e71b7053SJung-uk Kim
76e71b7053SJung-uk Kim=head1 HISTORY
77e71b7053SJung-uk Kim
78b077aed3SPierre ProncheryThe functions CTLOG_new_ex() and CTLOG_new_from_base64_ex()
79b077aed3SPierre Proncherywere added in OpenSSL 3.0. All other functions were added in OpenSSL 1.1.0.
80e71b7053SJung-uk Kim
81e71b7053SJung-uk Kim=head1 COPYRIGHT
82e71b7053SJung-uk Kim
83*a7148ab3SEnji CooperCopyright 2016-2024 The OpenSSL Project Authors. All Rights Reserved.
84e71b7053SJung-uk Kim
85b077aed3SPierre ProncheryLicensed under the Apache License 2.0 (the "License").  You may not use
86e71b7053SJung-uk Kimthis file except in compliance with the License.  You can obtain a copy
87e71b7053SJung-uk Kimin the file LICENSE in the source distribution or at
88e71b7053SJung-uk KimL<https://www.openssl.org/source/license.html>.
89e71b7053SJung-uk Kim
90e71b7053SJung-uk Kim=cut
91