| 
									
										
										
										
											2016-04-28 14:37:24 +08:00
										 |  |  | =pod | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | =head1 NAME | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2020-09-24 17:42:23 +08:00
										 |  |  | CTLOG_new_ex, CTLOG_new, CTLOG_new_from_base64, | 
					
						
							|  |  |  | CTLOG_new_from_base64_ex, CTLOG_free, | 
					
						
							| 
									
										
										
										
											2016-08-04 18:28:04 +08:00
										 |  |  | CTLOG_get0_name, CTLOG_get0_log_id, CTLOG_get0_public_key - | 
					
						
							|  |  |  | encapsulates information about a Certificate Transparency log | 
					
						
							| 
									
										
										
										
											2016-04-28 14:37:24 +08:00
										 |  |  | 
 | 
					
						
							|  |  |  | =head1 SYNOPSIS | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |  #include <openssl/ct.h> | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2020-09-24 17:42:23 +08:00
										 |  |  |  CTLOG *CTLOG_new_ex(EVP_PKEY *public_key, const char *name, | 
					
						
							| 
									
										
										
										
											2020-10-15 17:55:50 +08:00
										 |  |  |                      OSSL_LIB_CTX *libctx, const char *propq); | 
					
						
							| 
									
										
										
										
											2016-04-28 14:37:24 +08:00
										 |  |  |  CTLOG *CTLOG_new(EVP_PKEY *public_key, const char *name); | 
					
						
							| 
									
										
										
										
											2020-04-08 00:37:39 +08:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2020-09-24 17:42:23 +08:00
										 |  |  |  int CTLOG_new_from_base64_ex(CTLOG **ct_log, const char *pkey_base64, | 
					
						
							| 
									
										
										
										
											2020-10-15 17:55:50 +08:00
										 |  |  |                               const char *name, OSSL_LIB_CTX *libctx, | 
					
						
							| 
									
										
										
										
											2020-09-24 17:42:23 +08:00
										 |  |  |                               const char *propq); | 
					
						
							| 
									
										
										
										
											2016-04-28 14:37:24 +08:00
										 |  |  |  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, | 
					
						
							| 
									
										
										
										
											2016-08-23 23:51:57 +08:00
										 |  |  |                         size_t *log_id_len); | 
					
						
							| 
									
										
										
										
											2016-04-28 14:37:24 +08:00
										 |  |  |  EVP_PKEY *CTLOG_get0_public_key(const CTLOG *log); | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | =head1 DESCRIPTION | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2020-09-24 17:42:23 +08:00
										 |  |  | CTLOG_new_ex() returns a new CTLOG that represents the Certificate | 
					
						
							| 
									
										
										
										
											2020-04-08 00:37:39 +08:00
										 |  |  | Transparency (CT) log with the given public key and associates it with the | 
					
						
							|  |  |  | library context I<libctx> and property query string I<propq>. A name must also | 
					
						
							|  |  |  | be provided that can be used to help users identify this log. Ownership of the | 
					
						
							|  |  |  | public key is transferred. | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2020-09-24 17:42:23 +08:00
										 |  |  | CTLOG_new() does the same thing as CTLOG_new_ex() but with the default | 
					
						
							| 
									
										
										
										
											2020-04-08 00:37:39 +08:00
										 |  |  | library context and the default property query string. | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2020-09-24 17:42:23 +08:00
										 |  |  | CTLOG_new_from_base64_ex() also creates a new CTLOG, but takes the | 
					
						
							| 
									
										
										
										
											2020-04-08 00:37:39 +08:00
										 |  |  | public key in base64-encoded DER form and sets the ct_log pointer to point to | 
					
						
							|  |  |  | the new CTLOG. The base64 will be decoded and the public key parsed. The CTLOG | 
					
						
							|  |  |  | will be associated with the given library context I<libctx> and property query | 
					
						
							|  |  |  | string I<propq>. | 
					
						
							| 
									
										
										
										
											2016-04-28 14:37:24 +08:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2020-04-08 00:37:39 +08:00
										 |  |  | CTLOG_new_from_base64() does the same thing as | 
					
						
							| 
									
										
										
										
											2020-09-24 17:42:23 +08:00
										 |  |  | CTLOG_new_from_base64_ex() except that the default library context and | 
					
						
							| 
									
										
										
										
											2020-04-08 00:37:39 +08:00
										 |  |  | property query string are used. | 
					
						
							| 
									
										
										
										
											2016-04-28 14:37:24 +08:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2016-08-23 23:51:57 +08:00
										 |  |  | Regardless of whether CTLOG_new() or CTLOG_new_from_base64() is used, it is the | 
					
						
							|  |  |  | caller's responsibility to pass the CTLOG to CTLOG_free() once it is no longer | 
					
						
							|  |  |  | needed. This will delete it and, if created by CTLOG_new(), the EVP_PKEY that | 
					
						
							|  |  |  | was passed to it. | 
					
						
							| 
									
										
										
										
											2016-04-28 14:37:24 +08:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2016-08-23 23:51:57 +08:00
										 |  |  | CTLOG_get0_name() returns the name of the log, as provided when the CTLOG was | 
					
						
							|  |  |  | created. Ownership of the string remains with the CTLOG. | 
					
						
							| 
									
										
										
										
											2016-04-28 14:37:24 +08:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2016-08-23 23:51:57 +08:00
										 |  |  | CTLOG_get0_log_id() sets *log_id to point to a string containing that log's | 
					
						
							|  |  |  | LogID (see RFC 6962). It 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). 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. | 
					
						
							| 
									
										
										
										
											2016-04-28 14:37:24 +08:00
										 |  |  | 
 | 
					
						
							|  |  |  | =head1 RETURN VALUES | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2016-08-23 23:51:57 +08:00
										 |  |  | CTLOG_new() will return NULL if an error occurs. | 
					
						
							| 
									
										
										
										
											2016-04-28 14:37:24 +08:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2016-08-23 23:51:57 +08:00
										 |  |  | CTLOG_new_from_base64() will return 1 on success, 0 otherwise. | 
					
						
							| 
									
										
										
										
											2016-04-28 14:37:24 +08:00
										 |  |  | 
 | 
					
						
							|  |  |  | =head1 SEE ALSO | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2016-11-11 16:33:09 +08:00
										 |  |  | L<ct(7)> | 
					
						
							| 
									
										
										
										
											2016-04-28 14:37:24 +08:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2016-08-04 23:42:42 +08:00
										 |  |  | =head1 HISTORY | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2020-09-24 17:56:03 +08:00
										 |  |  | The functions CTLOG_new_ex() and CTLOG_new_from_base64_ex() | 
					
						
							| 
									
										
										
										
											2020-04-08 00:37:39 +08:00
										 |  |  | were added in OpenSSL 3.0. All other functions were added in OpenSSL 1.1.0. | 
					
						
							| 
									
										
										
										
											2016-08-04 23:42:42 +08:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2016-04-28 14:37:24 +08:00
										 |  |  | =head1 COPYRIGHT | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2020-04-23 20:55:52 +08:00
										 |  |  | Copyright 2016-2020 The OpenSSL Project Authors. All Rights Reserved. | 
					
						
							| 
									
										
										
										
											2016-04-28 14:37:24 +08:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2018-12-06 21:04:44 +08:00
										 |  |  | Licensed under the Apache License 2.0 (the "License").  You may not use | 
					
						
							| 
									
										
										
										
											2016-04-28 14:37:24 +08:00
										 |  |  | this file except in compliance with the License.  You can obtain a copy | 
					
						
							|  |  |  | in the file LICENSE in the source distribution or at | 
					
						
							|  |  |  | L<https://www.openssl.org/source/license.html>. | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2016-08-04 18:29:23 +08:00
										 |  |  | =cut |