SA-MP/saco/archive/KeyPair.h

31 lines
530 B
C
Raw Normal View History

2023-11-08 20:29:53 +08:00
#pragma once
#include <windows.h>
#include "CryptoContext.h"
class CKeyPair
{
private:
static DWORD ms_dwRSAKeySize;
2023-11-08 20:29:53 +08:00
HCRYPTKEY m_hCryptKey;
CCryptoContext* m_pContext;
public:
CKeyPair(CCryptoContext* pContext);
~CKeyPair(void);
2024-05-23 23:22:12 +08:00
#ifdef ARCTOOL
void GenerateKey();
void LoadFromFile(PCHAR szFileName);
void WriteToFile(PCHAR szFileName);
void WriteCHeaderFile(PCHAR szFileName);
#endif
2023-11-08 20:29:53 +08:00
void LoadFromMemory(DWORD dwPubKeySize, BYTE* pbPubKeyBlob, BYTE bytXORKey);
void ReleaseKey();
HCRYPTKEY GetContainer();
};