#ifndef QTOE_H #define QTOE_H #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include class QtOE : public QObject { Q_OBJECT public: explicit QtOE(QObject *parent = nullptr); RSA* createPrivateRSA(QString key, QString passphrase = ""); RSA* createPublicRSA(QString key); RSA* createPublicRSA(X509* cert); X509* createX509(QString cert); QString signMessage(RSA* privateKey, QString plainText); bool verifySignature(RSA* publicKey, QString plainText, QString signatureBase64); void printCertBio(X509* cert); private: bool RSASign( RSA* rsa, const unsigned char* Msg, size_t MsgLen, unsigned char** EncMsg, size_t* MsgLenEnc); bool RSAVerifySignature( RSA* rsa, unsigned char* MsgHash, size_t MsgHashLen, const char* Msg, size_t MsgLen, bool* Authentic); void Base64Encode( const unsigned char* buffer, size_t length, char** base64Text); size_t calcDecodeLength(const char* b64input); void Base64Decode(const char* b64message, unsigned char** buffer, size_t* length); static int pem_password_callback(char *buf, int max_len, int flag, void *ctx); signals: }; #endif // QTOE_H