mirror of
https://bitbucket.org/chromiumembedded/cef
synced 2025-06-05 21:39:12 +02:00
- Pass SSL certificate information to CefRequestHandler::OnCertificateError via a new CefSSLInfo interface (issue #1530).
- cefclient: Improve error message text and use a data: URI instead of LoadString for loading error messages (issue #579). - Add functions in cef_url.h for base64 and URI encoding/decoding (issue #579). git-svn-id: https://chromiumembedded.googlecode.com/svn/branches/2272@2029 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
This commit is contained in:
66
libcef/browser/ssl_cert_principal_impl.cc
Normal file
66
libcef/browser/ssl_cert_principal_impl.cc
Normal file
@ -0,0 +1,66 @@
|
||||
// Copyright (c) 2015 The Chromium Embedded Framework Authors. All rights
|
||||
// reserved. Use of this source code is governed by a BSD-style license that
|
||||
// can be found in the LICENSE file.
|
||||
|
||||
#include "libcef/browser/ssl_cert_principal_impl.h"
|
||||
|
||||
namespace {
|
||||
|
||||
void TransferVector(const std::vector<std::string>& source,
|
||||
std::vector<CefString>& target) {
|
||||
if (!target.empty())
|
||||
target.clear();
|
||||
|
||||
if (!source.empty()) {
|
||||
std::vector<std::string>::const_iterator it = source.begin();
|
||||
for (; it != source.end(); ++it)
|
||||
target.push_back(*it);
|
||||
}
|
||||
}
|
||||
|
||||
} // namespace
|
||||
|
||||
CefSSLCertPrincipalImpl::CefSSLCertPrincipalImpl(
|
||||
const net::CertPrincipal& value)
|
||||
: value_(value) {
|
||||
}
|
||||
|
||||
CefString CefSSLCertPrincipalImpl::GetDisplayName() {
|
||||
return value_.GetDisplayName();
|
||||
}
|
||||
|
||||
CefString CefSSLCertPrincipalImpl::GetCommonName() {
|
||||
return value_.common_name;
|
||||
}
|
||||
|
||||
CefString CefSSLCertPrincipalImpl::GetLocalityName() {
|
||||
return value_.locality_name;
|
||||
}
|
||||
|
||||
CefString CefSSLCertPrincipalImpl::GetStateOrProvinceName() {
|
||||
return value_.state_or_province_name;
|
||||
}
|
||||
|
||||
CefString CefSSLCertPrincipalImpl::GetCountryName() {
|
||||
return value_.country_name;
|
||||
}
|
||||
|
||||
void CefSSLCertPrincipalImpl::GetStreetAddresses(
|
||||
std::vector<CefString>& addresses) {
|
||||
TransferVector(value_.street_addresses, addresses);
|
||||
}
|
||||
|
||||
void CefSSLCertPrincipalImpl::GetOrganizationNames(
|
||||
std::vector<CefString>& names) {
|
||||
TransferVector(value_.organization_names, names);
|
||||
}
|
||||
|
||||
void CefSSLCertPrincipalImpl::GetOrganizationUnitNames(
|
||||
std::vector<CefString>& names) {
|
||||
TransferVector(value_.organization_unit_names, names);
|
||||
}
|
||||
|
||||
void CefSSLCertPrincipalImpl::GetDomainComponents(
|
||||
std::vector<CefString>& components) {
|
||||
TransferVector(value_.domain_components, components);
|
||||
}
|
Reference in New Issue
Block a user