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