2024-01-05 19:03:36 +01:00
|
|
|
// Copyright (c) 2024 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.
|
|
|
|
//
|
2024-01-05 19:03:36 +01:00
|
|
|
// $hash=1a50beef526a8f4e42a102b59e6caf9953b400d6$
|
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/cpptoc/x509certificate_cpptoc.h"
|
2016-09-02 12:01:33 +02:00
|
|
|
#include <algorithm>
|
|
|
|
#include "libcef_dll/cpptoc/binary_value_cpptoc.h"
|
|
|
|
#include "libcef_dll/cpptoc/x509cert_principal_cpptoc.h"
|
2019-01-23 16:42:12 +01:00
|
|
|
#include "libcef_dll/shutdown_checker.h"
|
2016-09-02 12:01:33 +02:00
|
|
|
|
|
|
|
namespace {
|
|
|
|
|
|
|
|
// MEMBER FUNCTIONS - Body may be edited by hand.
|
|
|
|
|
2017-05-17 11:29:28 +02:00
|
|
|
cef_x509cert_principal_t* CEF_CALLBACK
|
|
|
|
x509certificate_get_subject(struct _cef_x509certificate_t* self) {
|
2019-01-23 16:42:12 +01:00
|
|
|
shutdown_checker::AssertNotShutdown();
|
|
|
|
|
2016-09-02 12:01:33 +02:00
|
|
|
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
|
|
|
|
|
|
|
|
DCHECK(self);
|
2023-01-02 23:47:15 +01:00
|
|
|
if (!self) {
|
2016-09-02 12:01:33 +02:00
|
|
|
return NULL;
|
2023-01-02 23:47:15 +01:00
|
|
|
}
|
2016-09-02 12:01:33 +02:00
|
|
|
|
|
|
|
// Execute
|
2017-05-17 11:29:28 +02:00
|
|
|
CefRefPtr<CefX509CertPrincipal> _retval =
|
|
|
|
CefX509CertificateCppToC::Get(self)->GetSubject();
|
2016-09-02 12:01:33 +02:00
|
|
|
|
|
|
|
// Return type: refptr_same
|
|
|
|
return CefX509CertPrincipalCppToC::Wrap(_retval);
|
|
|
|
}
|
|
|
|
|
2017-05-17 11:29:28 +02:00
|
|
|
cef_x509cert_principal_t* CEF_CALLBACK
|
|
|
|
x509certificate_get_issuer(struct _cef_x509certificate_t* self) {
|
2019-01-23 16:42:12 +01:00
|
|
|
shutdown_checker::AssertNotShutdown();
|
|
|
|
|
2016-09-02 12:01:33 +02:00
|
|
|
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
|
|
|
|
|
|
|
|
DCHECK(self);
|
2023-01-02 23:47:15 +01:00
|
|
|
if (!self) {
|
2016-09-02 12:01:33 +02:00
|
|
|
return NULL;
|
2023-01-02 23:47:15 +01:00
|
|
|
}
|
2016-09-02 12:01:33 +02:00
|
|
|
|
|
|
|
// Execute
|
2017-05-17 11:29:28 +02:00
|
|
|
CefRefPtr<CefX509CertPrincipal> _retval =
|
|
|
|
CefX509CertificateCppToC::Get(self)->GetIssuer();
|
2016-09-02 12:01:33 +02:00
|
|
|
|
|
|
|
// Return type: refptr_same
|
|
|
|
return CefX509CertPrincipalCppToC::Wrap(_retval);
|
|
|
|
}
|
|
|
|
|
2017-05-17 11:29:28 +02:00
|
|
|
cef_binary_value_t* CEF_CALLBACK
|
|
|
|
x509certificate_get_serial_number(struct _cef_x509certificate_t* self) {
|
2019-01-23 16:42:12 +01:00
|
|
|
shutdown_checker::AssertNotShutdown();
|
|
|
|
|
2016-09-02 12:01:33 +02:00
|
|
|
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
|
|
|
|
|
|
|
|
DCHECK(self);
|
2023-01-02 23:47:15 +01:00
|
|
|
if (!self) {
|
2016-09-02 12:01:33 +02:00
|
|
|
return NULL;
|
2023-01-02 23:47:15 +01:00
|
|
|
}
|
2016-09-02 12:01:33 +02:00
|
|
|
|
|
|
|
// Execute
|
2017-05-17 11:29:28 +02:00
|
|
|
CefRefPtr<CefBinaryValue> _retval =
|
|
|
|
CefX509CertificateCppToC::Get(self)->GetSerialNumber();
|
2016-09-02 12:01:33 +02:00
|
|
|
|
|
|
|
// Return type: refptr_same
|
|
|
|
return CefBinaryValueCppToC::Wrap(_retval);
|
|
|
|
}
|
|
|
|
|
2022-05-31 22:28:43 +02:00
|
|
|
cef_basetime_t CEF_CALLBACK
|
2017-05-17 11:29:28 +02:00
|
|
|
x509certificate_get_valid_start(struct _cef_x509certificate_t* self) {
|
2019-01-23 16:42:12 +01:00
|
|
|
shutdown_checker::AssertNotShutdown();
|
|
|
|
|
2016-09-02 12:01:33 +02:00
|
|
|
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
|
|
|
|
|
|
|
|
DCHECK(self);
|
2023-01-02 23:47:15 +01:00
|
|
|
if (!self) {
|
2022-05-31 22:28:43 +02:00
|
|
|
return CefBaseTime();
|
2023-01-02 23:47:15 +01:00
|
|
|
}
|
2016-09-02 12:01:33 +02:00
|
|
|
|
|
|
|
// Execute
|
2022-05-31 22:28:43 +02:00
|
|
|
cef_basetime_t _retval = CefX509CertificateCppToC::Get(self)->GetValidStart();
|
2016-09-02 12:01:33 +02:00
|
|
|
|
|
|
|
// Return type: simple
|
|
|
|
return _retval;
|
|
|
|
}
|
|
|
|
|
2022-05-31 22:28:43 +02:00
|
|
|
cef_basetime_t CEF_CALLBACK
|
2017-05-17 11:29:28 +02:00
|
|
|
x509certificate_get_valid_expiry(struct _cef_x509certificate_t* self) {
|
2019-01-23 16:42:12 +01:00
|
|
|
shutdown_checker::AssertNotShutdown();
|
|
|
|
|
2016-09-02 12:01:33 +02:00
|
|
|
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
|
|
|
|
|
|
|
|
DCHECK(self);
|
2023-01-02 23:47:15 +01:00
|
|
|
if (!self) {
|
2022-05-31 22:28:43 +02:00
|
|
|
return CefBaseTime();
|
2023-01-02 23:47:15 +01:00
|
|
|
}
|
2016-09-02 12:01:33 +02:00
|
|
|
|
|
|
|
// Execute
|
2022-05-31 22:28:43 +02:00
|
|
|
cef_basetime_t _retval =
|
|
|
|
CefX509CertificateCppToC::Get(self)->GetValidExpiry();
|
2016-09-02 12:01:33 +02:00
|
|
|
|
|
|
|
// Return type: simple
|
|
|
|
return _retval;
|
|
|
|
}
|
|
|
|
|
2017-05-17 11:29:28 +02:00
|
|
|
cef_binary_value_t* CEF_CALLBACK
|
|
|
|
x509certificate_get_derencoded(struct _cef_x509certificate_t* self) {
|
2019-01-23 16:42:12 +01:00
|
|
|
shutdown_checker::AssertNotShutdown();
|
|
|
|
|
2016-09-02 12:01:33 +02:00
|
|
|
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
|
|
|
|
|
|
|
|
DCHECK(self);
|
2023-01-02 23:47:15 +01:00
|
|
|
if (!self) {
|
2016-09-02 12:01:33 +02:00
|
|
|
return NULL;
|
2023-01-02 23:47:15 +01:00
|
|
|
}
|
2016-09-02 12:01:33 +02:00
|
|
|
|
|
|
|
// Execute
|
2017-05-17 11:29:28 +02:00
|
|
|
CefRefPtr<CefBinaryValue> _retval =
|
|
|
|
CefX509CertificateCppToC::Get(self)->GetDEREncoded();
|
2016-09-02 12:01:33 +02:00
|
|
|
|
|
|
|
// Return type: refptr_same
|
|
|
|
return CefBinaryValueCppToC::Wrap(_retval);
|
|
|
|
}
|
|
|
|
|
2017-05-17 11:29:28 +02:00
|
|
|
cef_binary_value_t* CEF_CALLBACK
|
|
|
|
x509certificate_get_pemencoded(struct _cef_x509certificate_t* self) {
|
2019-01-23 16:42:12 +01:00
|
|
|
shutdown_checker::AssertNotShutdown();
|
|
|
|
|
2016-09-02 12:01:33 +02:00
|
|
|
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
|
|
|
|
|
|
|
|
DCHECK(self);
|
2023-01-02 23:47:15 +01:00
|
|
|
if (!self) {
|
2016-09-02 12:01:33 +02:00
|
|
|
return NULL;
|
2023-01-02 23:47:15 +01:00
|
|
|
}
|
2016-09-02 12:01:33 +02:00
|
|
|
|
|
|
|
// Execute
|
2017-05-17 11:29:28 +02:00
|
|
|
CefRefPtr<CefBinaryValue> _retval =
|
|
|
|
CefX509CertificateCppToC::Get(self)->GetPEMEncoded();
|
2016-09-02 12:01:33 +02:00
|
|
|
|
|
|
|
// Return type: refptr_same
|
|
|
|
return CefBinaryValueCppToC::Wrap(_retval);
|
|
|
|
}
|
|
|
|
|
2017-05-17 11:29:28 +02:00
|
|
|
size_t CEF_CALLBACK
|
|
|
|
x509certificate_get_issuer_chain_size(struct _cef_x509certificate_t* self) {
|
2019-01-23 16:42:12 +01:00
|
|
|
shutdown_checker::AssertNotShutdown();
|
|
|
|
|
2016-09-02 12:01:33 +02:00
|
|
|
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
|
|
|
|
|
|
|
|
DCHECK(self);
|
2023-01-02 23:47:15 +01:00
|
|
|
if (!self) {
|
2016-09-02 12:01:33 +02:00
|
|
|
return 0;
|
2023-01-02 23:47:15 +01:00
|
|
|
}
|
2016-09-02 12:01:33 +02:00
|
|
|
|
|
|
|
// Execute
|
|
|
|
size_t _retval = CefX509CertificateCppToC::Get(self)->GetIssuerChainSize();
|
|
|
|
|
|
|
|
// Return type: simple
|
|
|
|
return _retval;
|
|
|
|
}
|
|
|
|
|
2017-05-17 11:29:28 +02:00
|
|
|
void CEF_CALLBACK
|
|
|
|
x509certificate_get_derencoded_issuer_chain(struct _cef_x509certificate_t* self,
|
|
|
|
size_t* chainCount,
|
|
|
|
cef_binary_value_t** chain) {
|
2019-01-23 16:42:12 +01:00
|
|
|
shutdown_checker::AssertNotShutdown();
|
|
|
|
|
2016-09-02 12:01:33 +02:00
|
|
|
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
|
|
|
|
|
|
|
|
DCHECK(self);
|
2023-01-02 23:47:15 +01:00
|
|
|
if (!self) {
|
2016-09-02 12:01:33 +02:00
|
|
|
return;
|
2023-01-02 23:47:15 +01:00
|
|
|
}
|
2016-09-02 12:01:33 +02:00
|
|
|
// Verify param: chain; type: refptr_vec_same_byref
|
|
|
|
DCHECK(chainCount && (*chainCount == 0 || chain));
|
2023-01-02 23:47:15 +01:00
|
|
|
if (!chainCount || (*chainCount > 0 && !chain)) {
|
2016-09-02 12:01:33 +02:00
|
|
|
return;
|
2023-01-02 23:47:15 +01:00
|
|
|
}
|
2016-09-02 12:01:33 +02:00
|
|
|
|
|
|
|
// Translate param: chain; type: refptr_vec_same_byref
|
2017-05-17 11:29:28 +02:00
|
|
|
std::vector<CefRefPtr<CefBinaryValue>> chainList;
|
2016-09-02 12:01:33 +02:00
|
|
|
if (chainCount && *chainCount > 0 && chain) {
|
|
|
|
for (size_t i = 0; i < *chainCount; ++i) {
|
|
|
|
chainList.push_back(CefBinaryValueCppToC::Unwrap(chain[i]));
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
// Execute
|
2017-05-17 11:29:28 +02:00
|
|
|
CefX509CertificateCppToC::Get(self)->GetDEREncodedIssuerChain(chainList);
|
2016-09-02 12:01:33 +02:00
|
|
|
|
|
|
|
// 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]);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2017-05-17 11:29:28 +02:00
|
|
|
void CEF_CALLBACK
|
|
|
|
x509certificate_get_pemencoded_issuer_chain(struct _cef_x509certificate_t* self,
|
|
|
|
size_t* chainCount,
|
|
|
|
cef_binary_value_t** chain) {
|
2019-01-23 16:42:12 +01:00
|
|
|
shutdown_checker::AssertNotShutdown();
|
|
|
|
|
2016-09-02 12:01:33 +02:00
|
|
|
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
|
|
|
|
|
|
|
|
DCHECK(self);
|
2023-01-02 23:47:15 +01:00
|
|
|
if (!self) {
|
2016-09-02 12:01:33 +02:00
|
|
|
return;
|
2023-01-02 23:47:15 +01:00
|
|
|
}
|
2016-09-02 12:01:33 +02:00
|
|
|
// Verify param: chain; type: refptr_vec_same_byref
|
|
|
|
DCHECK(chainCount && (*chainCount == 0 || chain));
|
2023-01-02 23:47:15 +01:00
|
|
|
if (!chainCount || (*chainCount > 0 && !chain)) {
|
2016-09-02 12:01:33 +02:00
|
|
|
return;
|
2023-01-02 23:47:15 +01:00
|
|
|
}
|
2016-09-02 12:01:33 +02:00
|
|
|
|
|
|
|
// Translate param: chain; type: refptr_vec_same_byref
|
2017-05-17 11:29:28 +02:00
|
|
|
std::vector<CefRefPtr<CefBinaryValue>> chainList;
|
2016-09-02 12:01:33 +02:00
|
|
|
if (chainCount && *chainCount > 0 && chain) {
|
|
|
|
for (size_t i = 0; i < *chainCount; ++i) {
|
|
|
|
chainList.push_back(CefBinaryValueCppToC::Unwrap(chain[i]));
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
// Execute
|
2017-05-17 11:29:28 +02:00
|
|
|
CefX509CertificateCppToC::Get(self)->GetPEMEncodedIssuerChain(chainList);
|
2016-09-02 12:01:33 +02:00
|
|
|
|
|
|
|
// 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]);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
} // namespace
|
|
|
|
|
|
|
|
// CONSTRUCTOR - Do not edit by hand.
|
|
|
|
|
|
|
|
CefX509CertificateCppToC::CefX509CertificateCppToC() {
|
|
|
|
GetStruct()->get_subject = x509certificate_get_subject;
|
|
|
|
GetStruct()->get_issuer = x509certificate_get_issuer;
|
|
|
|
GetStruct()->get_serial_number = x509certificate_get_serial_number;
|
|
|
|
GetStruct()->get_valid_start = x509certificate_get_valid_start;
|
|
|
|
GetStruct()->get_valid_expiry = x509certificate_get_valid_expiry;
|
|
|
|
GetStruct()->get_derencoded = x509certificate_get_derencoded;
|
|
|
|
GetStruct()->get_pemencoded = x509certificate_get_pemencoded;
|
|
|
|
GetStruct()->get_issuer_chain_size = x509certificate_get_issuer_chain_size;
|
|
|
|
GetStruct()->get_derencoded_issuer_chain =
|
|
|
|
x509certificate_get_derencoded_issuer_chain;
|
|
|
|
GetStruct()->get_pemencoded_issuer_chain =
|
|
|
|
x509certificate_get_pemencoded_issuer_chain;
|
|
|
|
}
|
|
|
|
|
2019-01-23 16:42:12 +01:00
|
|
|
// DESTRUCTOR - Do not edit by hand.
|
|
|
|
|
|
|
|
CefX509CertificateCppToC::~CefX509CertificateCppToC() {
|
|
|
|
shutdown_checker::AssertNotShutdown();
|
|
|
|
}
|
|
|
|
|
2017-05-17 11:29:28 +02:00
|
|
|
template <>
|
|
|
|
CefRefPtr<CefX509Certificate> CefCppToCRefCounted<
|
|
|
|
CefX509CertificateCppToC,
|
|
|
|
CefX509Certificate,
|
|
|
|
cef_x509certificate_t>::UnwrapDerived(CefWrapperType type,
|
|
|
|
cef_x509certificate_t* s) {
|
2023-05-08 17:15:02 +02:00
|
|
|
DCHECK(false) << "Unexpected class type: " << type;
|
2020-01-15 14:53:19 +01:00
|
|
|
return nullptr;
|
2016-09-02 12:01:33 +02:00
|
|
|
}
|
|
|
|
|
2017-05-17 11:29:28 +02:00
|
|
|
template <>
|
|
|
|
CefWrapperType CefCppToCRefCounted<CefX509CertificateCppToC,
|
|
|
|
CefX509Certificate,
|
|
|
|
cef_x509certificate_t>::kWrapperType =
|
2016-09-02 12:01:33 +02:00
|
|
|
WT_X509CERTIFICATE;
|