Пример #1
0
        private int on_select_client_certificate(cef_request_handler_t *self, cef_browser_t *browser, int isProxy, cef_string_t *host, int port, UIntPtr certificatesCount, cef_x509certificate_t **certificates, cef_select_client_certificate_callback_t *callback)
        {
            CheckSelf(self);

            var m_browser      = CefBrowser.FromNative(browser);
            var m_isProxy      = isProxy != 0;
            var m_host         = cef_string_t.ToString(host);
            var m_certCount    = checked ((int)certificatesCount);
            var m_certificates = new CefX509Certificate[m_certCount];

            for (var i = 0; i < m_certCount; i++)
            {
                m_certificates[i] = CefX509Certificate.FromNative(certificates[i]);
            }
            var m_callback = CefSelectClientCertificateCallback.FromNative(callback);

            var result = OnSelectClientCertificate(m_browser, m_isProxy, m_host, port, m_certificates, m_callback);

            if (result)
            {
                return(1);
            }
            else
            {
                m_callback.Dispose();
                return(0);
            }
        }
 /// <summary>
 /// Returns the X.509 certificate.
 /// </summary>
 public CefX509Certificate GetX509Certificate()
 {
     return(CefX509Certificate.FromNative(
                cef_sslinfo_t.get_x509certificate(_self)
                ));
 }
 /// <summary>
 /// Chooses the specified certificate for client certificate authentication.
 /// NULL value means that no client certificate should be used.
 /// </summary>
 public void Select(CefX509Certificate cert)
 {
     cef_select_client_certificate_callback_t.select(_self, cert != null ? cert.ToNative() : null);
 }