EasySSL is a Qt wrapper of the OpenSSL 3.0+ library that makes working with the asymmetric cryptography simple: RSA and ECDSA encryption and signing, key generation, self-signed X509 certificates and asynchronous authentication.
Complete reference of the EasySSL classes (RSASSL, ECDSASSL,
X509, AuthECDSA, ...), generated automatically with Doxygen.
EASYSSL_STATIC_SSL - link the static OpenSSL libraries into the EasySSL binaryBUILD_WITH_OPENSSL - build the OpenSSL 3.0+ library together with EasySSL (no system OpenSSL needed)EASYSSL_TESTS - enable or disable the unit testsCreate the RSA keys, encrypt and decrypt the data and check the signature:
#include <easyssl/rsassl.h>
#include <QByteArray>
int main() {
// create a public and private keys array.
EasySSL::RSASSL crypto;
QByteArray pub, priv;
crypto.makeKeys(pub, priv);
QByteArray message = "Hello EasySSL!";
auto signature = crypto.signMessage(message, priv);
crypto.checkSign(message, signature, pub);
auto encryptedMsg = crypto.encrypt(message, pub);
auto decryptedMsg = crypto.decrypt(encryptedMsg, priv);
}
Add the repository as a submodule and include it in your CMakeLists.txt.
To build without the system OpenSSL library, set the BUILD_WITH_OPENSSL option:
# add the repository of EasySSL into your repo like submodule git submodule add https://github.com/QuasarApp/easyssl.git git submodule update --init --recursive # CMakeLists.txt add_subdirectory(easyssl) target_link_libraries(yourLib PUBLIC easyssl) # build without the system OpenSSL 3.0+ library cmake .. -DBUILD_WITH_OPENSSL=1