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) +``` + +## 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& 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; + 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 +