miqt/qt/network/gen_qsslkey.cpp

154 lines
4.7 KiB
C++
Raw Normal View History

2024-11-04 22:53:04 +13:00
#include <QByteArray>
#include <QIODevice>
#include <QSslKey>
#include <qsslkey.h>
#include "gen_qsslkey.h"
#ifdef __cplusplus
extern "C" {
#endif
#ifdef __cplusplus
} /* extern C */
#endif
2024-11-04 22:53:04 +13:00
2024-12-07 17:15:57 +13:00
QSslKey* QSslKey_new() {
return new QSslKey();
2024-11-04 22:53:04 +13:00
}
2024-12-07 17:15:57 +13:00
QSslKey* QSslKey_new2(struct miqt_string encoded, int algorithm) {
2024-11-04 22:53:04 +13:00
QByteArray encoded_QByteArray(encoded.data, encoded.len);
2024-12-07 17:15:57 +13:00
return new QSslKey(encoded_QByteArray, static_cast<QSsl::KeyAlgorithm>(algorithm));
2024-11-04 22:53:04 +13:00
}
2024-12-07 17:15:57 +13:00
QSslKey* QSslKey_new3(QIODevice* device, int algorithm) {
return new QSslKey(device, static_cast<QSsl::KeyAlgorithm>(algorithm));
2024-11-04 22:53:04 +13:00
}
2024-12-07 17:15:57 +13:00
QSslKey* QSslKey_new4(void* handle) {
return new QSslKey(handle);
2024-11-04 22:53:04 +13:00
}
2024-12-07 17:15:57 +13:00
QSslKey* QSslKey_new5(QSslKey* other) {
return new QSslKey(*other);
2024-11-04 22:53:04 +13:00
}
2024-12-07 17:15:57 +13:00
QSslKey* QSslKey_new6(struct miqt_string encoded, int algorithm, int format) {
2024-11-04 22:53:04 +13:00
QByteArray encoded_QByteArray(encoded.data, encoded.len);
2024-12-07 17:15:57 +13:00
return new QSslKey(encoded_QByteArray, static_cast<QSsl::KeyAlgorithm>(algorithm), static_cast<QSsl::EncodingFormat>(format));
2024-11-04 22:53:04 +13:00
}
2025-02-01 13:45:16 +13:00
QSslKey* QSslKey_new7(struct miqt_string encoded, int algorithm, int format, int type) {
2024-11-04 22:53:04 +13:00
QByteArray encoded_QByteArray(encoded.data, encoded.len);
2025-02-01 13:45:16 +13:00
return new QSslKey(encoded_QByteArray, static_cast<QSsl::KeyAlgorithm>(algorithm), static_cast<QSsl::EncodingFormat>(format), static_cast<QSsl::KeyType>(type));
2024-11-04 22:53:04 +13:00
}
2025-02-01 13:45:16 +13:00
QSslKey* QSslKey_new8(struct miqt_string encoded, int algorithm, int format, int type, struct miqt_string passPhrase) {
2024-11-04 22:53:04 +13:00
QByteArray encoded_QByteArray(encoded.data, encoded.len);
QByteArray passPhrase_QByteArray(passPhrase.data, passPhrase.len);
2025-02-01 13:45:16 +13:00
return new QSslKey(encoded_QByteArray, static_cast<QSsl::KeyAlgorithm>(algorithm), static_cast<QSsl::EncodingFormat>(format), static_cast<QSsl::KeyType>(type), passPhrase_QByteArray);
2024-11-04 22:53:04 +13:00
}
2024-12-07 17:15:57 +13:00
QSslKey* QSslKey_new9(QIODevice* device, int algorithm, int format) {
return new QSslKey(device, static_cast<QSsl::KeyAlgorithm>(algorithm), static_cast<QSsl::EncodingFormat>(format));
2024-11-04 22:53:04 +13:00
}
2025-02-01 13:45:16 +13:00
QSslKey* QSslKey_new10(QIODevice* device, int algorithm, int format, int type) {
return new QSslKey(device, static_cast<QSsl::KeyAlgorithm>(algorithm), static_cast<QSsl::EncodingFormat>(format), static_cast<QSsl::KeyType>(type));
2024-11-04 22:53:04 +13:00
}
2025-02-01 13:45:16 +13:00
QSslKey* QSslKey_new11(QIODevice* device, int algorithm, int format, int type, struct miqt_string passPhrase) {
2024-11-04 22:53:04 +13:00
QByteArray passPhrase_QByteArray(passPhrase.data, passPhrase.len);
2025-02-01 13:45:16 +13:00
return new QSslKey(device, static_cast<QSsl::KeyAlgorithm>(algorithm), static_cast<QSsl::EncodingFormat>(format), static_cast<QSsl::KeyType>(type), passPhrase_QByteArray);
2024-11-04 22:53:04 +13:00
}
2025-02-01 13:45:16 +13:00
QSslKey* QSslKey_new12(void* handle, int type) {
return new QSslKey(handle, static_cast<QSsl::KeyType>(type));
2024-11-04 22:53:04 +13:00
}
2025-02-01 13:45:16 +13:00
void QSslKey_operatorAssign(QSslKey* self, QSslKey* other) {
2024-11-04 22:53:04 +13:00
self->operator=(*other);
}
2025-02-01 13:45:16 +13:00
void QSslKey_swap(QSslKey* self, QSslKey* other) {
2024-11-04 22:53:04 +13:00
self->swap(*other);
}
2025-02-01 13:45:16 +13:00
bool QSslKey_isNull(const QSslKey* self) {
2024-11-04 22:53:04 +13:00
return self->isNull();
}
2025-02-01 13:45:16 +13:00
void QSslKey_clear(QSslKey* self) {
2024-11-04 22:53:04 +13:00
self->clear();
}
2025-02-01 13:45:16 +13:00
int QSslKey_length(const QSslKey* self) {
2024-11-04 22:53:04 +13:00
return self->length();
}
2025-02-01 13:45:16 +13:00
int QSslKey_type(const QSslKey* self) {
2024-11-04 22:53:04 +13:00
QSsl::KeyType _ret = self->type();
return static_cast<int>(_ret);
}
2025-02-01 13:45:16 +13:00
int QSslKey_algorithm(const QSslKey* self) {
2024-11-04 22:53:04 +13:00
QSsl::KeyAlgorithm _ret = self->algorithm();
return static_cast<int>(_ret);
}
2025-02-01 13:45:16 +13:00
struct miqt_string QSslKey_toPem(const QSslKey* self) {
2024-11-04 22:53:04 +13:00
QByteArray _qb = self->toPem();
struct miqt_string _ms;
_ms.len = _qb.length();
_ms.data = static_cast<char*>(malloc(_ms.len));
memcpy(_ms.data, _qb.data(), _ms.len);
return _ms;
}
2025-02-01 13:45:16 +13:00
struct miqt_string QSslKey_toDer(const QSslKey* self) {
2024-11-04 22:53:04 +13:00
QByteArray _qb = self->toDer();
struct miqt_string _ms;
_ms.len = _qb.length();
_ms.data = static_cast<char*>(malloc(_ms.len));
memcpy(_ms.data, _qb.data(), _ms.len);
return _ms;
}
2025-02-01 13:45:16 +13:00
void* QSslKey_handle(const QSslKey* self) {
2024-11-04 22:53:04 +13:00
Qt::HANDLE _ret = self->handle();
return static_cast<void*>(_ret);
}
2025-02-01 13:45:16 +13:00
bool QSslKey_operatorEqual(const QSslKey* self, QSslKey* key) {
return (*self == *key);
2024-11-04 22:53:04 +13:00
}
2025-02-01 13:45:16 +13:00
bool QSslKey_operatorNotEqual(const QSslKey* self, QSslKey* key) {
return (*self != *key);
2024-11-04 22:53:04 +13:00
}
2025-02-01 13:45:16 +13:00
struct miqt_string QSslKey_toPem1(const QSslKey* self, struct miqt_string passPhrase) {
2024-11-04 22:53:04 +13:00
QByteArray passPhrase_QByteArray(passPhrase.data, passPhrase.len);
QByteArray _qb = self->toPem(passPhrase_QByteArray);
struct miqt_string _ms;
_ms.len = _qb.length();
_ms.data = static_cast<char*>(malloc(_ms.len));
memcpy(_ms.data, _qb.data(), _ms.len);
return _ms;
}
2025-02-01 13:45:16 +13:00
struct miqt_string QSslKey_toDer1(const QSslKey* self, struct miqt_string passPhrase) {
2024-11-04 22:53:04 +13:00
QByteArray passPhrase_QByteArray(passPhrase.data, passPhrase.len);
QByteArray _qb = self->toDer(passPhrase_QByteArray);
struct miqt_string _ms;
_ms.len = _qb.length();
_ms.data = static_cast<char*>(malloc(_ms.len));
memcpy(_ms.data, _qb.data(), _ms.len);
return _ms;
}
2025-02-01 13:45:16 +13:00
void QSslKey_delete(QSslKey* self) {
delete self;
2024-11-04 22:53:04 +13:00
}