easyssl 0.50.142aaef
EasySSL is base back end library for your c++ Qt projects.
Contributing in to EasySSL

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 pass simple test. Encrypt, decrypt short and long data arrays. This simple test is already implemented, and you just need to add it into the main test file.

Example

Adding supporting RSA algorithm to this library.

  1. Create implementation of the iCrypto interface.

    #include "icrypto.h"
    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;
    }
    The ICrypto class, This is base interface that provide encryption functionality.
    Definition icrypto.h:22
    virtual QSsl::KeyAlgorithm keyAlgorithm() const =0
    keyAlgorithm This method should be return Qt Key algorithm (needed for generate cetrificates....
    virtual void * makeRawKeys() const =0
    makeKeys This method generate the public and private keys of the ECDSA.
    virtual QByteArray signMessage(const QByteArray &message, const QByteArray &key) const =0
    signMessage This method should be sign the message using the key.
    virtual QByteArray encrypt(const QByteArray &message, const QByteArray &key)=0
    encrypt This method encrypt message using key.
    virtual QByteArray decrypt(const QByteArray &message, const QByteArray &key)=0
    decrypt This method decrypt message using key.
    virtual bool checkSign(const QByteArray &message, const QByteArray &signature, const QByteArray &key) const =0
    checkSign This method should be check signature of the message using the key.
    virtual Features supportedFeatures() const =0
    supportedFeatures This method should return supported featurs of the current encryption algorithm
    #define EASYSSL_EXPORT
    Definition global.h:18

Full implementation of the RSA you can see here.

  1. Add your class to the tests Using The Template class CryptoTest. See The tstMain.cpp file
TestCase(cryptoTestRSA, CryptoTest<EasySSL::RSASSL>)

Adding new implementation of Certificate generator.

  1. Create implementation of the iCrypto interface. And override the create method.
{
public:
X509(const QSharedPointer<ICrypto>& generator);
// ICertificate interface
public:
SelfSignedSertificate create(const SslSrtData& certificateData) const override;
};
The ICertificate class is base interface for all certificate generators classes.

Full implementation of x509 certificate format you can see here.

  1. Add your class to the tests Using The Template class CrtTest. See The tstMain.cpp file
#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 contain doxygen xml comments (documentation)
  3. All implementation must be inner EasySSL name space.

Thank you