1 // Copyright (c) 2015 Marshall A. Greenblatt. All rights reserved.
3 // Redistribution and use in source and binary forms, with or without
4 // modification, are permitted provided that the following conditions are
7 // * Redistributions of source code must retain the above copyright
8 // notice, this list of conditions and the following disclaimer.
9 // * Redistributions in binary form must reproduce the above
10 // copyright notice, this list of conditions and the following disclaimer
11 // in the documentation and/or other materials provided with the
13 // * Neither the name of Google Inc. nor the name Chromium Embedded
14 // Framework nor the names of its contributors may be used to endorse
15 // or promote products derived from this software without specific prior
16 // written permission.
18 // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
19 // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
20 // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
21 // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
22 // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
23 // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
24 // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
25 // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
26 // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
27 // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
28 // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
30 // ---------------------------------------------------------------------------
32 // This file was generated by the CEF translator tool and should not edited
33 // by hand. See the translator.README.txt file in the tools directory for
37 #ifndef CEF_INCLUDE_CAPI_CEF_SSL_INFO_CAPI_H_
38 #define CEF_INCLUDE_CAPI_CEF_SSL_INFO_CAPI_H_
41 #include "include/capi/cef_base_capi.h"
42 #include "include/capi/cef_values_capi.h"
50 // Structure representing the issuer or subject field of an X.509 certificate.
52 typedef struct _cef_sslcert_principal_t {
59 // Returns a name that can be used to represent the issuer. It tries in this
60 // order: CN, O and OU and returns the first non-NULL one found.
62 // The resulting string must be freed by calling cef_string_userfree_free().
63 cef_string_userfree_t (CEF_CALLBACK *get_display_name)(
64 struct _cef_sslcert_principal_t* self);
67 // Returns the common name.
69 // The resulting string must be freed by calling cef_string_userfree_free().
70 cef_string_userfree_t (CEF_CALLBACK *get_common_name)(
71 struct _cef_sslcert_principal_t* self);
74 // Returns the locality name.
76 // The resulting string must be freed by calling cef_string_userfree_free().
77 cef_string_userfree_t (CEF_CALLBACK *get_locality_name)(
78 struct _cef_sslcert_principal_t* self);
81 // Returns the state or province name.
83 // The resulting string must be freed by calling cef_string_userfree_free().
84 cef_string_userfree_t (CEF_CALLBACK *get_state_or_province_name)(
85 struct _cef_sslcert_principal_t* self);
88 // Returns the country name.
90 // The resulting string must be freed by calling cef_string_userfree_free().
91 cef_string_userfree_t (CEF_CALLBACK *get_country_name)(
92 struct _cef_sslcert_principal_t* self);
95 // Retrieve the list of street addresses.
97 void (CEF_CALLBACK *get_street_addresses)(
98 struct _cef_sslcert_principal_t* self, cef_string_list_t addresses);
101 // Retrieve the list of organization names.
103 void (CEF_CALLBACK *get_organization_names)(
104 struct _cef_sslcert_principal_t* self, cef_string_list_t names);
107 // Retrieve the list of organization unit names.
109 void (CEF_CALLBACK *get_organization_unit_names)(
110 struct _cef_sslcert_principal_t* self, cef_string_list_t names);
113 // Retrieve the list of domain components.
115 void (CEF_CALLBACK *get_domain_components)(
116 struct _cef_sslcert_principal_t* self, cef_string_list_t components);
117 } cef_sslcert_principal_t;
121 // Structure representing SSL information.
123 typedef struct _cef_sslinfo_t {
130 // Returns the subject of the X.509 certificate. For HTTPS server certificates
131 // this represents the web server. The common name of the subject should
132 // match the host name of the web server.
134 struct _cef_sslcert_principal_t* (CEF_CALLBACK *get_subject)(
135 struct _cef_sslinfo_t* self);
138 // Returns the issuer of the X.509 certificate.
140 struct _cef_sslcert_principal_t* (CEF_CALLBACK *get_issuer)(
141 struct _cef_sslinfo_t* self);
144 // Returns the DER encoded serial number for the X.509 certificate. The value
145 // possibly includes a leading 00 byte.
147 struct _cef_binary_value_t* (CEF_CALLBACK *get_serial_number)(
148 struct _cef_sslinfo_t* self);
151 // Returns the date before which the X.509 certificate is invalid.
152 // CefTime.GetTimeT() will return 0 if no date was specified.
154 cef_time_t (CEF_CALLBACK *get_valid_start)(struct _cef_sslinfo_t* self);
157 // Returns the date after which the X.509 certificate is invalid.
158 // CefTime.GetTimeT() will return 0 if no date was specified.
160 cef_time_t (CEF_CALLBACK *get_valid_expiry)(struct _cef_sslinfo_t* self);
163 // Returns the DER encoded data for the X.509 certificate.
165 struct _cef_binary_value_t* (CEF_CALLBACK *get_derencoded)(
166 struct _cef_sslinfo_t* self);
169 // Returns the PEM encoded data for the X.509 certificate.
171 struct _cef_binary_value_t* (CEF_CALLBACK *get_pemencoded)(
172 struct _cef_sslinfo_t* self);
180 #endif // CEF_INCLUDE_CAPI_CEF_SSL_INFO_CAPI_H_