From 4a66af481764b7662bde2613067beb472c24c3a4 Mon Sep 17 00:00:00 2001 From: Andrei Yankovich <EndrIIMail@gmail.com> Date: Fri, 14 Jul 2023 11:55:50 +0300 Subject: [PATCH 1/2] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index ce25c34..5862797 100644 --- a/README.md +++ b/README.md @@ -3,7 +3,7 @@ This is simple wrapper library that make using ssl simple. This library contains interfaces for the signing and encription data. ### Supported encription alhorithms: -* edsa based on sll 1.1 +* ecdsa based on sll 1.1 ### Supported features * encription From daa7705faa2764b42a23e8996a9dbceb1de8ff89 Mon Sep 17 00:00:00 2001 From: Andrei Yankovich <EndrIIMail@gmail.com> Date: Mon, 17 Jul 2023 23:50:17 +0300 Subject: [PATCH 2/2] Create CONTRIBUTING.md --- CONTRIBUTING.md | 78 +++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 78 insertions(+) create mode 100644 CONTRIBUTING.md diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md new file mode 100644 index 0000000..efc6609 --- /dev/null +++ b/CONTRIBUTING.md @@ -0,0 +1,78 @@ +# Contributing in to EeasySSL +This is a wrap library for the Qt developers. So if you think that is a good library, and you use it in your projects - you can add new improvements and create a pull request with new features. + +## What can you do for this Library ? +1. You can add a support of new encryption algorithms +2. You can implement new certificate generator. + +## Adding new implementation of crypto algorithms +All Algorithms must be pass simple test. Encrypt, decrypt short and long data arrays. This simple test already implemented, and you just need to add it into main test file. + +### Example +Adding supporting RSA algorithm to this library. + +1. Create implementation of the iCrypto interface. + ```cpp + + #include "icrypto.h" + + /** + * @brief The RSASSL class This is wrapper for RSA algorithm of openssl 3.0 libraryry. + */ + class EASYSSL_EXPORT RSASSL: public EasySSL::ICrypto { + + // override main methods of the interface. + EVP_PKEY *makeRawKeys() const override; + Features supportedFeatures() const override; + QSsl::KeyAlgorithm keyAlgorithm() const override; + QByteArray signMessage(const QByteArray &inputData, const QByteArray &key) const override; + bool checkSign(const QByteArray &inputData, const QByteArray &signature, const QByteArray &key) const override; + QByteArray decrypt(const QByteArray &message, const QByteArray &key) override; + QByteArray encrypt(const QByteArray &message, const QByteArray &key) override; + + } + ``` +Full implementation of the RSA you can see here. + +2. Add your class to the tests Using The Template class "[CryptoTest](https://github.com/QuasarApp/easyssl/blob/main/tests/units/cryptotest.h)". See The [tstMain.cpp](https://github.com/QuasarApp/easyssl/blob/main/tests/tstMain.cpp) file +``` cpp + TestCase(cryptoTestRSA, CryptoTest<EasySSL::RSASSL>) +``` + +## Adding new implementation of Certificate generator. + +1. Create implementation of the iCrypto interface. And override the create method. +```cpp + /** + * @brief The X509 class This is wrapper of the ssl objects. + */ + class EASYSSL_EXPORT X509: public ICertificate + { + public: + X509(const QSharedPointer<ICrypto>& generator); + + // ICertificate interface + public: + SelfSignedSertificate create(const SslSrtData& certificateData) const override; + }; +``` + +Full implementation of x509 certificate format you can see here. + +2. Add your class to the tests Using The Template class "[CrtTest]()". See The [tstMain.cpp](https://github.com/QuasarApp/easyssl/blob/main/tests/tstMain.cpp) file + +```cpp + #include "crttest.h" + + using CrtTestX509ECDSA = CrtTest<EasySSL::X509, EasySSL::ECDSASSL>; + TestCase(crtTestX509ECDSA, CrtTestX509ECDSA) + +``` + +## Extra rools +1. All shared tools or useful functions located on the EasySSLUtils class. +2. All implementation must contains goxygen xml comments (documentation) + + +# Thank you +