From 8bbef2865455754425a84b86680a89bff8aa7691 Mon Sep 17 00:00:00 2001
From: gcontini <1121667+gcontini@users.noreply.github.com>
Date: 周六, 19 10月 2019 08:50:45 +0800
Subject: [PATCH] issue #64 , issue #56 (part)

---
 src/tools/base_lib/win/CryptoHelperWindows.h |   21 ++++++++++++++++++++-
 1 files changed, 20 insertions(+), 1 deletions(-)

diff --git a/src/tools/base_lib/win/CryptoHelperWindows.h b/src/tools/base_lib/win/CryptoHelperWindows.h
index 83ac21c..b4e7594 100644
--- a/src/tools/base_lib/win/CryptoHelperWindows.h
+++ b/src/tools/base_lib/win/CryptoHelperWindows.h
@@ -8,17 +8,36 @@
 #ifndef CRYPTOHELPERWINDOWS_H_
 #define CRYPTOHELPERWINDOWS_H_
 
-#define _WIN32_WINNT 0x0400
+//#define _WIN32_WINNT 0x0400
 #include <windows.h>
 #include <wincrypt.h>
 #include <tchar.h>
+#include <string>
 #include "../CryptoHelper.h"
 
+
+
 namespace license {
+using namespace std;
 
 class CryptoHelperWindows: public CryptoHelper {
+private :
+	void acquireContext();
+	//	Handle to the cryptography provider.
+	HCRYPTPROV m_hCryptProv;
+	//	Handle to the cryptography key.
+	HCRYPTKEY m_hCryptKey;
+	void printHash(HCRYPTHASH* hHash) const;
 public:
 	CryptoHelperWindows();
+
+	virtual void generateKeyPair();
+	virtual const string exportPrivateKey() const;
+	virtual const string exportPublicKey() const;
+
+	virtual const string signString(const void* privateKey, size_t pklen,
+			const string& license) const;
+
 	virtual ~CryptoHelperWindows();
 };
 

--
Gitblit v1.9.1