mirror of
https://github.com/ErikasKontenis/SabrehavenServer.git
synced 2025-12-23 17:47:11 +01:00
first changes
This commit is contained in:
26
src/rsa.h
26
src/rsa.h
@@ -20,24 +20,24 @@
|
||||
#ifndef FS_RSA_H_C4E277DA8E884B578DDBF0566F504E91
|
||||
#define FS_RSA_H_C4E277DA8E884B578DDBF0566F504E91
|
||||
|
||||
#include <gmp.h>
|
||||
#include <cryptopp/rsa.h>
|
||||
|
||||
#include <string>
|
||||
|
||||
class RSA
|
||||
{
|
||||
public:
|
||||
RSA();
|
||||
~RSA();
|
||||
public:
|
||||
RSA() = default;
|
||||
|
||||
// non-copyable
|
||||
RSA(const RSA&) = delete;
|
||||
RSA& operator=(const RSA&) = delete;
|
||||
// non-copyable
|
||||
RSA(const RSA&) = delete;
|
||||
RSA& operator=(const RSA&) = delete;
|
||||
|
||||
void setKey(const char* pString, const char* qString);
|
||||
void decrypt(char* msg) const;
|
||||
void loadPEM(const std::string& filename);
|
||||
void decrypt(char* msg) const;
|
||||
|
||||
private:
|
||||
//use only GMP
|
||||
mpz_t n, d;
|
||||
private:
|
||||
CryptoPP::RSA::PrivateKey pk;
|
||||
};
|
||||
|
||||
#endif
|
||||
#endif
|
||||
Reference in New Issue
Block a user