1*e71b7053SJung-uk Kim=pod 2*e71b7053SJung-uk Kim 3*e71b7053SJung-uk Kim=head1 NAME 4*e71b7053SJung-uk Kim 5*e71b7053SJung-uk KimCTLOG_new, CTLOG_new_from_base64, CTLOG_free, 6*e71b7053SJung-uk KimCTLOG_get0_name, CTLOG_get0_log_id, CTLOG_get0_public_key - 7*e71b7053SJung-uk Kimencapsulates information about a Certificate Transparency log 8*e71b7053SJung-uk Kim 9*e71b7053SJung-uk Kim=head1 SYNOPSIS 10*e71b7053SJung-uk Kim 11*e71b7053SJung-uk Kim #include <openssl/ct.h> 12*e71b7053SJung-uk Kim 13*e71b7053SJung-uk Kim CTLOG *CTLOG_new(EVP_PKEY *public_key, const char *name); 14*e71b7053SJung-uk Kim int CTLOG_new_from_base64(CTLOG ** ct_log, 15*e71b7053SJung-uk Kim const char *pkey_base64, const char *name); 16*e71b7053SJung-uk Kim void CTLOG_free(CTLOG *log); 17*e71b7053SJung-uk Kim const char *CTLOG_get0_name(const CTLOG *log); 18*e71b7053SJung-uk Kim void CTLOG_get0_log_id(const CTLOG *log, const uint8_t **log_id, 19*e71b7053SJung-uk Kim size_t *log_id_len); 20*e71b7053SJung-uk Kim EVP_PKEY *CTLOG_get0_public_key(const CTLOG *log); 21*e71b7053SJung-uk Kim 22*e71b7053SJung-uk Kim=head1 DESCRIPTION 23*e71b7053SJung-uk Kim 24*e71b7053SJung-uk KimCTLOG_new() returns a new CTLOG that represents the Certificate Transparency 25*e71b7053SJung-uk Kim(CT) log with the given public key. A name must also be provided that can be 26*e71b7053SJung-uk Kimused to help users identify this log. Ownership of the public key is 27*e71b7053SJung-uk Kimtransferred. 28*e71b7053SJung-uk Kim 29*e71b7053SJung-uk KimCTLOG_new_from_base64() also creates a new CTLOG, but takes the public key in 30*e71b7053SJung-uk Kimbase64-encoded DER form and sets the ct_log pointer to point to the new CTLOG. 31*e71b7053SJung-uk KimThe base64 will be decoded and the public key parsed. 32*e71b7053SJung-uk Kim 33*e71b7053SJung-uk KimRegardless of whether CTLOG_new() or CTLOG_new_from_base64() is used, it is the 34*e71b7053SJung-uk Kimcaller's responsibility to pass the CTLOG to CTLOG_free() once it is no longer 35*e71b7053SJung-uk Kimneeded. This will delete it and, if created by CTLOG_new(), the EVP_PKEY that 36*e71b7053SJung-uk Kimwas passed to it. 37*e71b7053SJung-uk Kim 38*e71b7053SJung-uk KimCTLOG_get0_name() returns the name of the log, as provided when the CTLOG was 39*e71b7053SJung-uk Kimcreated. Ownership of the string remains with the CTLOG. 40*e71b7053SJung-uk Kim 41*e71b7053SJung-uk KimCTLOG_get0_log_id() sets *log_id to point to a string containing that log's 42*e71b7053SJung-uk KimLogID (see RFC 6962). It sets *log_id_len to the length of that LogID. For a 43*e71b7053SJung-uk Kimv1 CT log, the LogID will be a SHA-256 hash (i.e. 32 bytes long). Ownership of 44*e71b7053SJung-uk Kimthe string remains with the CTLOG. 45*e71b7053SJung-uk Kim 46*e71b7053SJung-uk KimCTLOG_get0_public_key() returns the public key of the CT log. Ownership of the 47*e71b7053SJung-uk KimEVP_PKEY remains with the CTLOG. 48*e71b7053SJung-uk Kim 49*e71b7053SJung-uk Kim=head1 RETURN VALUES 50*e71b7053SJung-uk Kim 51*e71b7053SJung-uk KimCTLOG_new() will return NULL if an error occurs. 52*e71b7053SJung-uk Kim 53*e71b7053SJung-uk KimCTLOG_new_from_base64() will return 1 on success, 0 otherwise. 54*e71b7053SJung-uk Kim 55*e71b7053SJung-uk Kim=head1 SEE ALSO 56*e71b7053SJung-uk Kim 57*e71b7053SJung-uk KimL<ct(7)> 58*e71b7053SJung-uk Kim 59*e71b7053SJung-uk Kim=head1 HISTORY 60*e71b7053SJung-uk Kim 61*e71b7053SJung-uk KimThese functions were added in OpenSSL 1.1.0. 62*e71b7053SJung-uk Kim 63*e71b7053SJung-uk Kim=head1 COPYRIGHT 64*e71b7053SJung-uk Kim 65*e71b7053SJung-uk KimCopyright 2016 The OpenSSL Project Authors. All Rights Reserved. 66*e71b7053SJung-uk Kim 67*e71b7053SJung-uk KimLicensed under the OpenSSL license (the "License"). You may not use 68*e71b7053SJung-uk Kimthis file except in compliance with the License. You can obtain a copy 69*e71b7053SJung-uk Kimin the file LICENSE in the source distribution or at 70*e71b7053SJung-uk KimL<https://www.openssl.org/source/license.html>. 71*e71b7053SJung-uk Kim 72*e71b7053SJung-uk Kim=cut 73