2015-02-11 19:15:04 +01:00
|
|
|
// 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_info_impl.h"
|
2016-09-02 12:01:33 +02:00
|
|
|
#include "libcef/browser/x509_certificate_impl.h"
|
2015-02-11 19:15:04 +01:00
|
|
|
|
2015-12-18 19:03:03 +01:00
|
|
|
#include "net/cert/cert_status_flags.h"
|
|
|
|
|
|
|
|
CefSSLInfoImpl::CefSSLInfoImpl(const net::SSLInfo& value)
|
|
|
|
: cert_status_(CERT_STATUS_NONE) {
|
2016-09-02 12:01:33 +02:00
|
|
|
cert_status_ = static_cast<cef_cert_status_t>(value.cert_status);
|
2015-02-11 19:15:04 +01:00
|
|
|
if (value.cert.get()) {
|
2016-10-27 19:57:12 +02:00
|
|
|
cert_ = new CefX509CertificateImpl(value.cert);
|
2015-02-11 19:15:04 +01:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2015-12-18 19:03:03 +01:00
|
|
|
cef_cert_status_t CefSSLInfoImpl::GetCertStatus() {
|
2016-09-02 12:01:33 +02:00
|
|
|
return cert_status_;
|
2015-02-11 19:15:04 +01:00
|
|
|
}
|
2015-12-18 19:03:03 +01:00
|
|
|
|
2016-09-02 12:01:33 +02:00
|
|
|
CefRefPtr<CefX509Certificate> CefSSLInfoImpl::GetX509Certificate() {
|
|
|
|
return cert_;
|
2015-12-18 19:03:03 +01:00
|
|
|
}
|
|
|
|
|
2016-09-02 12:01:33 +02:00
|
|
|
bool CefIsCertStatusError(cef_cert_status_t status) {
|
|
|
|
return net::IsCertStatusError(status);
|
2015-12-18 19:03:03 +01:00
|
|
|
}
|
|
|
|
|
2016-09-02 12:01:33 +02:00
|
|
|
bool CefIsCertStatusMinorError(cef_cert_status_t status) {
|
|
|
|
return net::IsCertStatusMinorError(status);
|
2015-12-18 19:03:03 +01:00
|
|
|
}
|