2016-01-08 20:00:27 +01:00
|
|
|
// Copyright (c) 2016 The Chromium Embedded Framework Authors. All rights
|
2015-02-11 19:15:04 +01:00
|
|
|
// reserved. Use of this source code is governed by a BSD-style license that
|
|
|
|
// can be found in the LICENSE file.
|
|
|
|
//
|
|
|
|
// ---------------------------------------------------------------------------
|
|
|
|
//
|
|
|
|
// This file was generated by the CEF translator tool. If making changes by
|
|
|
|
// hand only do so within the body of existing method and function
|
|
|
|
// implementations. See the translator.README.txt file in the tools directory
|
|
|
|
// for more information.
|
|
|
|
//
|
|
|
|
|
2015-12-18 19:03:03 +01:00
|
|
|
#include <algorithm>
|
2015-02-11 19:15:04 +01:00
|
|
|
#include "libcef_dll/cpptoc/binary_value_cpptoc.h"
|
|
|
|
#include "libcef_dll/cpptoc/sslcert_principal_cpptoc.h"
|
|
|
|
#include "libcef_dll/cpptoc/sslinfo_cpptoc.h"
|
|
|
|
|
|
|
|
|
2015-04-26 20:40:01 +02:00
|
|
|
namespace {
|
|
|
|
|
2015-02-11 19:15:04 +01:00
|
|
|
// MEMBER FUNCTIONS - Body may be edited by hand.
|
|
|
|
|
2015-12-18 19:03:03 +01:00
|
|
|
cef_cert_status_t CEF_CALLBACK sslinfo_get_cert_status(
|
|
|
|
struct _cef_sslinfo_t* self) {
|
|
|
|
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
|
|
|
|
|
|
|
|
DCHECK(self);
|
|
|
|
if (!self)
|
|
|
|
return CERT_STATUS_NONE;
|
|
|
|
|
|
|
|
// Execute
|
|
|
|
cef_cert_status_t _retval = CefSSLInfoCppToC::Get(self)->GetCertStatus();
|
|
|
|
|
|
|
|
// Return type: simple
|
|
|
|
return _retval;
|
|
|
|
}
|
|
|
|
|
|
|
|
int CEF_CALLBACK sslinfo_is_cert_status_error(struct _cef_sslinfo_t* self) {
|
|
|
|
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
|
|
|
|
|
|
|
|
DCHECK(self);
|
|
|
|
if (!self)
|
|
|
|
return 0;
|
|
|
|
|
|
|
|
// Execute
|
|
|
|
bool _retval = CefSSLInfoCppToC::Get(self)->IsCertStatusError();
|
|
|
|
|
|
|
|
// Return type: bool
|
|
|
|
return _retval;
|
|
|
|
}
|
|
|
|
|
|
|
|
int CEF_CALLBACK sslinfo_is_cert_status_minor_error(
|
|
|
|
struct _cef_sslinfo_t* self) {
|
|
|
|
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
|
|
|
|
|
|
|
|
DCHECK(self);
|
|
|
|
if (!self)
|
|
|
|
return 0;
|
|
|
|
|
|
|
|
// Execute
|
|
|
|
bool _retval = CefSSLInfoCppToC::Get(self)->IsCertStatusMinorError();
|
|
|
|
|
|
|
|
// Return type: bool
|
|
|
|
return _retval;
|
|
|
|
}
|
|
|
|
|
2015-02-11 19:15:04 +01:00
|
|
|
cef_sslcert_principal_t* CEF_CALLBACK sslinfo_get_subject(
|
|
|
|
struct _cef_sslinfo_t* self) {
|
|
|
|
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
|
|
|
|
|
|
|
|
DCHECK(self);
|
|
|
|
if (!self)
|
|
|
|
return NULL;
|
|
|
|
|
|
|
|
// Execute
|
|
|
|
CefRefPtr<CefSSLCertPrincipal> _retval = CefSSLInfoCppToC::Get(
|
|
|
|
self)->GetSubject();
|
|
|
|
|
|
|
|
// Return type: refptr_same
|
|
|
|
return CefSSLCertPrincipalCppToC::Wrap(_retval);
|
|
|
|
}
|
|
|
|
|
|
|
|
cef_sslcert_principal_t* CEF_CALLBACK sslinfo_get_issuer(
|
|
|
|
struct _cef_sslinfo_t* self) {
|
|
|
|
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
|
|
|
|
|
|
|
|
DCHECK(self);
|
|
|
|
if (!self)
|
|
|
|
return NULL;
|
|
|
|
|
|
|
|
// Execute
|
|
|
|
CefRefPtr<CefSSLCertPrincipal> _retval = CefSSLInfoCppToC::Get(
|
|
|
|
self)->GetIssuer();
|
|
|
|
|
|
|
|
// Return type: refptr_same
|
|
|
|
return CefSSLCertPrincipalCppToC::Wrap(_retval);
|
|
|
|
}
|
|
|
|
|
|
|
|
struct _cef_binary_value_t* CEF_CALLBACK sslinfo_get_serial_number(
|
|
|
|
struct _cef_sslinfo_t* self) {
|
|
|
|
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
|
|
|
|
|
|
|
|
DCHECK(self);
|
|
|
|
if (!self)
|
|
|
|
return NULL;
|
|
|
|
|
|
|
|
// Execute
|
|
|
|
CefRefPtr<CefBinaryValue> _retval = CefSSLInfoCppToC::Get(
|
|
|
|
self)->GetSerialNumber();
|
|
|
|
|
|
|
|
// Return type: refptr_same
|
|
|
|
return CefBinaryValueCppToC::Wrap(_retval);
|
|
|
|
}
|
|
|
|
|
|
|
|
cef_time_t CEF_CALLBACK sslinfo_get_valid_start(struct _cef_sslinfo_t* self) {
|
|
|
|
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
|
|
|
|
|
|
|
|
DCHECK(self);
|
|
|
|
if (!self)
|
|
|
|
return CefTime();
|
|
|
|
|
|
|
|
// Execute
|
|
|
|
cef_time_t _retval = CefSSLInfoCppToC::Get(self)->GetValidStart();
|
|
|
|
|
|
|
|
// Return type: simple
|
|
|
|
return _retval;
|
|
|
|
}
|
|
|
|
|
|
|
|
cef_time_t CEF_CALLBACK sslinfo_get_valid_expiry(struct _cef_sslinfo_t* self) {
|
|
|
|
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
|
|
|
|
|
|
|
|
DCHECK(self);
|
|
|
|
if (!self)
|
|
|
|
return CefTime();
|
|
|
|
|
|
|
|
// Execute
|
|
|
|
cef_time_t _retval = CefSSLInfoCppToC::Get(self)->GetValidExpiry();
|
|
|
|
|
|
|
|
// Return type: simple
|
|
|
|
return _retval;
|
|
|
|
}
|
|
|
|
|
|
|
|
struct _cef_binary_value_t* CEF_CALLBACK sslinfo_get_derencoded(
|
|
|
|
struct _cef_sslinfo_t* self) {
|
|
|
|
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
|
|
|
|
|
|
|
|
DCHECK(self);
|
|
|
|
if (!self)
|
|
|
|
return NULL;
|
|
|
|
|
|
|
|
// Execute
|
|
|
|
CefRefPtr<CefBinaryValue> _retval = CefSSLInfoCppToC::Get(
|
|
|
|
self)->GetDEREncoded();
|
|
|
|
|
|
|
|
// Return type: refptr_same
|
|
|
|
return CefBinaryValueCppToC::Wrap(_retval);
|
|
|
|
}
|
|
|
|
|
|
|
|
struct _cef_binary_value_t* CEF_CALLBACK sslinfo_get_pemencoded(
|
|
|
|
struct _cef_sslinfo_t* self) {
|
|
|
|
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
|
|
|
|
|
|
|
|
DCHECK(self);
|
|
|
|
if (!self)
|
|
|
|
return NULL;
|
|
|
|
|
|
|
|
// Execute
|
|
|
|
CefRefPtr<CefBinaryValue> _retval = CefSSLInfoCppToC::Get(
|
|
|
|
self)->GetPEMEncoded();
|
|
|
|
|
|
|
|
// Return type: refptr_same
|
|
|
|
return CefBinaryValueCppToC::Wrap(_retval);
|
|
|
|
}
|
|
|
|
|
2015-12-18 19:03:03 +01:00
|
|
|
size_t CEF_CALLBACK sslinfo_get_issuer_chain_size(struct _cef_sslinfo_t* self) {
|
|
|
|
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
|
|
|
|
|
|
|
|
DCHECK(self);
|
|
|
|
if (!self)
|
|
|
|
return 0;
|
|
|
|
|
|
|
|
// Execute
|
|
|
|
size_t _retval = CefSSLInfoCppToC::Get(self)->GetIssuerChainSize();
|
|
|
|
|
|
|
|
// Return type: simple
|
|
|
|
return _retval;
|
|
|
|
}
|
|
|
|
|
|
|
|
void CEF_CALLBACK sslinfo_get_derencoded_issuer_chain(
|
|
|
|
struct _cef_sslinfo_t* self, size_t* chainCount,
|
|
|
|
struct _cef_binary_value_t** chain) {
|
|
|
|
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
|
|
|
|
|
|
|
|
DCHECK(self);
|
|
|
|
if (!self)
|
|
|
|
return;
|
|
|
|
// Verify param: chain; type: refptr_vec_same_byref
|
|
|
|
DCHECK(chainCount && (*chainCount == 0 || chain));
|
|
|
|
if (!chainCount || (*chainCount > 0 && !chain))
|
|
|
|
return;
|
|
|
|
|
|
|
|
// Translate param: chain; type: refptr_vec_same_byref
|
|
|
|
std::vector<CefRefPtr<CefBinaryValue> > chainList;
|
|
|
|
if (chainCount && *chainCount > 0 && chain) {
|
|
|
|
for (size_t i = 0; i < *chainCount; ++i) {
|
|
|
|
chainList.push_back(CefBinaryValueCppToC::Unwrap(chain[i]));
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
// Execute
|
|
|
|
CefSSLInfoCppToC::Get(self)->GetDEREncodedIssuerChain(
|
|
|
|
chainList);
|
|
|
|
|
|
|
|
// Restore param: chain; type: refptr_vec_same_byref
|
|
|
|
if (chainCount && chain) {
|
|
|
|
*chainCount = std::min(chainList.size(), *chainCount);
|
|
|
|
if (*chainCount > 0) {
|
|
|
|
for (size_t i = 0; i < *chainCount; ++i) {
|
|
|
|
chain[i] = CefBinaryValueCppToC::Wrap(chainList[i]);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
void CEF_CALLBACK sslinfo_get_pemencoded_issuer_chain(
|
|
|
|
struct _cef_sslinfo_t* self, size_t* chainCount,
|
|
|
|
struct _cef_binary_value_t** chain) {
|
|
|
|
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
|
|
|
|
|
|
|
|
DCHECK(self);
|
|
|
|
if (!self)
|
|
|
|
return;
|
|
|
|
// Verify param: chain; type: refptr_vec_same_byref
|
|
|
|
DCHECK(chainCount && (*chainCount == 0 || chain));
|
|
|
|
if (!chainCount || (*chainCount > 0 && !chain))
|
|
|
|
return;
|
|
|
|
|
|
|
|
// Translate param: chain; type: refptr_vec_same_byref
|
|
|
|
std::vector<CefRefPtr<CefBinaryValue> > chainList;
|
|
|
|
if (chainCount && *chainCount > 0 && chain) {
|
|
|
|
for (size_t i = 0; i < *chainCount; ++i) {
|
|
|
|
chainList.push_back(CefBinaryValueCppToC::Unwrap(chain[i]));
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
// Execute
|
|
|
|
CefSSLInfoCppToC::Get(self)->GetPEMEncodedIssuerChain(
|
|
|
|
chainList);
|
|
|
|
|
|
|
|
// Restore param: chain; type: refptr_vec_same_byref
|
|
|
|
if (chainCount && chain) {
|
|
|
|
*chainCount = std::min(chainList.size(), *chainCount);
|
|
|
|
if (*chainCount > 0) {
|
|
|
|
for (size_t i = 0; i < *chainCount; ++i) {
|
|
|
|
chain[i] = CefBinaryValueCppToC::Wrap(chainList[i]);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2015-04-26 20:40:01 +02:00
|
|
|
} // namespace
|
|
|
|
|
2015-02-11 19:15:04 +01:00
|
|
|
|
|
|
|
// CONSTRUCTOR - Do not edit by hand.
|
|
|
|
|
2015-04-26 20:40:01 +02:00
|
|
|
CefSSLInfoCppToC::CefSSLInfoCppToC() {
|
2015-12-18 19:03:03 +01:00
|
|
|
GetStruct()->get_cert_status = sslinfo_get_cert_status;
|
|
|
|
GetStruct()->is_cert_status_error = sslinfo_is_cert_status_error;
|
|
|
|
GetStruct()->is_cert_status_minor_error = sslinfo_is_cert_status_minor_error;
|
2015-04-26 20:40:01 +02:00
|
|
|
GetStruct()->get_subject = sslinfo_get_subject;
|
|
|
|
GetStruct()->get_issuer = sslinfo_get_issuer;
|
|
|
|
GetStruct()->get_serial_number = sslinfo_get_serial_number;
|
|
|
|
GetStruct()->get_valid_start = sslinfo_get_valid_start;
|
|
|
|
GetStruct()->get_valid_expiry = sslinfo_get_valid_expiry;
|
|
|
|
GetStruct()->get_derencoded = sslinfo_get_derencoded;
|
|
|
|
GetStruct()->get_pemencoded = sslinfo_get_pemencoded;
|
2015-12-18 19:03:03 +01:00
|
|
|
GetStruct()->get_issuer_chain_size = sslinfo_get_issuer_chain_size;
|
|
|
|
GetStruct()->get_derencoded_issuer_chain =
|
|
|
|
sslinfo_get_derencoded_issuer_chain;
|
|
|
|
GetStruct()->get_pemencoded_issuer_chain =
|
|
|
|
sslinfo_get_pemencoded_issuer_chain;
|
2015-04-26 20:40:01 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
template<> CefRefPtr<CefSSLInfo> CefCppToC<CefSSLInfoCppToC, CefSSLInfo,
|
|
|
|
cef_sslinfo_t>::UnwrapDerived(CefWrapperType type, cef_sslinfo_t* s) {
|
|
|
|
NOTREACHED() << "Unexpected class type: " << type;
|
|
|
|
return NULL;
|
2015-02-11 19:15:04 +01:00
|
|
|
}
|
|
|
|
|
2016-09-01 13:24:30 +02:00
|
|
|
#if DCHECK_IS_ON()
|
2015-02-11 19:15:04 +01:00
|
|
|
template<> base::AtomicRefCount CefCppToC<CefSSLInfoCppToC, CefSSLInfo,
|
|
|
|
cef_sslinfo_t>::DebugObjCt = 0;
|
|
|
|
#endif
|
|
|
|
|
2015-04-26 20:40:01 +02:00
|
|
|
template<> CefWrapperType CefCppToC<CefSSLInfoCppToC, CefSSLInfo,
|
|
|
|
cef_sslinfo_t>::kWrapperType = WT_SSLINFO;
|