2019-01-10 15:22:19 +01:00
|
|
|
// Copyright (c) 2019 The Chromium Embedded Framework Authors. All rights
|
2016-09-02 12:01:33 +02: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.
|
|
|
|
//
|
2019-01-23 17:10:23 +01:00
|
|
|
// $hash=7c3d2fdce89c468fc5d2baeabb43e0bb7b667574$
|
2017-05-17 11:29:28 +02:00
|
|
|
//
|
2016-09-02 12:01:33 +02:00
|
|
|
|
2017-05-19 11:06:00 +02:00
|
|
|
#include "libcef_dll/ctocpp/x509certificate_ctocpp.h"
|
2016-09-02 12:01:33 +02:00
|
|
|
#include <algorithm>
|
|
|
|
#include "libcef_dll/ctocpp/binary_value_ctocpp.h"
|
|
|
|
#include "libcef_dll/ctocpp/x509cert_principal_ctocpp.h"
|
2019-01-23 16:42:12 +01:00
|
|
|
#include "libcef_dll/shutdown_checker.h"
|
2016-09-02 12:01:33 +02:00
|
|
|
|
|
|
|
// VIRTUAL METHODS - Body may be edited by hand.
|
|
|
|
|
2018-07-12 19:55:56 +02:00
|
|
|
NO_SANITIZE("cfi-icall")
|
2016-09-02 12:01:33 +02:00
|
|
|
CefRefPtr<CefX509CertPrincipal> CefX509CertificateCToCpp::GetSubject() {
|
2019-01-23 16:42:12 +01:00
|
|
|
shutdown_checker::AssertNotShutdown();
|
|
|
|
|
2016-09-02 12:01:33 +02:00
|
|
|
cef_x509certificate_t* _struct = GetStruct();
|
|
|
|
if (CEF_MEMBER_MISSING(_struct, get_subject))
|
|
|
|
return NULL;
|
|
|
|
|
|
|
|
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
|
|
|
|
|
|
|
|
// Execute
|
|
|
|
cef_x509cert_principal_t* _retval = _struct->get_subject(_struct);
|
|
|
|
|
|
|
|
// Return type: refptr_same
|
|
|
|
return CefX509CertPrincipalCToCpp::Wrap(_retval);
|
|
|
|
}
|
|
|
|
|
2018-07-12 19:55:56 +02:00
|
|
|
NO_SANITIZE("cfi-icall")
|
2016-09-02 12:01:33 +02:00
|
|
|
CefRefPtr<CefX509CertPrincipal> CefX509CertificateCToCpp::GetIssuer() {
|
2019-01-23 16:42:12 +01:00
|
|
|
shutdown_checker::AssertNotShutdown();
|
|
|
|
|
2016-09-02 12:01:33 +02:00
|
|
|
cef_x509certificate_t* _struct = GetStruct();
|
|
|
|
if (CEF_MEMBER_MISSING(_struct, get_issuer))
|
|
|
|
return NULL;
|
|
|
|
|
|
|
|
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
|
|
|
|
|
|
|
|
// Execute
|
|
|
|
cef_x509cert_principal_t* _retval = _struct->get_issuer(_struct);
|
|
|
|
|
|
|
|
// Return type: refptr_same
|
|
|
|
return CefX509CertPrincipalCToCpp::Wrap(_retval);
|
|
|
|
}
|
|
|
|
|
2018-07-12 19:55:56 +02:00
|
|
|
NO_SANITIZE("cfi-icall")
|
2016-09-02 12:01:33 +02:00
|
|
|
CefRefPtr<CefBinaryValue> CefX509CertificateCToCpp::GetSerialNumber() {
|
2019-01-23 16:42:12 +01:00
|
|
|
shutdown_checker::AssertNotShutdown();
|
|
|
|
|
2016-09-02 12:01:33 +02:00
|
|
|
cef_x509certificate_t* _struct = GetStruct();
|
|
|
|
if (CEF_MEMBER_MISSING(_struct, get_serial_number))
|
|
|
|
return NULL;
|
|
|
|
|
|
|
|
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
|
|
|
|
|
|
|
|
// Execute
|
|
|
|
cef_binary_value_t* _retval = _struct->get_serial_number(_struct);
|
|
|
|
|
|
|
|
// Return type: refptr_same
|
|
|
|
return CefBinaryValueCToCpp::Wrap(_retval);
|
|
|
|
}
|
|
|
|
|
2018-07-12 19:55:56 +02:00
|
|
|
NO_SANITIZE("cfi-icall") CefTime CefX509CertificateCToCpp::GetValidStart() {
|
2019-01-23 16:42:12 +01:00
|
|
|
shutdown_checker::AssertNotShutdown();
|
|
|
|
|
2016-09-02 12:01:33 +02:00
|
|
|
cef_x509certificate_t* _struct = GetStruct();
|
|
|
|
if (CEF_MEMBER_MISSING(_struct, get_valid_start))
|
|
|
|
return CefTime();
|
|
|
|
|
|
|
|
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
|
|
|
|
|
|
|
|
// Execute
|
|
|
|
cef_time_t _retval = _struct->get_valid_start(_struct);
|
|
|
|
|
|
|
|
// Return type: simple
|
|
|
|
return _retval;
|
|
|
|
}
|
|
|
|
|
2018-07-12 19:55:56 +02:00
|
|
|
NO_SANITIZE("cfi-icall") CefTime CefX509CertificateCToCpp::GetValidExpiry() {
|
2019-01-23 16:42:12 +01:00
|
|
|
shutdown_checker::AssertNotShutdown();
|
|
|
|
|
2016-09-02 12:01:33 +02:00
|
|
|
cef_x509certificate_t* _struct = GetStruct();
|
|
|
|
if (CEF_MEMBER_MISSING(_struct, get_valid_expiry))
|
|
|
|
return CefTime();
|
|
|
|
|
|
|
|
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
|
|
|
|
|
|
|
|
// Execute
|
|
|
|
cef_time_t _retval = _struct->get_valid_expiry(_struct);
|
|
|
|
|
|
|
|
// Return type: simple
|
|
|
|
return _retval;
|
|
|
|
}
|
|
|
|
|
2018-07-12 19:55:56 +02:00
|
|
|
NO_SANITIZE("cfi-icall")
|
2016-09-02 12:01:33 +02:00
|
|
|
CefRefPtr<CefBinaryValue> CefX509CertificateCToCpp::GetDEREncoded() {
|
2019-01-23 16:42:12 +01:00
|
|
|
shutdown_checker::AssertNotShutdown();
|
|
|
|
|
2016-09-02 12:01:33 +02:00
|
|
|
cef_x509certificate_t* _struct = GetStruct();
|
|
|
|
if (CEF_MEMBER_MISSING(_struct, get_derencoded))
|
|
|
|
return NULL;
|
|
|
|
|
|
|
|
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
|
|
|
|
|
|
|
|
// Execute
|
|
|
|
cef_binary_value_t* _retval = _struct->get_derencoded(_struct);
|
|
|
|
|
|
|
|
// Return type: refptr_same
|
|
|
|
return CefBinaryValueCToCpp::Wrap(_retval);
|
|
|
|
}
|
|
|
|
|
2018-07-12 19:55:56 +02:00
|
|
|
NO_SANITIZE("cfi-icall")
|
2016-09-02 12:01:33 +02:00
|
|
|
CefRefPtr<CefBinaryValue> CefX509CertificateCToCpp::GetPEMEncoded() {
|
2019-01-23 16:42:12 +01:00
|
|
|
shutdown_checker::AssertNotShutdown();
|
|
|
|
|
2016-09-02 12:01:33 +02:00
|
|
|
cef_x509certificate_t* _struct = GetStruct();
|
|
|
|
if (CEF_MEMBER_MISSING(_struct, get_pemencoded))
|
|
|
|
return NULL;
|
|
|
|
|
|
|
|
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
|
|
|
|
|
|
|
|
// Execute
|
|
|
|
cef_binary_value_t* _retval = _struct->get_pemencoded(_struct);
|
|
|
|
|
|
|
|
// Return type: refptr_same
|
|
|
|
return CefBinaryValueCToCpp::Wrap(_retval);
|
|
|
|
}
|
|
|
|
|
2018-07-12 19:55:56 +02:00
|
|
|
NO_SANITIZE("cfi-icall") size_t CefX509CertificateCToCpp::GetIssuerChainSize() {
|
2019-01-23 16:42:12 +01:00
|
|
|
shutdown_checker::AssertNotShutdown();
|
|
|
|
|
2016-09-02 12:01:33 +02:00
|
|
|
cef_x509certificate_t* _struct = GetStruct();
|
|
|
|
if (CEF_MEMBER_MISSING(_struct, get_issuer_chain_size))
|
|
|
|
return 0;
|
|
|
|
|
|
|
|
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
|
|
|
|
|
|
|
|
// Execute
|
|
|
|
size_t _retval = _struct->get_issuer_chain_size(_struct);
|
|
|
|
|
|
|
|
// Return type: simple
|
|
|
|
return _retval;
|
|
|
|
}
|
|
|
|
|
2018-07-12 19:55:56 +02:00
|
|
|
NO_SANITIZE("cfi-icall")
|
2016-09-02 12:01:33 +02:00
|
|
|
void CefX509CertificateCToCpp::GetDEREncodedIssuerChain(
|
|
|
|
IssuerChainBinaryList& chain) {
|
2019-01-23 16:42:12 +01:00
|
|
|
shutdown_checker::AssertNotShutdown();
|
|
|
|
|
2016-09-02 12:01:33 +02:00
|
|
|
cef_x509certificate_t* _struct = GetStruct();
|
|
|
|
if (CEF_MEMBER_MISSING(_struct, get_derencoded_issuer_chain))
|
|
|
|
return;
|
|
|
|
|
|
|
|
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
|
|
|
|
|
|
|
|
// Translate param: chain; type: refptr_vec_same_byref
|
|
|
|
size_t chainSize = chain.size();
|
|
|
|
size_t chainCount = std::max(GetIssuerChainSize(), chainSize);
|
|
|
|
cef_binary_value_t** chainList = NULL;
|
|
|
|
if (chainCount > 0) {
|
|
|
|
chainList = new cef_binary_value_t*[chainCount];
|
|
|
|
DCHECK(chainList);
|
|
|
|
if (chainList) {
|
2017-05-17 11:29:28 +02:00
|
|
|
memset(chainList, 0, sizeof(cef_binary_value_t*) * chainCount);
|
2016-09-02 12:01:33 +02:00
|
|
|
}
|
|
|
|
if (chainList && chainSize > 0) {
|
|
|
|
for (size_t i = 0; i < chainSize; ++i) {
|
|
|
|
chainList[i] = CefBinaryValueCToCpp::Unwrap(chain[i]);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
// Execute
|
2017-05-17 11:29:28 +02:00
|
|
|
_struct->get_derencoded_issuer_chain(_struct, &chainCount, chainList);
|
2016-09-02 12:01:33 +02:00
|
|
|
|
|
|
|
// Restore param:chain; type: refptr_vec_same_byref
|
|
|
|
chain.clear();
|
|
|
|
if (chainCount > 0 && chainList) {
|
|
|
|
for (size_t i = 0; i < chainCount; ++i) {
|
|
|
|
chain.push_back(CefBinaryValueCToCpp::Wrap(chainList[i]));
|
|
|
|
}
|
2017-05-17 11:29:28 +02:00
|
|
|
delete[] chainList;
|
2016-09-02 12:01:33 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2018-07-12 19:55:56 +02:00
|
|
|
NO_SANITIZE("cfi-icall")
|
2016-09-02 12:01:33 +02:00
|
|
|
void CefX509CertificateCToCpp::GetPEMEncodedIssuerChain(
|
|
|
|
IssuerChainBinaryList& chain) {
|
2019-01-23 16:42:12 +01:00
|
|
|
shutdown_checker::AssertNotShutdown();
|
|
|
|
|
2016-09-02 12:01:33 +02:00
|
|
|
cef_x509certificate_t* _struct = GetStruct();
|
|
|
|
if (CEF_MEMBER_MISSING(_struct, get_pemencoded_issuer_chain))
|
|
|
|
return;
|
|
|
|
|
|
|
|
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
|
|
|
|
|
|
|
|
// Translate param: chain; type: refptr_vec_same_byref
|
|
|
|
size_t chainSize = chain.size();
|
|
|
|
size_t chainCount = std::max(GetIssuerChainSize(), chainSize);
|
|
|
|
cef_binary_value_t** chainList = NULL;
|
|
|
|
if (chainCount > 0) {
|
|
|
|
chainList = new cef_binary_value_t*[chainCount];
|
|
|
|
DCHECK(chainList);
|
|
|
|
if (chainList) {
|
2017-05-17 11:29:28 +02:00
|
|
|
memset(chainList, 0, sizeof(cef_binary_value_t*) * chainCount);
|
2016-09-02 12:01:33 +02:00
|
|
|
}
|
|
|
|
if (chainList && chainSize > 0) {
|
|
|
|
for (size_t i = 0; i < chainSize; ++i) {
|
|
|
|
chainList[i] = CefBinaryValueCToCpp::Unwrap(chain[i]);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
// Execute
|
2017-05-17 11:29:28 +02:00
|
|
|
_struct->get_pemencoded_issuer_chain(_struct, &chainCount, chainList);
|
2016-09-02 12:01:33 +02:00
|
|
|
|
|
|
|
// Restore param:chain; type: refptr_vec_same_byref
|
|
|
|
chain.clear();
|
|
|
|
if (chainCount > 0 && chainList) {
|
|
|
|
for (size_t i = 0; i < chainCount; ++i) {
|
|
|
|
chain.push_back(CefBinaryValueCToCpp::Wrap(chainList[i]));
|
|
|
|
}
|
2017-05-17 11:29:28 +02:00
|
|
|
delete[] chainList;
|
2016-09-02 12:01:33 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
// CONSTRUCTOR - Do not edit by hand.
|
|
|
|
|
2017-05-17 11:29:28 +02:00
|
|
|
CefX509CertificateCToCpp::CefX509CertificateCToCpp() {}
|
2016-09-02 12:01:33 +02:00
|
|
|
|
2019-01-23 16:42:12 +01:00
|
|
|
// DESTRUCTOR - Do not edit by hand.
|
|
|
|
|
|
|
|
CefX509CertificateCToCpp::~CefX509CertificateCToCpp() {
|
|
|
|
shutdown_checker::AssertNotShutdown();
|
|
|
|
}
|
|
|
|
|
2017-05-17 11:29:28 +02:00
|
|
|
template <>
|
|
|
|
cef_x509certificate_t* CefCToCppRefCounted<
|
|
|
|
CefX509CertificateCToCpp,
|
|
|
|
CefX509Certificate,
|
|
|
|
cef_x509certificate_t>::UnwrapDerived(CefWrapperType type,
|
|
|
|
CefX509Certificate* c) {
|
2016-09-02 12:01:33 +02:00
|
|
|
NOTREACHED() << "Unexpected class type: " << type;
|
|
|
|
return NULL;
|
|
|
|
}
|
|
|
|
|
2017-05-17 11:29:28 +02:00
|
|
|
template <>
|
|
|
|
CefWrapperType CefCToCppRefCounted<CefX509CertificateCToCpp,
|
|
|
|
CefX509Certificate,
|
|
|
|
cef_x509certificate_t>::kWrapperType =
|
2016-09-02 12:01:33 +02:00
|
|
|
WT_X509CERTIFICATE;
|