easyssl 0.50.142aaef
EasySSL is base back end library for your c++ Qt projects.
icrypto.cpp
Go to the documentation of this file.
1/*
2 * Copyright (C) 2021-2025 QuasarApp.
3 * Distributed under the GPLv3 software license, see the accompanying
4 * Everyone is permitted to copy and distribute verbatim copies
5 * of this license document, but changing it is not allowed.
6*/
7
8#include "icrypto.h"
9
10#include <easysslutils.h>
11#include <openssl/bio.h>
12#include <openssl/pem.h>
13
14namespace EasySSL {
15
16bool EasySSL::ICrypto::makeKeys(QByteArray &pubKey, QByteArray &privKey) const
17{
18 EVP_PKEY *keys = static_cast<EVP_PKEY *>(makeRawKeys());
19 if (!keys)
20 return false;
21
22 pubKey = EasySSLUtils::extractPublcKey(keys);
23 privKey = EasySSLUtils::extractPrivateKey(keys);
24 return true;
25}
26
27
28}
static QByteArray extractPublcKey(EVP_PKEY *ssl_keys)
extractPublcKey This method extracts the public key from the ssl (pem) structure.
static QByteArray extractPrivateKey(EVP_PKEY *ssl_keys)
extractPrivateKey This method extracts the private key from the ssl (pem) structure.
bool makeKeys(QByteArray &pubKey, QByteArray &privKey) const
makeKeys This method generate the public and private keys of the ECDSA.
Definition icrypto.cpp:16