Blame doc/man3/CTLOG_new.pod

Packit c4476c
=pod
Packit c4476c
Packit c4476c
=head1 NAME
Packit c4476c
Packit c4476c
CTLOG_new, CTLOG_new_from_base64, CTLOG_free,
Packit c4476c
CTLOG_get0_name, CTLOG_get0_log_id, CTLOG_get0_public_key -
Packit c4476c
encapsulates information about a Certificate Transparency log
Packit c4476c
Packit c4476c
=head1 SYNOPSIS
Packit c4476c
Packit c4476c
 #include <openssl/ct.h>
Packit c4476c
Packit c4476c
 CTLOG *CTLOG_new(EVP_PKEY *public_key, const char *name);
Packit c4476c
 int CTLOG_new_from_base64(CTLOG ** ct_log,
Packit c4476c
                           const char *pkey_base64, const char *name);
Packit c4476c
 void CTLOG_free(CTLOG *log);
Packit c4476c
 const char *CTLOG_get0_name(const CTLOG *log);
Packit c4476c
 void CTLOG_get0_log_id(const CTLOG *log, const uint8_t **log_id,
Packit c4476c
                        size_t *log_id_len);
Packit c4476c
 EVP_PKEY *CTLOG_get0_public_key(const CTLOG *log);
Packit c4476c
Packit c4476c
=head1 DESCRIPTION
Packit c4476c
Packit c4476c
CTLOG_new() returns a new CTLOG that represents the Certificate Transparency
Packit c4476c
(CT) log with the given public key. A name must also be provided that can be
Packit c4476c
used to help users identify this log. Ownership of the public key is
Packit c4476c
transferred.
Packit c4476c
Packit c4476c
CTLOG_new_from_base64() also creates a new CTLOG, but takes the public key in
Packit c4476c
base64-encoded DER form and sets the ct_log pointer to point to the new CTLOG.
Packit c4476c
The base64 will be decoded and the public key parsed.
Packit c4476c
Packit c4476c
Regardless of whether CTLOG_new() or CTLOG_new_from_base64() is used, it is the
Packit c4476c
caller's responsibility to pass the CTLOG to CTLOG_free() once it is no longer
Packit c4476c
needed. This will delete it and, if created by CTLOG_new(), the EVP_PKEY that
Packit c4476c
was passed to it.
Packit c4476c
Packit c4476c
CTLOG_get0_name() returns the name of the log, as provided when the CTLOG was
Packit c4476c
created. Ownership of the string remains with the CTLOG.
Packit c4476c
Packit c4476c
CTLOG_get0_log_id() sets *log_id to point to a string containing that log's
Packit c4476c
LogID (see RFC 6962). It sets *log_id_len to the length of that LogID. For a
Packit c4476c
v1 CT log, the LogID will be a SHA-256 hash (i.e. 32 bytes long). Ownership of
Packit c4476c
the string remains with the CTLOG.
Packit c4476c
Packit c4476c
CTLOG_get0_public_key() returns the public key of the CT log. Ownership of the
Packit c4476c
EVP_PKEY remains with the CTLOG.
Packit c4476c
Packit c4476c
=head1 RETURN VALUES
Packit c4476c
Packit c4476c
CTLOG_new() will return NULL if an error occurs.
Packit c4476c
Packit c4476c
CTLOG_new_from_base64() will return 1 on success, 0 otherwise.
Packit c4476c
Packit c4476c
=head1 SEE ALSO
Packit c4476c
Packit c4476c
L<ct(7)>
Packit c4476c
Packit c4476c
=head1 HISTORY
Packit c4476c
Packit c4476c
These functions were added in OpenSSL 1.1.0.
Packit c4476c
Packit c4476c
=head1 COPYRIGHT
Packit c4476c
Packit c4476c
Copyright 2016 The OpenSSL Project Authors. All Rights Reserved.
Packit c4476c
Packit c4476c
Licensed under the OpenSSL license (the "License").  You may not use
Packit c4476c
this file except in compliance with the License.  You can obtain a copy
Packit c4476c
in the file LICENSE in the source distribution or at
Packit c4476c
L<https://www.openssl.org/source/license.html>.
Packit c4476c
Packit c4476c
=cut