Skip to content

Commit 6478e3c

Browse files
committed
added:x auth example for verification module
1 parent 0e2a476 commit 6478e3c

File tree

4 files changed

+293
-0
lines changed

4 files changed

+293
-0
lines changed
Lines changed: 71 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,71 @@
1+
#ifdef _MSC_BUILD
2+
#define _CRT_SECURE_NO_WARNINGS
3+
#include <Windows.h>
4+
#include <tchar.h>
5+
#endif
6+
#include <stdio.h>
7+
#include <stdlib.h>
8+
#include <string.h>
9+
#include <thread>
10+
using namespace std;
11+
#include <XEngine_Include/XEngine_CommHdr.h>
12+
#include <XEngine_Include/XEngine_BaseLib/BaseLib_Define.h>
13+
#include <XEngine_Include/XEngine_BaseLib/BaseLib_Error.h>
14+
#include "../../XEngine_Module/XEngine_Verification/Verification_Define.h"
15+
#include "../../XEngine_Module/XEngine_Verification/Verification_Error.h"
16+
17+
#ifdef _MSC_BUILD
18+
#pragma comment(lib,"XEngine_BaseLib/XEngine_BaseLib")
19+
#ifdef _DEBUG
20+
#ifdef _M_X64
21+
#pragma comment(lib,"../../x64/Debug/XEngine_Verification.lib")
22+
#elif _M_ARM64
23+
#pragma comment(lib,"../../ARM64/Debug/XEngine_Verification.lib")
24+
#elif _M_IX86
25+
#pragma comment(lib,"../../Debug/XEngine_Verification.lib")
26+
#endif
27+
#else
28+
#ifdef _M_X64
29+
#pragma comment(lib,"../../x64/Release/XEngine_Verification.lib")
30+
#elif _M_ARM64
31+
#pragma comment(lib,"../../ARM64/Release/XEngine_Verification.lib")
32+
#elif _M_IX86
33+
#pragma comment(lib,"../../Release/XEngine_Verification.lib")
34+
#endif
35+
#endif
36+
#endif
37+
38+
//Linux Macos::g++ -std=c++17 -Wall -g Verification_APPExample.cpp -o Verification_APPExample.exe -L ../../XEngine_Module/XEngine_Verification -lXEngine_Verification
39+
40+
41+
int main()
42+
{
43+
LPCXSTR lpszKeyPass = _X("123123aa");
44+
LPCXSTR lpszKeyFile = _X("D:\\XEngine_OPenSource\\Debug\\test.key");
45+
VERIFICATION_XAUTHKEY st_XAuthInfo = {};
46+
47+
sprintf(st_XAuthInfo.st_AuthUserInfo.tszUserName, _X("qyt"));
48+
sprintf(st_XAuthInfo.st_AuthUserInfo.tszUserContact, _X("[email protected]"));
49+
50+
Verification_XAuthKey_KeyInit(&st_XAuthInfo);
51+
Verification_XAuthKey_FileWrite(&st_XAuthInfo, lpszKeyFile, lpszKeyPass);
52+
53+
memset(&st_XAuthInfo, 0, sizeof(VERIFICATION_XAUTHKEY));
54+
Verification_XAuthKey_FileRead(&st_XAuthInfo, lpszKeyFile, lpszKeyPass);
55+
56+
Verification_XAuthKey_UserRegister(&st_XAuthInfo, st_XAuthInfo.st_AuthSerial.st_TimeLimit.tszTimeSerial);
57+
Verification_XAuthKey_WriteTime(&st_XAuthInfo);
58+
Verification_XAuthKey_WriteTime(&st_XAuthInfo);
59+
60+
int nListCount = 0;
61+
XCHAR** pptszTimeList;
62+
Verification_XAuthKey_ReadTime(&st_XAuthInfo, &pptszTimeList, &nListCount);
63+
for (int i = 0; i < nListCount; i++)
64+
{
65+
printf("%s\n", pptszTimeList[i]);
66+
}
67+
BaseLib_Memory_Free((XPPPMEM)&pptszTimeList, nListCount);
68+
69+
Verification_XAuthKey_FileWrite(&st_XAuthInfo, lpszKeyFile, lpszKeyPass);
70+
return 0;
71+
}
Lines changed: 196 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,196 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
3+
<ItemGroup Label="ProjectConfigurations">
4+
<ProjectConfiguration Include="Debug|ARM64">
5+
<Configuration>Debug</Configuration>
6+
<Platform>ARM64</Platform>
7+
</ProjectConfiguration>
8+
<ProjectConfiguration Include="Debug|Win32">
9+
<Configuration>Debug</Configuration>
10+
<Platform>Win32</Platform>
11+
</ProjectConfiguration>
12+
<ProjectConfiguration Include="Release|ARM64">
13+
<Configuration>Release</Configuration>
14+
<Platform>ARM64</Platform>
15+
</ProjectConfiguration>
16+
<ProjectConfiguration Include="Release|Win32">
17+
<Configuration>Release</Configuration>
18+
<Platform>Win32</Platform>
19+
</ProjectConfiguration>
20+
<ProjectConfiguration Include="Debug|x64">
21+
<Configuration>Debug</Configuration>
22+
<Platform>x64</Platform>
23+
</ProjectConfiguration>
24+
<ProjectConfiguration Include="Release|x64">
25+
<Configuration>Release</Configuration>
26+
<Platform>x64</Platform>
27+
</ProjectConfiguration>
28+
</ItemGroup>
29+
<PropertyGroup Label="Globals">
30+
<VCProjectVersion>17.0</VCProjectVersion>
31+
<Keyword>Win32Proj</Keyword>
32+
<ProjectGuid>{6dde9b0b-5dda-47b0-bf6f-adf47ec8568a}</ProjectGuid>
33+
<RootNamespace>VerificationAPPExample</RootNamespace>
34+
<WindowsTargetPlatformVersion>10.0</WindowsTargetPlatformVersion>
35+
</PropertyGroup>
36+
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
37+
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
38+
<ConfigurationType>Application</ConfigurationType>
39+
<UseDebugLibraries>true</UseDebugLibraries>
40+
<PlatformToolset>v143</PlatformToolset>
41+
<CharacterSet>Unicode</CharacterSet>
42+
</PropertyGroup>
43+
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
44+
<ConfigurationType>Application</ConfigurationType>
45+
<UseDebugLibraries>false</UseDebugLibraries>
46+
<PlatformToolset>v143</PlatformToolset>
47+
<WholeProgramOptimization>true</WholeProgramOptimization>
48+
<CharacterSet>Unicode</CharacterSet>
49+
</PropertyGroup>
50+
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
51+
<ConfigurationType>Application</ConfigurationType>
52+
<UseDebugLibraries>true</UseDebugLibraries>
53+
<PlatformToolset>v143</PlatformToolset>
54+
<CharacterSet>Unicode</CharacterSet>
55+
</PropertyGroup>
56+
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|ARM64'" Label="Configuration">
57+
<ConfigurationType>Application</ConfigurationType>
58+
<UseDebugLibraries>true</UseDebugLibraries>
59+
<PlatformToolset>v143</PlatformToolset>
60+
<CharacterSet>Unicode</CharacterSet>
61+
</PropertyGroup>
62+
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
63+
<ConfigurationType>Application</ConfigurationType>
64+
<UseDebugLibraries>false</UseDebugLibraries>
65+
<PlatformToolset>v143</PlatformToolset>
66+
<WholeProgramOptimization>true</WholeProgramOptimization>
67+
<CharacterSet>Unicode</CharacterSet>
68+
</PropertyGroup>
69+
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|ARM64'" Label="Configuration">
70+
<ConfigurationType>Application</ConfigurationType>
71+
<UseDebugLibraries>false</UseDebugLibraries>
72+
<PlatformToolset>v143</PlatformToolset>
73+
<WholeProgramOptimization>true</WholeProgramOptimization>
74+
<CharacterSet>Unicode</CharacterSet>
75+
</PropertyGroup>
76+
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
77+
<ImportGroup Label="ExtensionSettings">
78+
</ImportGroup>
79+
<ImportGroup Label="Shared">
80+
</ImportGroup>
81+
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
82+
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
83+
</ImportGroup>
84+
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
85+
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
86+
</ImportGroup>
87+
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
88+
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
89+
</ImportGroup>
90+
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|ARM64'" Label="PropertySheets">
91+
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
92+
</ImportGroup>
93+
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
94+
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
95+
</ImportGroup>
96+
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|ARM64'" Label="PropertySheets">
97+
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
98+
</ImportGroup>
99+
<PropertyGroup Label="UserMacros" />
100+
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
101+
<IncludePath>$(XEngine_Include);$(IncludePath)</IncludePath>
102+
<LibraryPath>$(XEngine_Lib32);$(LibraryPath)</LibraryPath>
103+
</PropertyGroup>
104+
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
105+
<LibraryPath>$(XEngine_Lib64);$(LibraryPath)</LibraryPath>
106+
<IncludePath>$(XEngine_Include);$(IncludePath)</IncludePath>
107+
</PropertyGroup>
108+
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|ARM64'">
109+
<LibraryPath>$(XEngine_LibArm64);$(LibraryPath)</LibraryPath>
110+
<IncludePath>$(XEngine_Include);$(IncludePath)</IncludePath>
111+
</PropertyGroup>
112+
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
113+
<ClCompile>
114+
<WarningLevel>Level3</WarningLevel>
115+
<SDLCheck>true</SDLCheck>
116+
<PreprocessorDefinitions>WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
117+
<ConformanceMode>true</ConformanceMode>
118+
</ClCompile>
119+
<Link>
120+
<SubSystem>Console</SubSystem>
121+
<GenerateDebugInformation>true</GenerateDebugInformation>
122+
</Link>
123+
</ItemDefinitionGroup>
124+
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
125+
<ClCompile>
126+
<WarningLevel>Level3</WarningLevel>
127+
<FunctionLevelLinking>true</FunctionLevelLinking>
128+
<IntrinsicFunctions>true</IntrinsicFunctions>
129+
<SDLCheck>true</SDLCheck>
130+
<PreprocessorDefinitions>WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
131+
<ConformanceMode>true</ConformanceMode>
132+
</ClCompile>
133+
<Link>
134+
<SubSystem>Console</SubSystem>
135+
<GenerateDebugInformation>true</GenerateDebugInformation>
136+
</Link>
137+
</ItemDefinitionGroup>
138+
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
139+
<ClCompile>
140+
<WarningLevel>Level3</WarningLevel>
141+
<SDLCheck>true</SDLCheck>
142+
<PreprocessorDefinitions>_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
143+
<ConformanceMode>true</ConformanceMode>
144+
</ClCompile>
145+
<Link>
146+
<SubSystem>Console</SubSystem>
147+
<GenerateDebugInformation>true</GenerateDebugInformation>
148+
</Link>
149+
</ItemDefinitionGroup>
150+
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|ARM64'">
151+
<ClCompile>
152+
<WarningLevel>Level3</WarningLevel>
153+
<SDLCheck>true</SDLCheck>
154+
<PreprocessorDefinitions>_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
155+
<ConformanceMode>true</ConformanceMode>
156+
</ClCompile>
157+
<Link>
158+
<SubSystem>Console</SubSystem>
159+
<GenerateDebugInformation>true</GenerateDebugInformation>
160+
</Link>
161+
</ItemDefinitionGroup>
162+
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
163+
<ClCompile>
164+
<WarningLevel>Level3</WarningLevel>
165+
<FunctionLevelLinking>true</FunctionLevelLinking>
166+
<IntrinsicFunctions>true</IntrinsicFunctions>
167+
<SDLCheck>true</SDLCheck>
168+
<PreprocessorDefinitions>NDEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
169+
<ConformanceMode>true</ConformanceMode>
170+
</ClCompile>
171+
<Link>
172+
<SubSystem>Console</SubSystem>
173+
<GenerateDebugInformation>true</GenerateDebugInformation>
174+
</Link>
175+
</ItemDefinitionGroup>
176+
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|ARM64'">
177+
<ClCompile>
178+
<WarningLevel>Level3</WarningLevel>
179+
<FunctionLevelLinking>true</FunctionLevelLinking>
180+
<IntrinsicFunctions>true</IntrinsicFunctions>
181+
<SDLCheck>true</SDLCheck>
182+
<PreprocessorDefinitions>NDEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
183+
<ConformanceMode>true</ConformanceMode>
184+
</ClCompile>
185+
<Link>
186+
<SubSystem>Console</SubSystem>
187+
<GenerateDebugInformation>true</GenerateDebugInformation>
188+
</Link>
189+
</ItemDefinitionGroup>
190+
<ItemGroup>
191+
<ClCompile Include="Verification_APPExample.cpp" />
192+
</ItemGroup>
193+
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
194+
<ImportGroup Label="ExtensionTargets">
195+
</ImportGroup>
196+
</Project>
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
3+
<ItemGroup>
4+
<Filter Include="源文件">
5+
<UniqueIdentifier>{4FC737F1-C7A5-4376-A066-2A32D752A2FF}</UniqueIdentifier>
6+
<Extensions>cpp;c;cc;cxx;c++;cppm;ixx;def;odl;idl;hpj;bat;asm;asmx</Extensions>
7+
</Filter>
8+
<Filter Include="头文件">
9+
<UniqueIdentifier>{93995380-89BD-4b04-88EB-625FBE52EBFB}</UniqueIdentifier>
10+
<Extensions>h;hh;hpp;hxx;h++;hm;inl;inc;ipp;xsd</Extensions>
11+
</Filter>
12+
<Filter Include="资源文件">
13+
<UniqueIdentifier>{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}</UniqueIdentifier>
14+
<Extensions>rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms</Extensions>
15+
</Filter>
16+
</ItemGroup>
17+
<ItemGroup>
18+
<ClCompile Include="Verification_APPExample.cpp">
19+
<Filter>源文件</Filter>
20+
</ClCompile>
21+
</ItemGroup>
22+
</Project>
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<Project ToolsVersion="Current" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
3+
<PropertyGroup />
4+
</Project>

0 commit comments

Comments
 (0)