Compare commits
10 Commits
0475d60409
...
b022c55a5a
| Author | SHA1 | Date | |
|---|---|---|---|
| b022c55a5a | |||
| 20958808d6 | |||
| 99e5397307 | |||
| 4c25200f80 | |||
| e60d499fa3 | |||
| 3f94a7b2b2 | |||
| 3626030124 | |||
| 4bfcf64720 | |||
| 40c509ba89 | |||
| 10b11e04e9 |
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@ -7,6 +7,11 @@
|
|||||||
"API": [
|
"API": [
|
||||||
{
|
{
|
||||||
"ApiName": "kms",
|
"ApiName": "kms",
|
||||||
|
"CertificateVerify": false,
|
||||||
|
//"CertPemPath": "D:\\00_Download\\[MDS인텔리전스] 시스템액스 인증서_2026027\\SystemX-SHM_cert.pem",
|
||||||
|
//"CertKeyPath": "D:\\00_Download\\[MDS인텔리전스] 시스템액스 인증서_2026027\\SystemX-SHM_cert.key",
|
||||||
|
"CertPemPath": "D:\\00_Download\\[MDS인텔리전스] 시스템액스 인증서_20260129\\SystemX-SHM_cert.pem",
|
||||||
|
"CertKeyPath": "D:\\00_Download\\[MDS인텔리전스] 시스템액스 인증서_20260129\\SystemX-SHM_cert.key",
|
||||||
"Functions": [
|
"Functions": [
|
||||||
{
|
{
|
||||||
"Name": "EcuID_SupplierEcuID",
|
"Name": "EcuID_SupplierEcuID",
|
||||||
|
|||||||
@ -9,7 +9,9 @@
|
|||||||
{
|
{
|
||||||
"Id": 1,
|
"Id": 1,
|
||||||
"ApiName": "CPMetaWbms",
|
"ApiName": "CPMetaWbms",
|
||||||
"Host": "192.168.0.126:9000"
|
//"Host": "10.188.172.194:9000"
|
||||||
|
"Host": "127.0.0.1:9000",
|
||||||
|
"LastCount": 30
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"Id": 2,
|
"Id": 2,
|
||||||
|
|||||||
Binary file not shown.
Binary file not shown.
@ -12,32 +12,70 @@ namespace CPMeta
|
|||||||
public class CPMeta
|
public class CPMeta
|
||||||
{
|
{
|
||||||
public static int Port { get; set; } = 9000;
|
public static int Port { get; set; } = 9000;
|
||||||
|
public static int TimeOut { get; set; } = 3000;
|
||||||
|
|
||||||
|
public CPMeta()
|
||||||
|
{
|
||||||
|
RestAPI.TimeOut = TimeOut;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static async Task<string> HealthCheck(string host)
|
||||||
|
{
|
||||||
|
Guid guid = Guid.NewGuid();
|
||||||
|
|
||||||
|
string url = $"https://{host}:{Port}/CPMeta/Health/health";
|
||||||
|
|
||||||
|
var res = await RestAPI.GetAsync<string>(url, guid);
|
||||||
|
|
||||||
|
Console.ForegroundColor = ConsoleColor.Blue;
|
||||||
|
Console.WriteLine($"Response: {res} (Trace Guid:{guid})");
|
||||||
|
Console.ForegroundColor = ConsoleColor.White;
|
||||||
|
return res;
|
||||||
|
}
|
||||||
|
|
||||||
public static async Task<Response_SetWbmsMeta> SetWbmsMetaAsync(string host, Request_SetWbmsMeta request)
|
public static async Task<Response_SetWbmsMeta> SetWbmsMetaAsync(string host, Request_SetWbmsMeta request)
|
||||||
{
|
{
|
||||||
string url = $"https://{host}:{Port}/CPMeta/SetWbmsMeta";
|
Guid guid = Guid.NewGuid();
|
||||||
|
|
||||||
Response_SetWbmsMeta res = await RestAPI.PostAsync<Request_SetWbmsMeta,Response_SetWbmsMeta>(url, request);
|
string url = $"https://{host}:{Port}/CPMeta/SetWbmsMeta";
|
||||||
|
|
||||||
|
Response_SetWbmsMeta res = await RestAPI.PostAsync<Request_SetWbmsMeta,Response_SetWbmsMeta>(url, request, guid);
|
||||||
|
|
||||||
|
Console.ForegroundColor = ConsoleColor.Blue;
|
||||||
|
Console.WriteLine($"Response: {JsonConvert.SerializeObject(res, Formatting.Indented)} (Trace Guid:{guid})");
|
||||||
|
Console.ForegroundColor = ConsoleColor.White;
|
||||||
return res;
|
return res;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static async Task<Response_GetWbmsMeta> GetWbmsMetaByProductId(string host, string productID, int shardID = 1)
|
public static async Task<Response_GetWbmsMeta> GetWbmsMetaByProductId(string host, string productID, int shardID = 1)
|
||||||
{
|
{
|
||||||
|
Guid guid = Guid.NewGuid();
|
||||||
|
|
||||||
string url = $"https://{host}:{Port}/CPMeta/GetWbmsMetaByProductID?";
|
string url = $"https://{host}:{Port}/CPMeta/GetWbmsMetaByProductID?";
|
||||||
url += $"ProductID={productID}&";
|
url += $"ProductID={productID}&";
|
||||||
url += $"ShardID={shardID}";
|
url += $"ShardID={shardID}";
|
||||||
|
|
||||||
Response_GetWbmsMeta res = await RestAPI.GetAsync<Response_GetWbmsMeta>(url);
|
Response_GetWbmsMeta res = await RestAPI.GetAsync<Response_GetWbmsMeta>(url, guid);
|
||||||
|
|
||||||
|
Console.ForegroundColor = ConsoleColor.Blue;
|
||||||
|
Console.WriteLine($"Response: {JsonConvert.SerializeObject(res, Formatting.Indented)} (Trace Guid: {guid})");
|
||||||
|
Console.ForegroundColor = ConsoleColor.White;
|
||||||
return res;
|
return res;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static async Task<Response_GetWbmsMeta> GetWbmsMetaByMacAddress(string host, string macAddress, int shardID = 1)
|
public static async Task<Response_GetWbmsMeta> GetWbmsMetaByMacAddress(string host, string macAddress, int shardID = 1)
|
||||||
{
|
{
|
||||||
|
Guid guid = Guid.NewGuid();
|
||||||
|
|
||||||
string url = $"https://{host}:{Port}/CPMeta/GetWbmsMetaByMacAddress?";
|
string url = $"https://{host}:{Port}/CPMeta/GetWbmsMetaByMacAddress?";
|
||||||
url += $"MacAddress={macAddress}&";
|
url += $"MacAddress={macAddress}&";
|
||||||
url += $"ShardID={shardID}";
|
url += $"ShardID={shardID}";
|
||||||
|
|
||||||
Response_GetWbmsMeta res = await RestAPI.GetAsync<Response_GetWbmsMeta>(url);
|
Response_GetWbmsMeta res = await RestAPI.GetAsync<Response_GetWbmsMeta>(url, guid);
|
||||||
|
|
||||||
|
Console.ForegroundColor = ConsoleColor.DarkYellow;
|
||||||
|
Console.WriteLine($"Response: {JsonConvert.SerializeObject(res, Formatting.Indented)} (Trace Guid: {guid})");
|
||||||
|
Console.ForegroundColor = ConsoleColor.White;
|
||||||
return res;
|
return res;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -4,61 +4,75 @@ using System.Collections.Generic;
|
|||||||
using System.Net;
|
using System.Net;
|
||||||
using System.Net.Http;
|
using System.Net.Http;
|
||||||
using System.Text;
|
using System.Text;
|
||||||
|
using System.Threading;
|
||||||
using System.Threading.Tasks;
|
using System.Threading.Tasks;
|
||||||
|
|
||||||
namespace CPMeta
|
namespace CPMeta
|
||||||
{
|
{
|
||||||
public class RestAPI
|
public class RestAPI
|
||||||
{
|
{
|
||||||
private static HttpClient RequestClient = new HttpClient();
|
private static readonly HttpClient RequestClient = new HttpClient();
|
||||||
private static HttpClient ResponseClient = new HttpClient();
|
private static readonly HttpClient ResponseClient = new HttpClient();
|
||||||
|
|
||||||
|
public static int TimeOut { get; set; } = 3000;
|
||||||
|
|
||||||
static RestAPI()
|
static RestAPI()
|
||||||
{
|
{
|
||||||
ServicePointManager.ServerCertificateValidationCallback += (sender, cert, chain, sslPolicyErrors) => true;
|
ServicePointManager.ServerCertificateValidationCallback += (sender, cert, chain, sslPolicyErrors) => true;
|
||||||
ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls12;
|
ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls12;
|
||||||
RequestClient.Timeout = TimeSpan.FromMilliseconds(10000);
|
|
||||||
ResponseClient.Timeout = TimeSpan.FromMilliseconds(10000);
|
RequestClient.Timeout = TimeSpan.FromMilliseconds(TimeOut);
|
||||||
|
ResponseClient.Timeout = TimeSpan.FromMilliseconds(TimeOut);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static async Task<RESPONSE> PostAsync<REQUEST,RESPONSE>(string Url, REQUEST body) where REQUEST : class where RESPONSE : class
|
public static async Task<RESPONSE> PostAsync<REQUEST,RESPONSE>(string Url, REQUEST body, Guid guid) where REQUEST : class where RESPONSE : class
|
||||||
{
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
if (body != null)
|
if (body != null)
|
||||||
{
|
{
|
||||||
|
string resContentStr = string.Empty;
|
||||||
|
Console.ForegroundColor = ConsoleColor.DarkYellow;
|
||||||
|
Console.WriteLine($"PostAsync:{Url},{JsonConvert.SerializeObject(body, Formatting.Indented)} (Trace Guid: {guid})");
|
||||||
|
Console.ForegroundColor = ConsoleColor.White;
|
||||||
|
|
||||||
var jsonBody = JsonConvert.SerializeObject(body);
|
var jsonBody = JsonConvert.SerializeObject(body);
|
||||||
var contents = new StringContent(jsonBody, Encoding.UTF8, "application/json");
|
var contents = new StringContent(jsonBody, Encoding.UTF8, "application/json");
|
||||||
|
|
||||||
var response = await RequestClient.PostAsync(Url, contents);
|
var response = await RequestClient.PostAsync(Url, contents);
|
||||||
|
resContentStr = await response.Content.ReadAsStringAsync();
|
||||||
var resContentStr = await response.Content.ReadAsStringAsync();
|
|
||||||
return JsonConvert.DeserializeObject<RESPONSE>(resContentStr);
|
return JsonConvert.DeserializeObject<RESPONSE>(resContentStr);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
catch (Exception e)
|
catch (Exception e)
|
||||||
{
|
{
|
||||||
Console.WriteLine("PostAsync Error");
|
Console.WriteLine($"TimeOut: {RequestClient.Timeout}");
|
||||||
Console.WriteLine(e.Message);
|
Console.WriteLine($"PostAsync Error:{e.Message}");
|
||||||
}
|
}
|
||||||
|
|
||||||
return default(RESPONSE);
|
return default(RESPONSE);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static async Task<RESPONSE> GetAsync<RESPONSE>(string Url)
|
public static async Task<RESPONSE> GetAsync<RESPONSE>(string Url, Guid guid)
|
||||||
{
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
var response = await ResponseClient.GetAsync(Url);
|
string resContentStr = string.Empty;
|
||||||
|
Console.ForegroundColor = ConsoleColor.DarkYellow;
|
||||||
|
Console.WriteLine($"GetAsync:{Url} (Trace Guid: {guid})");
|
||||||
|
Console.ForegroundColor = ConsoleColor.White;
|
||||||
|
|
||||||
var resContentStr = await response.Content.ReadAsStringAsync();
|
var response = await ResponseClient.GetAsync(Url);
|
||||||
|
resContentStr = await response.Content.ReadAsStringAsync();
|
||||||
|
|
||||||
return JsonConvert.DeserializeObject<RESPONSE>(resContentStr);
|
return JsonConvert.DeserializeObject<RESPONSE>(resContentStr);
|
||||||
|
|
||||||
}
|
}
|
||||||
catch(Exception e)
|
catch(Exception e)
|
||||||
{
|
{
|
||||||
Console.WriteLine("GetAsync Error");
|
Console.WriteLine($"TimeOut: {ResponseClient.Timeout}");
|
||||||
Console.WriteLine(e.Message);
|
Console.WriteLine($"GetAsync Error:{e.Message}");
|
||||||
}
|
}
|
||||||
|
|
||||||
return default(RESPONSE);
|
return default(RESPONSE);
|
||||||
|
|||||||
BIN
Projects/NetStandard/KeficoMailService.zip
Normal file
BIN
Projects/NetStandard/KeficoMailService.zip
Normal file
Binary file not shown.
14
Projects/NetStandard/KeficoMailService/Address.cs
Normal file
14
Projects/NetStandard/KeficoMailService/Address.cs
Normal file
@ -0,0 +1,14 @@
|
|||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Text;
|
||||||
|
using System.Threading.Tasks;
|
||||||
|
|
||||||
|
namespace KeficoMailService
|
||||||
|
{
|
||||||
|
public class Address
|
||||||
|
{
|
||||||
|
public string AddressMail { get; set; } = string.Empty;
|
||||||
|
public string AddressName { get; set; } = string.Empty;
|
||||||
|
}
|
||||||
|
}
|
||||||
14
Projects/NetStandard/KeficoMailService/HtmlFormType.cs
Normal file
14
Projects/NetStandard/KeficoMailService/HtmlFormType.cs
Normal file
@ -0,0 +1,14 @@
|
|||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Text;
|
||||||
|
using System.Threading.Tasks;
|
||||||
|
|
||||||
|
namespace KeficoMailService
|
||||||
|
{
|
||||||
|
public class HtmlFormType
|
||||||
|
{
|
||||||
|
public string FormType { get; set; } = string.Empty;
|
||||||
|
public string SystemName { get; set; } = string.Empty;
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -0,0 +1,51 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||||
|
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
|
||||||
|
<PropertyGroup>
|
||||||
|
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
|
||||||
|
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
|
||||||
|
<ProjectGuid>{63FF04EE-D1A5-4406-9267-1EE1E9FBB9E7}</ProjectGuid>
|
||||||
|
<OutputType>Library</OutputType>
|
||||||
|
<AppDesignerFolder>Properties</AppDesignerFolder>
|
||||||
|
<RootNamespace>KeficoMailService</RootNamespace>
|
||||||
|
<AssemblyName>KeficoMailService</AssemblyName>
|
||||||
|
<TargetFrameworkVersion>v4.8.1</TargetFrameworkVersion>
|
||||||
|
<FileAlignment>512</FileAlignment>
|
||||||
|
<Deterministic>true</Deterministic>
|
||||||
|
</PropertyGroup>
|
||||||
|
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
|
||||||
|
<DebugSymbols>true</DebugSymbols>
|
||||||
|
<DebugType>full</DebugType>
|
||||||
|
<Optimize>false</Optimize>
|
||||||
|
<OutputPath>bin\Debug\</OutputPath>
|
||||||
|
<DefineConstants>DEBUG;TRACE</DefineConstants>
|
||||||
|
<ErrorReport>prompt</ErrorReport>
|
||||||
|
<WarningLevel>4</WarningLevel>
|
||||||
|
</PropertyGroup>
|
||||||
|
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
|
||||||
|
<DebugType>pdbonly</DebugType>
|
||||||
|
<Optimize>true</Optimize>
|
||||||
|
<OutputPath>bin\Release\</OutputPath>
|
||||||
|
<DefineConstants>TRACE</DefineConstants>
|
||||||
|
<ErrorReport>prompt</ErrorReport>
|
||||||
|
<WarningLevel>4</WarningLevel>
|
||||||
|
</PropertyGroup>
|
||||||
|
<ItemGroup>
|
||||||
|
<Reference Include="System" />
|
||||||
|
<Reference Include="System.Core" />
|
||||||
|
<Reference Include="System.Xml.Linq" />
|
||||||
|
<Reference Include="System.Data.DataSetExtensions" />
|
||||||
|
<Reference Include="Microsoft.CSharp" />
|
||||||
|
<Reference Include="System.Data" />
|
||||||
|
<Reference Include="System.Net.Http" />
|
||||||
|
<Reference Include="System.Xml" />
|
||||||
|
</ItemGroup>
|
||||||
|
<ItemGroup>
|
||||||
|
<Compile Include="Address.cs" />
|
||||||
|
<Compile Include="HtmlFormType.cs" />
|
||||||
|
<Compile Include="MailType.cs" />
|
||||||
|
<Compile Include="Manager.cs" />
|
||||||
|
<Compile Include="Properties\AssemblyInfo.cs" />
|
||||||
|
</ItemGroup>
|
||||||
|
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
|
||||||
|
</Project>
|
||||||
14
Projects/NetStandard/KeficoMailService/MailType.cs
Normal file
14
Projects/NetStandard/KeficoMailService/MailType.cs
Normal file
@ -0,0 +1,14 @@
|
|||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Text;
|
||||||
|
using System.Threading.Tasks;
|
||||||
|
|
||||||
|
namespace KeficoMailService
|
||||||
|
{
|
||||||
|
public enum MailType
|
||||||
|
{
|
||||||
|
Text,
|
||||||
|
Html
|
||||||
|
}
|
||||||
|
}
|
||||||
163
Projects/NetStandard/KeficoMailService/Manager.cs
Normal file
163
Projects/NetStandard/KeficoMailService/Manager.cs
Normal file
@ -0,0 +1,163 @@
|
|||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.IO;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Net;
|
||||||
|
using System.Runtime.Remoting.Messaging;
|
||||||
|
using System.Text;
|
||||||
|
using System.Threading.Tasks;
|
||||||
|
using System.Xml.Linq;
|
||||||
|
|
||||||
|
namespace KeficoMailService
|
||||||
|
{
|
||||||
|
public class Manager
|
||||||
|
{
|
||||||
|
public string Host { get; set; } = "https://service.kefico.co.kr";
|
||||||
|
|
||||||
|
public readonly string GetFormHTML = "/KEFICO.XML/MAIL/MailManager.asmx";
|
||||||
|
public readonly string SendMailDetailHTML = "/KEFICO.XML/MAIL/MailManager.asmx";
|
||||||
|
|
||||||
|
public string GetFormHtml(HtmlFormType formType)
|
||||||
|
{
|
||||||
|
string result = string.Empty;
|
||||||
|
string url = $"{Host}{GetFormHTML}";
|
||||||
|
|
||||||
|
string soapEnvelope = $@"<?xml version=""1.0"" encoding=""utf-8""?>
|
||||||
|
<soap12:Envelope xmlns:xsi=""http://www.w3.org/2001/XMLSchema-instance""
|
||||||
|
xmlns:xsd=""http://www.w3.org/2001/XMLSchema""
|
||||||
|
xmlns:soap12=""http://www.w3.org/2003/05/soap-envelope"">
|
||||||
|
<soap12:Body>
|
||||||
|
<GetFormHTML xmlns=""http://kefico.co.kr/"">
|
||||||
|
<Type>
|
||||||
|
<SystemName>{formType.SystemName}</SystemName>
|
||||||
|
<FormType>{formType.FormType}</FormType>
|
||||||
|
</Type>
|
||||||
|
</GetFormHTML>
|
||||||
|
</soap12:Body>
|
||||||
|
</soap12:Envelope>";
|
||||||
|
|
||||||
|
Console.ForegroundColor = ConsoleColor.DarkYellow;
|
||||||
|
Console.WriteLine($"Request URL: {url}");
|
||||||
|
Console.WriteLine($"Request soap: {soapEnvelope}");
|
||||||
|
|
||||||
|
byte[] data = Encoding.UTF8.GetBytes(soapEnvelope);
|
||||||
|
|
||||||
|
HttpWebRequest request = (HttpWebRequest)WebRequest.Create(url);
|
||||||
|
request.Method = "POST";
|
||||||
|
request.ContentType = "application/soap+xml; charset=utf-8";
|
||||||
|
request.ContentLength = data.Length;
|
||||||
|
|
||||||
|
using (Stream stream = request.GetRequestStream())
|
||||||
|
{
|
||||||
|
stream.Write(data, 0, data.Length);
|
||||||
|
}
|
||||||
|
|
||||||
|
using (WebResponse response = request.GetResponse())
|
||||||
|
using (StreamReader reader = new StreamReader(response.GetResponseStream()))
|
||||||
|
{
|
||||||
|
result = reader.ReadToEnd();
|
||||||
|
|
||||||
|
//decode
|
||||||
|
XDocument doc = XDocument.Parse(result);
|
||||||
|
|
||||||
|
XNamespace ns = "http://kefico.co.kr/";
|
||||||
|
|
||||||
|
string htmlEncoded =
|
||||||
|
doc.Descendants(ns + "GetFormHTMLResult").First().Value;
|
||||||
|
|
||||||
|
// HTML Decode
|
||||||
|
|
||||||
|
result = WebUtility.HtmlDecode(htmlEncoded);
|
||||||
|
result = WebUtility.HtmlDecode(htmlEncoded);
|
||||||
|
|
||||||
|
Console.ForegroundColor = ConsoleColor.DarkGreen;
|
||||||
|
Console.WriteLine("");
|
||||||
|
Console.WriteLine("Response");
|
||||||
|
Console.WriteLine(result);
|
||||||
|
}
|
||||||
|
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
|
public string SendMailDetail(Address from, List<Address> to, List<Address> cc, List<Address> bcc, string subject, string body, MailType type)
|
||||||
|
{
|
||||||
|
string result = string.Empty;
|
||||||
|
string url = $"{Host}{SendMailDetailHTML}";
|
||||||
|
|
||||||
|
string soapEnvelope = $@"<?xml version=""1.0"" encoding=""utf-8""?>
|
||||||
|
<soap12:Envelope xmlns:xsi=""http://www.w3.org/2001/XMLSchema-instance"" xmlns:xsd=""http://www.w3.org/2001/XMLSchema"" xmlns:soap12=""http://www.w3.org/2003/05/soap-envelope"">
|
||||||
|
<soap12:Body>
|
||||||
|
<SendMailDetail xmlns=""http://kefico.co.kr/"">
|
||||||
|
<From>
|
||||||
|
<AddressMail>{from.AddressMail}</AddressMail>
|
||||||
|
<AddressName>{from.AddressName}</AddressName>
|
||||||
|
</From>
|
||||||
|
<To>{string.Join("",to.Select(x=> $@"
|
||||||
|
<Address>
|
||||||
|
<AddressMail>{x.AddressMail}</AddressMail>
|
||||||
|
<AddressName>{x.AddressName}</AddressName>
|
||||||
|
</Address>"))}
|
||||||
|
</To>
|
||||||
|
<CC>{string.Join("",cc.Select(x => $@"
|
||||||
|
<Address>
|
||||||
|
<AddressMail>{x.AddressMail}</AddressMail>
|
||||||
|
<AddressName>{x.AddressName}</AddressName>
|
||||||
|
</Address>"))}
|
||||||
|
</CC>
|
||||||
|
<Bcc>{string.Join("", bcc.Select(x => $@"
|
||||||
|
<Address>
|
||||||
|
<AddressMail>{x.AddressMail}</AddressMail>
|
||||||
|
<AddressName>{x.AddressName}</AddressName>
|
||||||
|
</Address>"))}
|
||||||
|
</Bcc>
|
||||||
|
<Title>{subject}</Title>
|
||||||
|
<Body>{body}</Body>
|
||||||
|
<Type>{type.ToString()}</Type>
|
||||||
|
</SendMailDetail>
|
||||||
|
</soap12:Body>
|
||||||
|
</soap12:Envelope>";
|
||||||
|
|
||||||
|
Console.ForegroundColor = ConsoleColor.DarkYellow;
|
||||||
|
Console.WriteLine("");
|
||||||
|
Console.WriteLine($"Request URL: {url}");
|
||||||
|
Console.WriteLine($"Request soap: {soapEnvelope}");
|
||||||
|
|
||||||
|
byte[] data = Encoding.UTF8.GetBytes(soapEnvelope);
|
||||||
|
|
||||||
|
HttpWebRequest request = (HttpWebRequest)WebRequest.Create(url);
|
||||||
|
request.Method = "POST";
|
||||||
|
request.ContentType = "application/soap+xml; charset=utf-8";
|
||||||
|
request.ContentLength = data.Length;
|
||||||
|
|
||||||
|
using (Stream stream = request.GetRequestStream())
|
||||||
|
{
|
||||||
|
stream.Write(data, 0, data.Length);
|
||||||
|
}
|
||||||
|
|
||||||
|
using (WebResponse response = request.GetResponse())
|
||||||
|
using (StreamReader reader = new StreamReader(response.GetResponseStream()))
|
||||||
|
{
|
||||||
|
result = reader.ReadToEnd();
|
||||||
|
|
||||||
|
//decode
|
||||||
|
XDocument doc = XDocument.Parse(result);
|
||||||
|
|
||||||
|
XNamespace ns = "http://kefico.co.kr/";
|
||||||
|
|
||||||
|
string htmlEncoded =
|
||||||
|
doc.Descendants(ns + "SendMailDetailResponse").First().Value;
|
||||||
|
|
||||||
|
//decode
|
||||||
|
result = WebUtility.HtmlDecode(htmlEncoded);
|
||||||
|
result = WebUtility.HtmlDecode(result);
|
||||||
|
|
||||||
|
Console.ForegroundColor = ConsoleColor.DarkGreen;
|
||||||
|
Console.WriteLine("");
|
||||||
|
Console.WriteLine("Response");
|
||||||
|
Console.WriteLine(result);
|
||||||
|
}
|
||||||
|
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -0,0 +1,33 @@
|
|||||||
|
using System.Reflection;
|
||||||
|
using System.Runtime.CompilerServices;
|
||||||
|
using System.Runtime.InteropServices;
|
||||||
|
|
||||||
|
// 어셈블리에 대한 일반 정보는 다음 특성 집합을 통해
|
||||||
|
// 제어됩니다. 어셈블리와 관련된 정보를 수정하려면
|
||||||
|
// 이러한 특성 값을 변경하세요.
|
||||||
|
[assembly: AssemblyTitle("KeficoMailService")]
|
||||||
|
[assembly: AssemblyDescription("")]
|
||||||
|
[assembly: AssemblyConfiguration("")]
|
||||||
|
[assembly: AssemblyCompany("")]
|
||||||
|
[assembly: AssemblyProduct("KeficoMailService")]
|
||||||
|
[assembly: AssemblyCopyright("Copyright © 2026")]
|
||||||
|
[assembly: AssemblyTrademark("")]
|
||||||
|
[assembly: AssemblyCulture("")]
|
||||||
|
|
||||||
|
// ComVisible을 false로 설정하면 이 어셈블리의 형식이 COM 구성 요소에
|
||||||
|
// 표시되지 않습니다. COM에서 이 어셈블리의 형식에 액세스하려면
|
||||||
|
// 해당 형식에 대해 ComVisible 특성을 true로 설정하세요.
|
||||||
|
[assembly: ComVisible(false)]
|
||||||
|
|
||||||
|
// 이 프로젝트가 COM에 노출되는 경우 다음 GUID는 typelib의 ID를 나타냅니다.
|
||||||
|
[assembly: Guid("63ff04ee-d1a5-4406-9267-1ee1e9fbb9e7")]
|
||||||
|
|
||||||
|
// 어셈블리의 버전 정보는 다음 네 가지 값으로 구성됩니다.
|
||||||
|
//
|
||||||
|
// 주 버전
|
||||||
|
// 부 버전
|
||||||
|
// 빌드 번호
|
||||||
|
// 수정 버전
|
||||||
|
//
|
||||||
|
[assembly: AssemblyVersion("1.0.0.0")]
|
||||||
|
[assembly: AssemblyFileVersion("1.0.0.0")]
|
||||||
6
Projects/NetStandard/KmsProxy.GUI/App.config
Normal file
6
Projects/NetStandard/KmsProxy.GUI/App.config
Normal file
@ -0,0 +1,6 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8" ?>
|
||||||
|
<configuration>
|
||||||
|
<startup>
|
||||||
|
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.8" />
|
||||||
|
</startup>
|
||||||
|
</configuration>
|
||||||
1151
Projects/NetStandard/KmsProxy.GUI/Form1.Designer.cs
generated
Normal file
1151
Projects/NetStandard/KmsProxy.GUI/Form1.Designer.cs
generated
Normal file
File diff suppressed because it is too large
Load Diff
226
Projects/NetStandard/KmsProxy.GUI/Form1.cs
Normal file
226
Projects/NetStandard/KmsProxy.GUI/Form1.cs
Normal file
@ -0,0 +1,226 @@
|
|||||||
|
using KmsProxy.Models;
|
||||||
|
using Newtonsoft.Json;
|
||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.ComponentModel;
|
||||||
|
using System.Data;
|
||||||
|
using System.Drawing;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Text;
|
||||||
|
using System.Threading.Tasks;
|
||||||
|
using System.Windows.Forms;
|
||||||
|
|
||||||
|
namespace KmsProxy.GUI
|
||||||
|
{
|
||||||
|
public partial class Form1 : Form
|
||||||
|
{
|
||||||
|
public Form1()
|
||||||
|
{
|
||||||
|
InitializeComponent();
|
||||||
|
|
||||||
|
if(Int32.TryParse(textPort.Text, out int port) == true)
|
||||||
|
{
|
||||||
|
KmsProxy.Port = port;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
Console.WriteLine("Port Error");
|
||||||
|
}
|
||||||
|
Init();
|
||||||
|
}
|
||||||
|
|
||||||
|
private void Init()
|
||||||
|
{
|
||||||
|
//ecuid
|
||||||
|
var request1 = new EcuID.Request_SupplierEcuID();
|
||||||
|
richTextBox1.Text = JsonConvert.SerializeObject(request1, Formatting.Indented);
|
||||||
|
|
||||||
|
//master key
|
||||||
|
var request2 = new MasterEcuKey.Request_SupplierKeyProvisioning();
|
||||||
|
richTextBox4.Text = JsonConvert.SerializeObject(request2, Formatting.Indented);
|
||||||
|
|
||||||
|
var request3 = new MasterEcuKey.Request_SupplierKeyProvisioning_Result();
|
||||||
|
richTextBox6.Text = JsonConvert.SerializeObject(request3, Formatting.Indented);
|
||||||
|
|
||||||
|
//symm
|
||||||
|
var request4 = new SupplierSymmKey.Request_SupplierKeyProvisioning();
|
||||||
|
richTextBox8.Text = JsonConvert.SerializeObject(request4, Formatting.Indented);
|
||||||
|
|
||||||
|
var request5 = new SupplierSymmKey.Request_SupplierKeyProvisioning_Result();
|
||||||
|
richTextBox10.Text = JsonConvert.SerializeObject(request5, Formatting.Indented);
|
||||||
|
|
||||||
|
var request6 = new SupplierSymmKey.Request_SupplierKeySyncValue();
|
||||||
|
richTextBox12.Text = JsonConvert.SerializeObject(request5, Formatting.Indented);
|
||||||
|
|
||||||
|
var request7 = new SupplierSymmKey.Request_SupplierKeySyncValue_Result();
|
||||||
|
richTextBox14.Text = JsonConvert.SerializeObject(request5, Formatting.Indented);
|
||||||
|
|
||||||
|
//secoc
|
||||||
|
var request8 = new SecOCKey.Request_SupplierKeyProvisioning();
|
||||||
|
richTextBox16.Text = JsonConvert.SerializeObject(request8, Formatting.Indented);
|
||||||
|
|
||||||
|
var request9 = new SecOCKey.Request_SupplierKeyProvisioning_Result();
|
||||||
|
richTextBox18.Text = JsonConvert.SerializeObject(request9, Formatting.Indented);
|
||||||
|
|
||||||
|
var request10 = new SecOCKey.Request_SupplierKeySyncValue();
|
||||||
|
richTextBox20.Text = JsonConvert.SerializeObject(request10, Formatting.Indented);
|
||||||
|
|
||||||
|
var request11 = new SecOCKey.Request_SupplierKeySyncValue_Result();
|
||||||
|
richTextBox22.Text = JsonConvert.SerializeObject(request11, Formatting.Indented);
|
||||||
|
}
|
||||||
|
|
||||||
|
private void button1_Click(object sender, EventArgs e)
|
||||||
|
{
|
||||||
|
var host = textHost.Text;
|
||||||
|
var request = JsonConvert.DeserializeObject<EcuID.Request_SupplierEcuID>(richTextBox1.Text);
|
||||||
|
var res = new EcuID.Response_SupplierEcuID();
|
||||||
|
|
||||||
|
Task.Run(async () =>
|
||||||
|
{
|
||||||
|
res = await KmsProxy.EcuID_SupplierEcuID(host, request);
|
||||||
|
}).Wait();
|
||||||
|
|
||||||
|
richTextBox2.Text = JsonConvert.SerializeObject(res, Formatting.Indented);
|
||||||
|
}
|
||||||
|
|
||||||
|
private void button2_Click(object sender, EventArgs e)
|
||||||
|
{
|
||||||
|
var host = textHost.Text;
|
||||||
|
var request = JsonConvert.DeserializeObject<MasterEcuKey.Request_SupplierKeyProvisioning>(richTextBox4.Text);
|
||||||
|
var res = new MasterEcuKey.Response_SupplierKeyProvisioning();
|
||||||
|
|
||||||
|
Task.Run(async () =>
|
||||||
|
{
|
||||||
|
res = await KmsProxy.MasterEcuKey_SupplierKeyProvisioning(host, request);
|
||||||
|
}).Wait();
|
||||||
|
|
||||||
|
richTextBox3.Text = JsonConvert.SerializeObject(res, Formatting.Indented);
|
||||||
|
}
|
||||||
|
|
||||||
|
private void button3_Click(object sender, EventArgs e)
|
||||||
|
{
|
||||||
|
var host = textHost.Text;
|
||||||
|
var request = JsonConvert.DeserializeObject<MasterEcuKey.Request_SupplierKeyProvisioning_Result>(richTextBox6.Text);
|
||||||
|
var res = new MasterEcuKey.Response_SupplierKeyProvisioning_Result();
|
||||||
|
|
||||||
|
Task.Run(async () =>
|
||||||
|
{
|
||||||
|
res = await KmsProxy.MasterEcuKey_SupplierKeyProvisioningResult(host, request);
|
||||||
|
}).Wait();
|
||||||
|
|
||||||
|
richTextBox5.Text = JsonConvert.SerializeObject(res, Formatting.Indented);
|
||||||
|
}
|
||||||
|
|
||||||
|
private void button4_Click(object sender, EventArgs e)
|
||||||
|
{
|
||||||
|
var host = textHost.Text;
|
||||||
|
var request = JsonConvert.DeserializeObject<SupplierSymmKey.Request_SupplierKeyProvisioning>(richTextBox8.Text);
|
||||||
|
var res = new SupplierSymmKey.Response_SupplierKeyProvisioning();
|
||||||
|
|
||||||
|
Task.Run(async () =>
|
||||||
|
{
|
||||||
|
res = await KmsProxy.SupplierSymmKey_SupplierKeyProvisioning(host, request);
|
||||||
|
}).Wait();
|
||||||
|
|
||||||
|
richTextBox7.Text = JsonConvert.SerializeObject(res, Formatting.Indented);
|
||||||
|
}
|
||||||
|
|
||||||
|
private void button5_Click(object sender, EventArgs e)
|
||||||
|
{
|
||||||
|
var host = textHost.Text;
|
||||||
|
var request = JsonConvert.DeserializeObject<SupplierSymmKey.Request_SupplierKeyProvisioning_Result>(richTextBox10.Text);
|
||||||
|
var res = new SupplierSymmKey.Response_SupplierKeyProvisioning_Result();
|
||||||
|
|
||||||
|
Task.Run(async () =>
|
||||||
|
{
|
||||||
|
res = await KmsProxy.SupplierSymmKey_SupplierKeyProvisioningResult(host, request);
|
||||||
|
}).Wait();
|
||||||
|
|
||||||
|
richTextBox9.Text = JsonConvert.SerializeObject(res, Formatting.Indented);
|
||||||
|
}
|
||||||
|
|
||||||
|
private void button6_Click(object sender, EventArgs e)
|
||||||
|
{
|
||||||
|
var host = textHost.Text;
|
||||||
|
var request = JsonConvert.DeserializeObject<SupplierSymmKey.Request_SupplierKeySyncValue>(richTextBox12.Text);
|
||||||
|
var res = new SupplierSymmKey.Response_SupplierKeySyncValue();
|
||||||
|
|
||||||
|
Task.Run(async () =>
|
||||||
|
{
|
||||||
|
res = await KmsProxy.SupplierSymmKey_SupplierKeySyncValue(host, request);
|
||||||
|
}).Wait();
|
||||||
|
|
||||||
|
richTextBox11.Text = JsonConvert.SerializeObject(res, Formatting.Indented);
|
||||||
|
}
|
||||||
|
|
||||||
|
private void button7_Click(object sender, EventArgs e)
|
||||||
|
{
|
||||||
|
var host = textHost.Text;
|
||||||
|
var request = JsonConvert.DeserializeObject<SupplierSymmKey.Request_SupplierKeySyncValue_Result>(richTextBox14.Text);
|
||||||
|
var res = new SupplierSymmKey.Response_SupplierKeySyncValue_Result();
|
||||||
|
|
||||||
|
Task.Run(async () =>
|
||||||
|
{
|
||||||
|
res = await KmsProxy.SupplierSymmKey_SupplierKeySyncValueResult(host, request);
|
||||||
|
}).Wait();
|
||||||
|
|
||||||
|
richTextBox13.Text = JsonConvert.SerializeObject(res, Formatting.Indented);
|
||||||
|
}
|
||||||
|
|
||||||
|
private void button8_Click(object sender, EventArgs e)
|
||||||
|
{
|
||||||
|
var host = textHost.Text;
|
||||||
|
var request = JsonConvert.DeserializeObject<SecOCKey.Request_SupplierKeyProvisioning>(richTextBox16.Text);
|
||||||
|
var res = new SecOCKey.Response_SupplierKeyProvisioning();
|
||||||
|
|
||||||
|
Task.Run(async () =>
|
||||||
|
{
|
||||||
|
res = await KmsProxy.SecOCKey_SupplierKeyProvisioning(host, request);
|
||||||
|
}).Wait();
|
||||||
|
|
||||||
|
richTextBox15.Text = JsonConvert.SerializeObject(res, Formatting.Indented);
|
||||||
|
}
|
||||||
|
|
||||||
|
private void button9_Click(object sender, EventArgs e)
|
||||||
|
{
|
||||||
|
var host = textHost.Text;
|
||||||
|
var request = JsonConvert.DeserializeObject<SecOCKey.Request_SupplierKeyProvisioning_Result>(richTextBox18.Text);
|
||||||
|
var res = new SecOCKey.Response_SupplierKeyProvisioning_Result();
|
||||||
|
|
||||||
|
Task.Run(async () =>
|
||||||
|
{
|
||||||
|
res = await KmsProxy.SecOCKey_SupplierKeyProvisioningResult(host, request);
|
||||||
|
}).Wait();
|
||||||
|
|
||||||
|
richTextBox17.Text = JsonConvert.SerializeObject(res, Formatting.Indented);
|
||||||
|
}
|
||||||
|
|
||||||
|
private void button10_Click(object sender, EventArgs e)
|
||||||
|
{
|
||||||
|
var host = textHost.Text;
|
||||||
|
var request = JsonConvert.DeserializeObject<SecOCKey.Request_SupplierKeySyncValue>(richTextBox20.Text);
|
||||||
|
var res = new SecOCKey.Response_SupplierKeySyncValue();
|
||||||
|
|
||||||
|
Task.Run(async () =>
|
||||||
|
{
|
||||||
|
res = await KmsProxy.SecOCKey_SupplierKeySyncValue(host, request);
|
||||||
|
}).Wait();
|
||||||
|
|
||||||
|
richTextBox19.Text = JsonConvert.SerializeObject(res, Formatting.Indented);
|
||||||
|
}
|
||||||
|
|
||||||
|
private void button11_Click(object sender, EventArgs e)
|
||||||
|
{
|
||||||
|
var host = textHost.Text;
|
||||||
|
var request = JsonConvert.DeserializeObject<SecOCKey.Request_SupplierKeySyncValue_Result>(richTextBox22.Text);
|
||||||
|
var res = new SecOCKey.Response_SupplierKeySyncValue_Result();
|
||||||
|
|
||||||
|
Task.Run(async () =>
|
||||||
|
{
|
||||||
|
res = await KmsProxy.SecOCKey_SupplierKeySyncValueResult(host, request);
|
||||||
|
}).Wait();
|
||||||
|
|
||||||
|
richTextBox21.Text = JsonConvert.SerializeObject(res, Formatting.Indented);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
120
Projects/NetStandard/KmsProxy.GUI/Form1.resx
Normal file
120
Projects/NetStandard/KmsProxy.GUI/Form1.resx
Normal file
@ -0,0 +1,120 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<root>
|
||||||
|
<!--
|
||||||
|
Microsoft ResX Schema
|
||||||
|
|
||||||
|
Version 2.0
|
||||||
|
|
||||||
|
The primary goals of this format is to allow a simple XML format
|
||||||
|
that is mostly human readable. The generation and parsing of the
|
||||||
|
various data types are done through the TypeConverter classes
|
||||||
|
associated with the data types.
|
||||||
|
|
||||||
|
Example:
|
||||||
|
|
||||||
|
... ado.net/XML headers & schema ...
|
||||||
|
<resheader name="resmimetype">text/microsoft-resx</resheader>
|
||||||
|
<resheader name="version">2.0</resheader>
|
||||||
|
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
|
||||||
|
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
|
||||||
|
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
|
||||||
|
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
|
||||||
|
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
|
||||||
|
<value>[base64 mime encoded serialized .NET Framework object]</value>
|
||||||
|
</data>
|
||||||
|
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
|
||||||
|
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
|
||||||
|
<comment>This is a comment</comment>
|
||||||
|
</data>
|
||||||
|
|
||||||
|
There are any number of "resheader" rows that contain simple
|
||||||
|
name/value pairs.
|
||||||
|
|
||||||
|
Each data row contains a name, and value. The row also contains a
|
||||||
|
type or mimetype. Type corresponds to a .NET class that support
|
||||||
|
text/value conversion through the TypeConverter architecture.
|
||||||
|
Classes that don't support this are serialized and stored with the
|
||||||
|
mimetype set.
|
||||||
|
|
||||||
|
The mimetype is used for serialized objects, and tells the
|
||||||
|
ResXResourceReader how to depersist the object. This is currently not
|
||||||
|
extensible. For a given mimetype the value must be set accordingly:
|
||||||
|
|
||||||
|
Note - application/x-microsoft.net.object.binary.base64 is the format
|
||||||
|
that the ResXResourceWriter will generate, however the reader can
|
||||||
|
read any of the formats listed below.
|
||||||
|
|
||||||
|
mimetype: application/x-microsoft.net.object.binary.base64
|
||||||
|
value : The object must be serialized with
|
||||||
|
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
|
||||||
|
: and then encoded with base64 encoding.
|
||||||
|
|
||||||
|
mimetype: application/x-microsoft.net.object.soap.base64
|
||||||
|
value : The object must be serialized with
|
||||||
|
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
|
||||||
|
: and then encoded with base64 encoding.
|
||||||
|
|
||||||
|
mimetype: application/x-microsoft.net.object.bytearray.base64
|
||||||
|
value : The object must be serialized into a byte array
|
||||||
|
: using a System.ComponentModel.TypeConverter
|
||||||
|
: and then encoded with base64 encoding.
|
||||||
|
-->
|
||||||
|
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
|
||||||
|
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
|
||||||
|
<xsd:element name="root" msdata:IsDataSet="true">
|
||||||
|
<xsd:complexType>
|
||||||
|
<xsd:choice maxOccurs="unbounded">
|
||||||
|
<xsd:element name="metadata">
|
||||||
|
<xsd:complexType>
|
||||||
|
<xsd:sequence>
|
||||||
|
<xsd:element name="value" type="xsd:string" minOccurs="0" />
|
||||||
|
</xsd:sequence>
|
||||||
|
<xsd:attribute name="name" use="required" type="xsd:string" />
|
||||||
|
<xsd:attribute name="type" type="xsd:string" />
|
||||||
|
<xsd:attribute name="mimetype" type="xsd:string" />
|
||||||
|
<xsd:attribute ref="xml:space" />
|
||||||
|
</xsd:complexType>
|
||||||
|
</xsd:element>
|
||||||
|
<xsd:element name="assembly">
|
||||||
|
<xsd:complexType>
|
||||||
|
<xsd:attribute name="alias" type="xsd:string" />
|
||||||
|
<xsd:attribute name="name" type="xsd:string" />
|
||||||
|
</xsd:complexType>
|
||||||
|
</xsd:element>
|
||||||
|
<xsd:element name="data">
|
||||||
|
<xsd:complexType>
|
||||||
|
<xsd:sequence>
|
||||||
|
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||||
|
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
|
||||||
|
</xsd:sequence>
|
||||||
|
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
|
||||||
|
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
|
||||||
|
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
|
||||||
|
<xsd:attribute ref="xml:space" />
|
||||||
|
</xsd:complexType>
|
||||||
|
</xsd:element>
|
||||||
|
<xsd:element name="resheader">
|
||||||
|
<xsd:complexType>
|
||||||
|
<xsd:sequence>
|
||||||
|
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||||
|
</xsd:sequence>
|
||||||
|
<xsd:attribute name="name" type="xsd:string" use="required" />
|
||||||
|
</xsd:complexType>
|
||||||
|
</xsd:element>
|
||||||
|
</xsd:choice>
|
||||||
|
</xsd:complexType>
|
||||||
|
</xsd:element>
|
||||||
|
</xsd:schema>
|
||||||
|
<resheader name="resmimetype">
|
||||||
|
<value>text/microsoft-resx</value>
|
||||||
|
</resheader>
|
||||||
|
<resheader name="version">
|
||||||
|
<value>2.0</value>
|
||||||
|
</resheader>
|
||||||
|
<resheader name="reader">
|
||||||
|
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||||
|
</resheader>
|
||||||
|
<resheader name="writer">
|
||||||
|
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||||
|
</resheader>
|
||||||
|
</root>
|
||||||
96
Projects/NetStandard/KmsProxy.GUI/KmsProxy.GUI.csproj
Normal file
96
Projects/NetStandard/KmsProxy.GUI/KmsProxy.GUI.csproj
Normal file
@ -0,0 +1,96 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||||
|
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
|
||||||
|
<PropertyGroup>
|
||||||
|
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
|
||||||
|
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
|
||||||
|
<ProjectGuid>{D93A2424-C404-4731-8835-FC0AEA158310}</ProjectGuid>
|
||||||
|
<OutputType>WinExe</OutputType>
|
||||||
|
<RootNamespace>KmsProxy.GUI</RootNamespace>
|
||||||
|
<AssemblyName>KmsProxy.GUI</AssemblyName>
|
||||||
|
<TargetFrameworkVersion>v4.8</TargetFrameworkVersion>
|
||||||
|
<FileAlignment>512</FileAlignment>
|
||||||
|
<AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects>
|
||||||
|
<Deterministic>true</Deterministic>
|
||||||
|
</PropertyGroup>
|
||||||
|
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
|
||||||
|
<PlatformTarget>AnyCPU</PlatformTarget>
|
||||||
|
<DebugSymbols>true</DebugSymbols>
|
||||||
|
<DebugType>full</DebugType>
|
||||||
|
<Optimize>false</Optimize>
|
||||||
|
<OutputPath>bin\Debug\</OutputPath>
|
||||||
|
<DefineConstants>DEBUG;TRACE</DefineConstants>
|
||||||
|
<ErrorReport>prompt</ErrorReport>
|
||||||
|
<WarningLevel>4</WarningLevel>
|
||||||
|
</PropertyGroup>
|
||||||
|
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
|
||||||
|
<PlatformTarget>AnyCPU</PlatformTarget>
|
||||||
|
<DebugType>pdbonly</DebugType>
|
||||||
|
<Optimize>true</Optimize>
|
||||||
|
<OutputPath>bin\Release\</OutputPath>
|
||||||
|
<DefineConstants>TRACE</DefineConstants>
|
||||||
|
<ErrorReport>prompt</ErrorReport>
|
||||||
|
<WarningLevel>4</WarningLevel>
|
||||||
|
</PropertyGroup>
|
||||||
|
<PropertyGroup>
|
||||||
|
<StartupObject />
|
||||||
|
</PropertyGroup>
|
||||||
|
<ItemGroup>
|
||||||
|
<Reference Include="Newtonsoft.Json, Version=13.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed, processorArchitecture=MSIL">
|
||||||
|
<HintPath>..\packages\Newtonsoft.Json.13.0.4\lib\net45\Newtonsoft.Json.dll</HintPath>
|
||||||
|
</Reference>
|
||||||
|
<Reference Include="System" />
|
||||||
|
<Reference Include="System.Core" />
|
||||||
|
<Reference Include="System.Xml.Linq" />
|
||||||
|
<Reference Include="System.Data.DataSetExtensions" />
|
||||||
|
<Reference Include="Microsoft.CSharp" />
|
||||||
|
<Reference Include="System.Data" />
|
||||||
|
<Reference Include="System.Deployment" />
|
||||||
|
<Reference Include="System.Drawing" />
|
||||||
|
<Reference Include="System.Net.Http" />
|
||||||
|
<Reference Include="System.Windows.Forms" />
|
||||||
|
<Reference Include="System.Xml" />
|
||||||
|
</ItemGroup>
|
||||||
|
<ItemGroup>
|
||||||
|
<Compile Include="Form1.cs">
|
||||||
|
<SubType>Form</SubType>
|
||||||
|
</Compile>
|
||||||
|
<Compile Include="Form1.Designer.cs">
|
||||||
|
<DependentUpon>Form1.cs</DependentUpon>
|
||||||
|
</Compile>
|
||||||
|
<Compile Include="Program.cs" />
|
||||||
|
<Compile Include="Properties\AssemblyInfo.cs" />
|
||||||
|
<EmbeddedResource Include="Form1.resx">
|
||||||
|
<DependentUpon>Form1.cs</DependentUpon>
|
||||||
|
</EmbeddedResource>
|
||||||
|
<EmbeddedResource Include="Properties\Resources.resx">
|
||||||
|
<Generator>ResXFileCodeGenerator</Generator>
|
||||||
|
<LastGenOutput>Resources.Designer.cs</LastGenOutput>
|
||||||
|
<SubType>Designer</SubType>
|
||||||
|
</EmbeddedResource>
|
||||||
|
<Compile Include="Properties\Resources.Designer.cs">
|
||||||
|
<AutoGen>True</AutoGen>
|
||||||
|
<DependentUpon>Resources.resx</DependentUpon>
|
||||||
|
</Compile>
|
||||||
|
<None Include="packages.config" />
|
||||||
|
<None Include="Properties\Settings.settings">
|
||||||
|
<Generator>SettingsSingleFileGenerator</Generator>
|
||||||
|
<LastGenOutput>Settings.Designer.cs</LastGenOutput>
|
||||||
|
</None>
|
||||||
|
<Compile Include="Properties\Settings.Designer.cs">
|
||||||
|
<AutoGen>True</AutoGen>
|
||||||
|
<DependentUpon>Settings.settings</DependentUpon>
|
||||||
|
<DesignTimeSharedInput>True</DesignTimeSharedInput>
|
||||||
|
</Compile>
|
||||||
|
</ItemGroup>
|
||||||
|
<ItemGroup>
|
||||||
|
<None Include="App.config" />
|
||||||
|
</ItemGroup>
|
||||||
|
<ItemGroup>
|
||||||
|
<ProjectReference Include="..\KmsProxy\KmsProxy.csproj">
|
||||||
|
<Project>{73824acb-4fb9-4e11-9a86-e05471b3c979}</Project>
|
||||||
|
<Name>KmsProxy</Name>
|
||||||
|
</ProjectReference>
|
||||||
|
</ItemGroup>
|
||||||
|
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
|
||||||
|
</Project>
|
||||||
22
Projects/NetStandard/KmsProxy.GUI/Program.cs
Normal file
22
Projects/NetStandard/KmsProxy.GUI/Program.cs
Normal file
@ -0,0 +1,22 @@
|
|||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Threading.Tasks;
|
||||||
|
using System.Windows.Forms;
|
||||||
|
|
||||||
|
namespace KmsProxy.GUI
|
||||||
|
{
|
||||||
|
internal static class Program
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// 해당 애플리케이션의 주 진입점입니다.
|
||||||
|
/// </summary>
|
||||||
|
[STAThread]
|
||||||
|
static void Main()
|
||||||
|
{
|
||||||
|
Application.EnableVisualStyles();
|
||||||
|
Application.SetCompatibleTextRenderingDefault(false);
|
||||||
|
Application.Run(new Form1());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
33
Projects/NetStandard/KmsProxy.GUI/Properties/AssemblyInfo.cs
Normal file
33
Projects/NetStandard/KmsProxy.GUI/Properties/AssemblyInfo.cs
Normal file
@ -0,0 +1,33 @@
|
|||||||
|
using System.Reflection;
|
||||||
|
using System.Runtime.CompilerServices;
|
||||||
|
using System.Runtime.InteropServices;
|
||||||
|
|
||||||
|
// 어셈블리에 대한 일반 정보는 다음 특성 집합을 통해
|
||||||
|
// 제어됩니다. 어셈블리와 관련된 정보를 수정하려면
|
||||||
|
// 이러한 특성 값을 변경하세요.
|
||||||
|
[assembly: AssemblyTitle("KmsProxy.GUI")]
|
||||||
|
[assembly: AssemblyDescription("")]
|
||||||
|
[assembly: AssemblyConfiguration("")]
|
||||||
|
[assembly: AssemblyCompany("")]
|
||||||
|
[assembly: AssemblyProduct("KmsProxy.GUI")]
|
||||||
|
[assembly: AssemblyCopyright("Copyright © 2026")]
|
||||||
|
[assembly: AssemblyTrademark("")]
|
||||||
|
[assembly: AssemblyCulture("")]
|
||||||
|
|
||||||
|
// ComVisible을 false로 설정하면 이 어셈블리의 형식이 COM 구성 요소에
|
||||||
|
// 표시되지 않습니다. COM에서 이 어셈블리의 형식에 액세스하려면
|
||||||
|
// 해당 형식에 대해 ComVisible 특성을 true로 설정하세요.
|
||||||
|
[assembly: ComVisible(false)]
|
||||||
|
|
||||||
|
// 이 프로젝트가 COM에 노출되는 경우 다음 GUID는 typelib의 ID를 나타냅니다.
|
||||||
|
[assembly: Guid("d93a2424-c404-4731-8835-fc0aea158310")]
|
||||||
|
|
||||||
|
// 어셈블리의 버전 정보는 다음 네 가지 값으로 구성됩니다.
|
||||||
|
//
|
||||||
|
// 주 버전
|
||||||
|
// 부 버전
|
||||||
|
// 빌드 번호
|
||||||
|
// 수정 버전
|
||||||
|
//
|
||||||
|
[assembly: AssemblyVersion("1.0.0.0")]
|
||||||
|
[assembly: AssemblyFileVersion("1.0.0.0")]
|
||||||
71
Projects/NetStandard/KmsProxy.GUI/Properties/Resources.Designer.cs
generated
Normal file
71
Projects/NetStandard/KmsProxy.GUI/Properties/Resources.Designer.cs
generated
Normal file
@ -0,0 +1,71 @@
|
|||||||
|
//------------------------------------------------------------------------------
|
||||||
|
// <auto-generated>
|
||||||
|
// 이 코드는 도구를 사용하여 생성되었습니다.
|
||||||
|
// 런타임 버전:4.0.30319.42000
|
||||||
|
//
|
||||||
|
// 파일 내용을 변경하면 잘못된 동작이 발생할 수 있으며, 코드를 다시 생성하면
|
||||||
|
// 이러한 변경 내용이 손실됩니다.
|
||||||
|
// </auto-generated>
|
||||||
|
//------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
namespace KmsProxy.GUI.Properties
|
||||||
|
{
|
||||||
|
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 지역화된 문자열 등을 찾기 위한 강력한 형식의 리소스 클래스입니다.
|
||||||
|
/// </summary>
|
||||||
|
// 이 클래스는 ResGen 또는 Visual Studio와 같은 도구를 통해 StronglyTypedResourceBuilder
|
||||||
|
// 클래스에서 자동으로 생성되었습니다.
|
||||||
|
// 멤버를 추가하거나 제거하려면 .ResX 파일을 편집한 다음 /str 옵션을 사용하여
|
||||||
|
// ResGen을 다시 실행하거나 VS 프로젝트를 다시 빌드하십시오.
|
||||||
|
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")]
|
||||||
|
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
|
||||||
|
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
|
||||||
|
internal class Resources
|
||||||
|
{
|
||||||
|
|
||||||
|
private static global::System.Resources.ResourceManager resourceMan;
|
||||||
|
|
||||||
|
private static global::System.Globalization.CultureInfo resourceCulture;
|
||||||
|
|
||||||
|
[global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")]
|
||||||
|
internal Resources()
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 이 클래스에서 사용하는 캐시된 ResourceManager 인스턴스를 반환합니다.
|
||||||
|
/// </summary>
|
||||||
|
[global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
|
||||||
|
internal static global::System.Resources.ResourceManager ResourceManager
|
||||||
|
{
|
||||||
|
get
|
||||||
|
{
|
||||||
|
if ((resourceMan == null))
|
||||||
|
{
|
||||||
|
global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("KmsProxy.GUI.Properties.Resources", typeof(Resources).Assembly);
|
||||||
|
resourceMan = temp;
|
||||||
|
}
|
||||||
|
return resourceMan;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 이 강력한 형식의 리소스 클래스를 사용하여 모든 리소스 조회에 대해 현재 스레드의 CurrentUICulture 속성을
|
||||||
|
/// 재정의합니다.
|
||||||
|
/// </summary>
|
||||||
|
[global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
|
||||||
|
internal static global::System.Globalization.CultureInfo Culture
|
||||||
|
{
|
||||||
|
get
|
||||||
|
{
|
||||||
|
return resourceCulture;
|
||||||
|
}
|
||||||
|
set
|
||||||
|
{
|
||||||
|
resourceCulture = value;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
117
Projects/NetStandard/KmsProxy.GUI/Properties/Resources.resx
Normal file
117
Projects/NetStandard/KmsProxy.GUI/Properties/Resources.resx
Normal file
@ -0,0 +1,117 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<root>
|
||||||
|
<!--
|
||||||
|
Microsoft ResX Schema
|
||||||
|
|
||||||
|
Version 2.0
|
||||||
|
|
||||||
|
The primary goals of this format is to allow a simple XML format
|
||||||
|
that is mostly human readable. The generation and parsing of the
|
||||||
|
various data types are done through the TypeConverter classes
|
||||||
|
associated with the data types.
|
||||||
|
|
||||||
|
Example:
|
||||||
|
|
||||||
|
... ado.net/XML headers & schema ...
|
||||||
|
<resheader name="resmimetype">text/microsoft-resx</resheader>
|
||||||
|
<resheader name="version">2.0</resheader>
|
||||||
|
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
|
||||||
|
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
|
||||||
|
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
|
||||||
|
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
|
||||||
|
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
|
||||||
|
<value>[base64 mime encoded serialized .NET Framework object]</value>
|
||||||
|
</data>
|
||||||
|
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
|
||||||
|
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
|
||||||
|
<comment>This is a comment</comment>
|
||||||
|
</data>
|
||||||
|
|
||||||
|
There are any number of "resheader" rows that contain simple
|
||||||
|
name/value pairs.
|
||||||
|
|
||||||
|
Each data row contains a name, and value. The row also contains a
|
||||||
|
type or mimetype. Type corresponds to a .NET class that support
|
||||||
|
text/value conversion through the TypeConverter architecture.
|
||||||
|
Classes that don't support this are serialized and stored with the
|
||||||
|
mimetype set.
|
||||||
|
|
||||||
|
The mimetype is used for serialized objects, and tells the
|
||||||
|
ResXResourceReader how to depersist the object. This is currently not
|
||||||
|
extensible. For a given mimetype the value must be set accordingly:
|
||||||
|
|
||||||
|
Note - application/x-microsoft.net.object.binary.base64 is the format
|
||||||
|
that the ResXResourceWriter will generate, however the reader can
|
||||||
|
read any of the formats listed below.
|
||||||
|
|
||||||
|
mimetype: application/x-microsoft.net.object.binary.base64
|
||||||
|
value : The object must be serialized with
|
||||||
|
: System.Serialization.Formatters.Binary.BinaryFormatter
|
||||||
|
: and then encoded with base64 encoding.
|
||||||
|
|
||||||
|
mimetype: application/x-microsoft.net.object.soap.base64
|
||||||
|
value : The object must be serialized with
|
||||||
|
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
|
||||||
|
: and then encoded with base64 encoding.
|
||||||
|
|
||||||
|
mimetype: application/x-microsoft.net.object.bytearray.base64
|
||||||
|
value : The object must be serialized into a byte array
|
||||||
|
: using a System.ComponentModel.TypeConverter
|
||||||
|
: and then encoded with base64 encoding.
|
||||||
|
-->
|
||||||
|
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
|
||||||
|
<xsd:element name="root" msdata:IsDataSet="true">
|
||||||
|
<xsd:complexType>
|
||||||
|
<xsd:choice maxOccurs="unbounded">
|
||||||
|
<xsd:element name="metadata">
|
||||||
|
<xsd:complexType>
|
||||||
|
<xsd:sequence>
|
||||||
|
<xsd:element name="value" type="xsd:string" minOccurs="0" />
|
||||||
|
</xsd:sequence>
|
||||||
|
<xsd:attribute name="name" type="xsd:string" />
|
||||||
|
<xsd:attribute name="type" type="xsd:string" />
|
||||||
|
<xsd:attribute name="mimetype" type="xsd:string" />
|
||||||
|
</xsd:complexType>
|
||||||
|
</xsd:element>
|
||||||
|
<xsd:element name="assembly">
|
||||||
|
<xsd:complexType>
|
||||||
|
<xsd:attribute name="alias" type="xsd:string" />
|
||||||
|
<xsd:attribute name="name" type="xsd:string" />
|
||||||
|
</xsd:complexType>
|
||||||
|
</xsd:element>
|
||||||
|
<xsd:element name="data">
|
||||||
|
<xsd:complexType>
|
||||||
|
<xsd:sequence>
|
||||||
|
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||||
|
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
|
||||||
|
</xsd:sequence>
|
||||||
|
<xsd:attribute name="name" type="xsd:string" msdata:Ordinal="1" />
|
||||||
|
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
|
||||||
|
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
|
||||||
|
</xsd:complexType>
|
||||||
|
</xsd:element>
|
||||||
|
<xsd:element name="resheader">
|
||||||
|
<xsd:complexType>
|
||||||
|
<xsd:sequence>
|
||||||
|
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||||
|
</xsd:sequence>
|
||||||
|
<xsd:attribute name="name" type="xsd:string" use="required" />
|
||||||
|
</xsd:complexType>
|
||||||
|
</xsd:element>
|
||||||
|
</xsd:choice>
|
||||||
|
</xsd:complexType>
|
||||||
|
</xsd:element>
|
||||||
|
</xsd:schema>
|
||||||
|
<resheader name="resmimetype">
|
||||||
|
<value>text/microsoft-resx</value>
|
||||||
|
</resheader>
|
||||||
|
<resheader name="version">
|
||||||
|
<value>2.0</value>
|
||||||
|
</resheader>
|
||||||
|
<resheader name="reader">
|
||||||
|
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||||
|
</resheader>
|
||||||
|
<resheader name="writer">
|
||||||
|
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||||
|
</resheader>
|
||||||
|
</root>
|
||||||
30
Projects/NetStandard/KmsProxy.GUI/Properties/Settings.Designer.cs
generated
Normal file
30
Projects/NetStandard/KmsProxy.GUI/Properties/Settings.Designer.cs
generated
Normal file
@ -0,0 +1,30 @@
|
|||||||
|
//------------------------------------------------------------------------------
|
||||||
|
// <auto-generated>
|
||||||
|
// This code was generated by a tool.
|
||||||
|
// Runtime Version:4.0.30319.42000
|
||||||
|
//
|
||||||
|
// Changes to this file may cause incorrect behavior and will be lost if
|
||||||
|
// the code is regenerated.
|
||||||
|
// </auto-generated>
|
||||||
|
//------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
namespace KmsProxy.GUI.Properties
|
||||||
|
{
|
||||||
|
|
||||||
|
|
||||||
|
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
|
||||||
|
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "11.0.0.0")]
|
||||||
|
internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase
|
||||||
|
{
|
||||||
|
|
||||||
|
private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings())));
|
||||||
|
|
||||||
|
public static Settings Default
|
||||||
|
{
|
||||||
|
get
|
||||||
|
{
|
||||||
|
return defaultInstance;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -0,0 +1,7 @@
|
|||||||
|
<?xml version='1.0' encoding='utf-8'?>
|
||||||
|
<SettingsFile xmlns="http://schemas.microsoft.com/VisualStudio/2004/01/settings" CurrentProfile="(Default)">
|
||||||
|
<Profiles>
|
||||||
|
<Profile Name="(Default)" />
|
||||||
|
</Profiles>
|
||||||
|
<Settings />
|
||||||
|
</SettingsFile>
|
||||||
4
Projects/NetStandard/KmsProxy.GUI/packages.config
Normal file
4
Projects/NetStandard/KmsProxy.GUI/packages.config
Normal file
@ -0,0 +1,4 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<packages>
|
||||||
|
<package id="Newtonsoft.Json" version="13.0.4" targetFramework="net48" />
|
||||||
|
</packages>
|
||||||
105
Projects/NetStandard/KmsProxy/KmsProxy.cs
Normal file
105
Projects/NetStandard/KmsProxy/KmsProxy.cs
Normal file
@ -0,0 +1,105 @@
|
|||||||
|
using KmsProxy.Models;
|
||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Text;
|
||||||
|
using System.Threading.Tasks;
|
||||||
|
|
||||||
|
namespace KmsProxy
|
||||||
|
{
|
||||||
|
public class KmsProxy
|
||||||
|
{
|
||||||
|
public static int Port { get; set; } = 9200;
|
||||||
|
|
||||||
|
//1. EcuID
|
||||||
|
public static async Task<EcuID.Response_SupplierEcuID> EcuID_SupplierEcuID(string host, EcuID.Request_SupplierEcuID request)
|
||||||
|
{
|
||||||
|
string url = $"https://{host}:{Port}/kms/ecuid/supplierEcuID";
|
||||||
|
|
||||||
|
var res = await RestAPI.PostAsync<EcuID.Request_SupplierEcuID, EcuID.Response_SupplierEcuID>(url, request);
|
||||||
|
return res;
|
||||||
|
}
|
||||||
|
|
||||||
|
//2. MasterECUKEy
|
||||||
|
public static async Task<MasterEcuKey.Response_SupplierKeyProvisioning> MasterEcuKey_SupplierKeyProvisioning(string host, MasterEcuKey.Request_SupplierKeyProvisioning request)
|
||||||
|
{
|
||||||
|
string url = $"https://{host}:{Port}/kms/MasterEcuKey/SupplierKeyProvisioning";
|
||||||
|
|
||||||
|
var res = await RestAPI.PostAsync<MasterEcuKey.Request_SupplierKeyProvisioning, MasterEcuKey.Response_SupplierKeyProvisioning>(url, request);
|
||||||
|
return res;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static async Task<MasterEcuKey.Response_SupplierKeyProvisioning_Result> MasterEcuKey_SupplierKeyProvisioningResult(string host, MasterEcuKey.Request_SupplierKeyProvisioning_Result request)
|
||||||
|
{
|
||||||
|
string url = $"https://{host}:{Port}/kms/MasterEcuKey/SupplierKeyProvisioning";
|
||||||
|
|
||||||
|
var res = await RestAPI.PutAsync<MasterEcuKey.Request_SupplierKeyProvisioning_Result, MasterEcuKey.Response_SupplierKeyProvisioning_Result>(url, request);
|
||||||
|
return res;
|
||||||
|
}
|
||||||
|
|
||||||
|
//3. SupplierSymmKey
|
||||||
|
public static async Task<SupplierSymmKey.Response_SupplierKeyProvisioning> SupplierSymmKey_SupplierKeyProvisioning(string host, SupplierSymmKey.Request_SupplierKeyProvisioning request)
|
||||||
|
{
|
||||||
|
string url = $"https://{host}:{Port}/kms/SupplierSymmKey/SupplierKeyProvisioning";
|
||||||
|
|
||||||
|
var res = await RestAPI.PostAsync<SupplierSymmKey.Request_SupplierKeyProvisioning, SupplierSymmKey.Response_SupplierKeyProvisioning>(url, request);
|
||||||
|
return res;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static async Task<SupplierSymmKey.Response_SupplierKeyProvisioning_Result> SupplierSymmKey_SupplierKeyProvisioningResult(string host, SupplierSymmKey.Request_SupplierKeyProvisioning_Result request)
|
||||||
|
{
|
||||||
|
string url = $"https://{host}:{Port}/kms/SupplierSymmKey/SupplierKeyProvisioning";
|
||||||
|
|
||||||
|
var res = await RestAPI.PutAsync<SupplierSymmKey.Request_SupplierKeyProvisioning_Result, SupplierSymmKey.Response_SupplierKeyProvisioning_Result>(url, request);
|
||||||
|
return res;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static async Task<SupplierSymmKey.Response_SupplierKeySyncValue> SupplierSymmKey_SupplierKeySyncValue(string host, SupplierSymmKey.Request_SupplierKeySyncValue request)
|
||||||
|
{
|
||||||
|
string url = $"https://{host}:{Port}/kms/SupplierSymmKey/SupplierKeySyncValue";
|
||||||
|
|
||||||
|
var res = await RestAPI.PostAsync<SupplierSymmKey.Request_SupplierKeySyncValue, SupplierSymmKey.Response_SupplierKeySyncValue>(url, request);
|
||||||
|
return res;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static async Task<SupplierSymmKey.Response_SupplierKeySyncValue_Result> SupplierSymmKey_SupplierKeySyncValueResult(string host, SupplierSymmKey.Request_SupplierKeySyncValue_Result request)
|
||||||
|
{
|
||||||
|
string url = $"https://{host}:{Port}/kms/SupplierSymmKey/SupplierKeySyncValue";
|
||||||
|
|
||||||
|
var res = await RestAPI.PutAsync<SupplierSymmKey.Request_SupplierKeySyncValue_Result, SupplierSymmKey.Response_SupplierKeySyncValue_Result>(url, request);
|
||||||
|
return res;
|
||||||
|
}
|
||||||
|
|
||||||
|
//4.SecOCKey
|
||||||
|
public static async Task<SecOCKey.Response_SupplierKeyProvisioning> SecOCKey_SupplierKeyProvisioning(string host, SecOCKey.Request_SupplierKeyProvisioning request)
|
||||||
|
{
|
||||||
|
string url = $"https://{host}:{Port}/kms/SecOCKey/SupplierKeyProvisioning";
|
||||||
|
|
||||||
|
var res = await RestAPI.PostAsync<SecOCKey.Request_SupplierKeyProvisioning, SecOCKey.Response_SupplierKeyProvisioning>(url, request);
|
||||||
|
return res;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static async Task<SecOCKey.Response_SupplierKeyProvisioning_Result> SecOCKey_SupplierKeyProvisioningResult(string host, SecOCKey.Request_SupplierKeyProvisioning_Result request)
|
||||||
|
{
|
||||||
|
string url = $"https://{host}:{Port}/kms/SecOCKey/SupplierKeyProvisioning";
|
||||||
|
|
||||||
|
var res = await RestAPI.PutAsync<SecOCKey.Request_SupplierKeyProvisioning_Result, SecOCKey.Response_SupplierKeyProvisioning_Result>(url, request);
|
||||||
|
return res;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static async Task<SecOCKey.Response_SupplierKeySyncValue> SecOCKey_SupplierKeySyncValue(string host, SecOCKey.Request_SupplierKeySyncValue request)
|
||||||
|
{
|
||||||
|
string url = $"https://{host}:{Port}/kms/SecOCKey/SupplierKeySyncValue";
|
||||||
|
|
||||||
|
var res = await RestAPI.PostAsync<SecOCKey.Request_SupplierKeySyncValue, SecOCKey.Response_SupplierKeySyncValue>(url, request);
|
||||||
|
return res;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static async Task<SecOCKey.Response_SupplierKeySyncValue_Result> SecOCKey_SupplierKeySyncValueResult(string host, SecOCKey.Request_SupplierKeySyncValue_Result request)
|
||||||
|
{
|
||||||
|
string url = $"https://{host}:{Port}/kms/SecOCKey/SupplierKeySyncValue";
|
||||||
|
|
||||||
|
var res = await RestAPI.PutAsync<SecOCKey.Request_SupplierKeySyncValue_Result, SecOCKey.Response_SupplierKeySyncValue_Result>(url, request);
|
||||||
|
return res;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
11
Projects/NetStandard/KmsProxy/KmsProxy.csproj
Normal file
11
Projects/NetStandard/KmsProxy/KmsProxy.csproj
Normal file
@ -0,0 +1,11 @@
|
|||||||
|
<Project Sdk="Microsoft.NET.Sdk">
|
||||||
|
|
||||||
|
<PropertyGroup>
|
||||||
|
<TargetFramework>netstandard2.0</TargetFramework>
|
||||||
|
</PropertyGroup>
|
||||||
|
|
||||||
|
<ItemGroup>
|
||||||
|
<PackageReference Include="Newtonsoft.Json" Version="13.0.4" />
|
||||||
|
</ItemGroup>
|
||||||
|
|
||||||
|
</Project>
|
||||||
219
Projects/NetStandard/KmsProxy/Models/Packet.cs
Normal file
219
Projects/NetStandard/KmsProxy/Models/Packet.cs
Normal file
@ -0,0 +1,219 @@
|
|||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Text;
|
||||||
|
|
||||||
|
namespace KmsProxy.Models
|
||||||
|
{
|
||||||
|
//1. EcuID
|
||||||
|
public class EcuID
|
||||||
|
{
|
||||||
|
public class Request_SupplierEcuID
|
||||||
|
{
|
||||||
|
public string EcuType { get; set; } = "01";
|
||||||
|
public string Phase { get; set; } = "Dev";
|
||||||
|
public string SupplierID { get; set; } = "03";
|
||||||
|
public string EcuID { get; set; } = string.Empty;
|
||||||
|
public string Serial { get; set; } = string.Empty;
|
||||||
|
}
|
||||||
|
|
||||||
|
public class Response_SupplierEcuID : Response_Common
|
||||||
|
{
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
//2. MasterECUKey
|
||||||
|
public class MasterEcuKey
|
||||||
|
{
|
||||||
|
public class Request_SupplierKeyProvisioning
|
||||||
|
{
|
||||||
|
public string ProvisioningType { get; set; } = "EcuMasterKey";
|
||||||
|
public string EcuID { get; set; } = string.Empty;
|
||||||
|
public string KeyID { get; set; } = string.Empty;
|
||||||
|
}
|
||||||
|
public class Response_SupplierKeyProvisioning : Response_Common
|
||||||
|
{
|
||||||
|
public List<SupplierKeyProvisioningRecords> Records { get; set; } = new List<SupplierKeyProvisioningRecords>();
|
||||||
|
|
||||||
|
#region record
|
||||||
|
public class SupplierKeyProvisioningRecords
|
||||||
|
{
|
||||||
|
public string KeyID { get; set; } = string.Empty;
|
||||||
|
public string M1 { get; set; } = string.Empty;
|
||||||
|
public string M2 { get; set; } = string.Empty;
|
||||||
|
public string M3 { get; set; } = string.Empty;
|
||||||
|
public string M4 { get; set; } = string.Empty;
|
||||||
|
public string M5 { get; set; } = string.Empty;
|
||||||
|
}
|
||||||
|
#endregion
|
||||||
|
}
|
||||||
|
|
||||||
|
//
|
||||||
|
public class Request_SupplierKeyProvisioning_Result
|
||||||
|
{
|
||||||
|
public string ProvisioningType { get; set; } = "SupplierSymmKey";
|
||||||
|
public string EcuID { get; set; } = string.Empty;
|
||||||
|
public string ResultMessage { get; set; } = string.Empty;
|
||||||
|
public string ResultStatus { get; set; } = string.Empty;
|
||||||
|
}
|
||||||
|
public class Response_SupplierKeyProvisioning_Result : Response_Common
|
||||||
|
{
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
//3. SupplierSymmKey
|
||||||
|
public class SupplierSymmKey
|
||||||
|
{
|
||||||
|
public class Request_SupplierKeyProvisioning
|
||||||
|
{
|
||||||
|
public string ProvisioningType { get; set; } = "SupplierSymmKey";
|
||||||
|
public string EcuID { get; set; } = string.Empty;
|
||||||
|
public string KeyID { get; set; } = string.Empty;
|
||||||
|
}
|
||||||
|
public class Response_SupplierKeyProvisioning : Response_Common
|
||||||
|
{
|
||||||
|
public List<SupplierKeyProvisioningRecords> Records { get; set; } = new List<SupplierKeyProvisioningRecords>();
|
||||||
|
|
||||||
|
#region record
|
||||||
|
public class SupplierKeyProvisioningRecords
|
||||||
|
{
|
||||||
|
public string M1 { get; set; } = string.Empty;
|
||||||
|
public string M2 { get; set; } = string.Empty;
|
||||||
|
public string M3 { get; set; } = string.Empty;
|
||||||
|
public string M4 { get; set; } = string.Empty;
|
||||||
|
public string M5 { get; set; } = string.Empty;
|
||||||
|
}
|
||||||
|
#endregion
|
||||||
|
}
|
||||||
|
|
||||||
|
//
|
||||||
|
public class Request_SupplierKeyProvisioning_Result
|
||||||
|
{
|
||||||
|
public string ProvisioningType { get; set; } = "SupplierSymmKey";
|
||||||
|
public string EcuID { get; set; } = string.Empty;
|
||||||
|
public string ResultMessage { get; set; } = string.Empty;
|
||||||
|
public string ResultStatus { get; set; } = string.Empty;
|
||||||
|
}
|
||||||
|
public class Response_SupplierKeyProvisioning_Result : Response_Common
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
//
|
||||||
|
public class Request_SupplierKeySyncValue
|
||||||
|
{
|
||||||
|
public string ProvisioningType { get; set; } = "SupplierSymmKey";
|
||||||
|
public string EcuID { get; set; } = string.Empty;
|
||||||
|
public string KeyID { get; set; } = string.Empty;
|
||||||
|
}
|
||||||
|
public class Response_SupplierKeySyncValue : Response_Common
|
||||||
|
{
|
||||||
|
public List<SupplierKeySyncValueRecords> Records { get; set; } = new List<SupplierKeySyncValueRecords>();
|
||||||
|
|
||||||
|
#region record
|
||||||
|
public class SupplierKeySyncValueRecords
|
||||||
|
{
|
||||||
|
public string KeyID { get; set; } = string.Empty;
|
||||||
|
public string KeySyncValue { get; set; } = string.Empty;
|
||||||
|
public string Challenge { get; set; } = string.Empty;
|
||||||
|
}
|
||||||
|
#endregion
|
||||||
|
}
|
||||||
|
|
||||||
|
//
|
||||||
|
public class Request_SupplierKeySyncValue_Result
|
||||||
|
{
|
||||||
|
public string ProvisioningType { get; set; } = "SupplierSymmKey";
|
||||||
|
public string EcuID { get; set; } = string.Empty;
|
||||||
|
public string ResultMessage { get; set; } = string.Empty;
|
||||||
|
public string ResultStatus { get; set; } = string.Empty;
|
||||||
|
}
|
||||||
|
public class Response_SupplierKeySyncValue_Result : Response_Common
|
||||||
|
{
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
//4. SecOCKey
|
||||||
|
public class SecOCKey
|
||||||
|
{
|
||||||
|
public class Request_SupplierKeyProvisioning
|
||||||
|
{
|
||||||
|
public string ProvisioningType { get; set; } = "SecOCKey";
|
||||||
|
public string EcuID { get; set; } = string.Empty;
|
||||||
|
public string KeyID { get; set; } = string.Empty;
|
||||||
|
public string SupplierSecretKey { get; set; } = string.Empty;
|
||||||
|
public string Counter { get; set; } = string.Empty;
|
||||||
|
public string Challenge { get; set; } = string.Empty;
|
||||||
|
}
|
||||||
|
public class Response_SupplierKeyProvisioning : Response_Common
|
||||||
|
{
|
||||||
|
public List<SupplierKeyProvisioningRecords> Records { get; set; } = new List<SupplierKeyProvisioningRecords>();
|
||||||
|
|
||||||
|
#region record
|
||||||
|
public class SupplierKeyProvisioningRecords
|
||||||
|
{
|
||||||
|
public string KeyID { get; set; } = string.Empty;
|
||||||
|
public string M1 { get; set; } = string.Empty;
|
||||||
|
public string M2 { get; set; } = string.Empty;
|
||||||
|
public string M3 { get; set; } = string.Empty;
|
||||||
|
public string M4 { get; set; } = string.Empty;
|
||||||
|
public string M5 { get; set; } = string.Empty;
|
||||||
|
}
|
||||||
|
#endregion
|
||||||
|
}
|
||||||
|
|
||||||
|
//
|
||||||
|
public class Request_SupplierKeyProvisioning_Result
|
||||||
|
{
|
||||||
|
public string ProvisioningType { get; set; } = "SecOCKey";
|
||||||
|
public string EcuID { get; set; } = string.Empty;
|
||||||
|
public string KeyID { get; set; } = string.Empty;
|
||||||
|
public string ResultMessage { get; set; } = string.Empty;
|
||||||
|
public string ResultStatus { get; set; } = string.Empty;
|
||||||
|
}
|
||||||
|
public class Response_SupplierKeyProvisioning_Result : Response_Common
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
//
|
||||||
|
public class Request_SupplierKeySyncValue
|
||||||
|
{
|
||||||
|
public string ProvisioningType { get; set; } = "SecOCKey";
|
||||||
|
public string EcuID { get; set; } = string.Empty;
|
||||||
|
public string KeyID { get; set; } = string.Empty;
|
||||||
|
}
|
||||||
|
public class Response_SupplierKeySyncValue : Response_Common
|
||||||
|
{
|
||||||
|
public List<SupplierKeySyncValueRecords> Records { get; set; } = new List<SupplierKeySyncValueRecords>();
|
||||||
|
|
||||||
|
#region record
|
||||||
|
public class SupplierKeySyncValueRecords
|
||||||
|
{
|
||||||
|
public string KeyID { get; set; } = string.Empty;
|
||||||
|
public string KeySyncValue { get; set; } = string.Empty;
|
||||||
|
public string Challenge { get; set; } = string.Empty;
|
||||||
|
}
|
||||||
|
#endregion
|
||||||
|
}
|
||||||
|
|
||||||
|
//
|
||||||
|
public class Request_SupplierKeySyncValue_Result
|
||||||
|
{
|
||||||
|
public string ProvisioningType { get; set; } = "SecOCKey";
|
||||||
|
public string EcuID { get; set; } = string.Empty;
|
||||||
|
public string KeyID { get; set; } = string.Empty;
|
||||||
|
public string ResultMessage { get; set; } = string.Empty;
|
||||||
|
public string ResultStatus { get; set; } = string.Empty;
|
||||||
|
}
|
||||||
|
public class Response_SupplierKeySyncValue_Result : Response_Common
|
||||||
|
{
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
#region common
|
||||||
|
public class Response_Common
|
||||||
|
{
|
||||||
|
public string ResultStatus { get; set; } = string.Empty;
|
||||||
|
public string ResultReason { get; set; } = string.Empty;
|
||||||
|
public string ResultMessage { get; set; } = string.Empty;
|
||||||
|
}
|
||||||
|
#endregion
|
||||||
|
}
|
||||||
93
Projects/NetStandard/KmsProxy/RestAPI.cs
Normal file
93
Projects/NetStandard/KmsProxy/RestAPI.cs
Normal file
@ -0,0 +1,93 @@
|
|||||||
|
using Newtonsoft.Json;
|
||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Net;
|
||||||
|
using System.Net.Http;
|
||||||
|
using System.Text;
|
||||||
|
using System.Threading.Tasks;
|
||||||
|
|
||||||
|
namespace KmsProxy
|
||||||
|
{
|
||||||
|
public class RestAPI
|
||||||
|
{
|
||||||
|
private static HttpClient RequestClient = new HttpClient();
|
||||||
|
private static HttpClient ResponseClient = new HttpClient();
|
||||||
|
|
||||||
|
static RestAPI()
|
||||||
|
{
|
||||||
|
ServicePointManager.ServerCertificateValidationCallback += (sender, cert, chain, sslPolicyErrors) => true;
|
||||||
|
ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls12;
|
||||||
|
RequestClient.Timeout = TimeSpan.FromMilliseconds(10000);
|
||||||
|
ResponseClient.Timeout = TimeSpan.FromMilliseconds(10000);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static async Task<RESPONSE> PostAsync<REQUEST, RESPONSE>(string Url, REQUEST body) where REQUEST : class where RESPONSE : class
|
||||||
|
{
|
||||||
|
Console.WriteLine(Url);
|
||||||
|
try
|
||||||
|
{
|
||||||
|
if (body != null)
|
||||||
|
{
|
||||||
|
var jsonBody = JsonConvert.SerializeObject(body);
|
||||||
|
var contents = new StringContent(jsonBody, Encoding.UTF8, "application/json");
|
||||||
|
|
||||||
|
var response = await RequestClient.PostAsync(Url, contents);
|
||||||
|
|
||||||
|
var resContentStr = await response.Content.ReadAsStringAsync();
|
||||||
|
return JsonConvert.DeserializeObject<RESPONSE>(resContentStr);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
catch (Exception e)
|
||||||
|
{
|
||||||
|
Console.WriteLine("PostAsync Error");
|
||||||
|
Console.WriteLine(e.Message);
|
||||||
|
}
|
||||||
|
|
||||||
|
return default(RESPONSE);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static async Task<RESPONSE> GetAsync<RESPONSE>(string Url)
|
||||||
|
{
|
||||||
|
try
|
||||||
|
{
|
||||||
|
var response = await ResponseClient.GetAsync(Url);
|
||||||
|
|
||||||
|
var resContentStr = await response.Content.ReadAsStringAsync();
|
||||||
|
return JsonConvert.DeserializeObject<RESPONSE>(resContentStr);
|
||||||
|
|
||||||
|
}
|
||||||
|
catch (Exception e)
|
||||||
|
{
|
||||||
|
Console.WriteLine("GetAsync Error");
|
||||||
|
Console.WriteLine(e.Message);
|
||||||
|
}
|
||||||
|
|
||||||
|
return default(RESPONSE);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static async Task<RESPONSE> PutAsync<REQUEST, RESPONSE>(string Url, REQUEST body) where REQUEST : class where RESPONSE : class
|
||||||
|
{
|
||||||
|
try
|
||||||
|
{
|
||||||
|
if (body != null)
|
||||||
|
{
|
||||||
|
var jsonBody = JsonConvert.SerializeObject(body);
|
||||||
|
var contents = new StringContent(jsonBody, Encoding.UTF8, "application/json");
|
||||||
|
|
||||||
|
var response = await RequestClient.PutAsync(Url, contents);
|
||||||
|
|
||||||
|
var resContentStr = await response.Content.ReadAsStringAsync();
|
||||||
|
return JsonConvert.DeserializeObject<RESPONSE>(resContentStr);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
catch (Exception e)
|
||||||
|
{
|
||||||
|
Console.WriteLine("PostAsync Error");
|
||||||
|
Console.WriteLine(e.Message);
|
||||||
|
}
|
||||||
|
|
||||||
|
return default(RESPONSE);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -9,6 +9,12 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "PlayGround.NetFramework", "
|
|||||||
EndProject
|
EndProject
|
||||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "CIAMaster", "CIAMaster\CIAMaster.csproj", "{E839065B-EB9C-4ADE-93D1-EFE3B03A977F}"
|
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "CIAMaster", "CIAMaster\CIAMaster.csproj", "{E839065B-EB9C-4ADE-93D1-EFE3B03A977F}"
|
||||||
EndProject
|
EndProject
|
||||||
|
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "KmsProxy", "KmsProxy\KmsProxy.csproj", "{73824ACB-4FB9-4E11-9A86-E05471B3C979}"
|
||||||
|
EndProject
|
||||||
|
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "KeficoMailService", "KeficoMailService\KeficoMailService.csproj", "{63FF04EE-D1A5-4406-9267-1EE1E9FBB9E7}"
|
||||||
|
EndProject
|
||||||
|
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "KmsProxy.GUI", "KmsProxy.GUI\KmsProxy.GUI.csproj", "{D93A2424-C404-4731-8835-FC0AEA158310}"
|
||||||
|
EndProject
|
||||||
Global
|
Global
|
||||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||||
Debug|Any CPU = Debug|Any CPU
|
Debug|Any CPU = Debug|Any CPU
|
||||||
@ -27,6 +33,18 @@ Global
|
|||||||
{E839065B-EB9C-4ADE-93D1-EFE3B03A977F}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
{E839065B-EB9C-4ADE-93D1-EFE3B03A977F}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||||
{E839065B-EB9C-4ADE-93D1-EFE3B03A977F}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
{E839065B-EB9C-4ADE-93D1-EFE3B03A977F}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||||
{E839065B-EB9C-4ADE-93D1-EFE3B03A977F}.Release|Any CPU.Build.0 = Release|Any CPU
|
{E839065B-EB9C-4ADE-93D1-EFE3B03A977F}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||||
|
{73824ACB-4FB9-4E11-9A86-E05471B3C979}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||||
|
{73824ACB-4FB9-4E11-9A86-E05471B3C979}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||||
|
{73824ACB-4FB9-4E11-9A86-E05471B3C979}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||||
|
{73824ACB-4FB9-4E11-9A86-E05471B3C979}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||||
|
{63FF04EE-D1A5-4406-9267-1EE1E9FBB9E7}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||||
|
{63FF04EE-D1A5-4406-9267-1EE1E9FBB9E7}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||||
|
{63FF04EE-D1A5-4406-9267-1EE1E9FBB9E7}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||||
|
{63FF04EE-D1A5-4406-9267-1EE1E9FBB9E7}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||||
|
{D93A2424-C404-4731-8835-FC0AEA158310}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||||
|
{D93A2424-C404-4731-8835-FC0AEA158310}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||||
|
{D93A2424-C404-4731-8835-FC0AEA158310}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||||
|
{D93A2424-C404-4731-8835-FC0AEA158310}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||||
EndGlobalSection
|
EndGlobalSection
|
||||||
GlobalSection(SolutionProperties) = preSolution
|
GlobalSection(SolutionProperties) = preSolution
|
||||||
HideSolutionNode = FALSE
|
HideSolutionNode = FALSE
|
||||||
|
|||||||
@ -1,6 +1,6 @@
|
|||||||
<?xml version="1.0" encoding="utf-8" ?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<configuration>
|
<configuration>
|
||||||
<startup>
|
<startup>
|
||||||
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.8.1" />
|
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.8"/>
|
||||||
</startup>
|
</startup>
|
||||||
</configuration>
|
</configuration>
|
||||||
|
|||||||
@ -8,10 +8,11 @@
|
|||||||
<OutputType>Exe</OutputType>
|
<OutputType>Exe</OutputType>
|
||||||
<RootNamespace>PlayGround.NetFramework</RootNamespace>
|
<RootNamespace>PlayGround.NetFramework</RootNamespace>
|
||||||
<AssemblyName>PlayGround.NetFramework</AssemblyName>
|
<AssemblyName>PlayGround.NetFramework</AssemblyName>
|
||||||
<TargetFrameworkVersion>v4.8.1</TargetFrameworkVersion>
|
<TargetFrameworkVersion>v4.8</TargetFrameworkVersion>
|
||||||
<FileAlignment>512</FileAlignment>
|
<FileAlignment>512</FileAlignment>
|
||||||
<AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects>
|
<AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects>
|
||||||
<Deterministic>true</Deterministic>
|
<Deterministic>true</Deterministic>
|
||||||
|
<TargetFrameworkProfile />
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
|
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
|
||||||
<PlatformTarget>AnyCPU</PlatformTarget>
|
<PlatformTarget>AnyCPU</PlatformTarget>
|
||||||
@ -33,9 +34,6 @@
|
|||||||
<WarningLevel>4</WarningLevel>
|
<WarningLevel>4</WarningLevel>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<Reference Include="CPMeta">
|
|
||||||
<HintPath>.\CPMeta.dll</HintPath>
|
|
||||||
</Reference>
|
|
||||||
<Reference Include="Newtonsoft.Json, Version=13.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed, processorArchitecture=MSIL">
|
<Reference Include="Newtonsoft.Json, Version=13.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed, processorArchitecture=MSIL">
|
||||||
<HintPath>..\packages\Newtonsoft.Json.13.0.4\lib\net45\Newtonsoft.Json.dll</HintPath>
|
<HintPath>..\packages\Newtonsoft.Json.13.0.4\lib\net45\Newtonsoft.Json.dll</HintPath>
|
||||||
</Reference>
|
</Reference>
|
||||||
@ -56,5 +54,11 @@
|
|||||||
<None Include="App.config" />
|
<None Include="App.config" />
|
||||||
<None Include="packages.config" />
|
<None Include="packages.config" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
<ItemGroup>
|
||||||
|
<ProjectReference Include="..\KmsProxy\KmsProxy.csproj">
|
||||||
|
<Project>{73824acb-4fb9-4e11-9a86-e05471b3c979}</Project>
|
||||||
|
<Name>KmsProxy</Name>
|
||||||
|
</ProjectReference>
|
||||||
|
</ItemGroup>
|
||||||
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
|
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
|
||||||
</Project>
|
</Project>
|
||||||
@ -1,41 +1,189 @@
|
|||||||
using CPMeta.Models;
|
|
||||||
|
using Newtonsoft.Json;
|
||||||
using System;
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Globalization;
|
||||||
using System.Threading.Tasks;
|
using System.Threading.Tasks;
|
||||||
|
|
||||||
namespace PlayGround.NetFramework
|
namespace PlayGround.NetFramework
|
||||||
{
|
{
|
||||||
|
|
||||||
internal class Program
|
internal class Program
|
||||||
{
|
{
|
||||||
|
public static string SetConvertDateTime(string strGetConvertText)
|
||||||
|
{
|
||||||
|
//입력문자열이 DateTime으로 변환 가능한 표준일때.
|
||||||
|
if(DateTime.TryParse(strGetConvertText, out var convertDate) == true)
|
||||||
|
{
|
||||||
|
Console.WriteLine("[SetConvertDateTime] Convert DateTime Format Success.");
|
||||||
|
return convertDate.ToString("yyyy-MM-dd HH:mm:ss", CultureInfo.InvariantCulture);
|
||||||
|
}
|
||||||
|
|
||||||
|
//입력문자열이 DateTime 표준이 아닐때 그대로 리턴.
|
||||||
|
Console.WriteLine("[SetConvertDateTime] Convert DateTime Format Failed.");
|
||||||
|
return strGetConvertText;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static string SetConvertDateTime(DateTime dateTime)
|
||||||
|
{
|
||||||
|
return(SetConvertDateTime(dateTime.ToString()));
|
||||||
|
}
|
||||||
|
|
||||||
static void Main(string[] args)
|
static void Main(string[] args)
|
||||||
{
|
{
|
||||||
|
//string input
|
||||||
|
DateTime now = DateTime.Now;
|
||||||
|
string convertDate = SetConvertDateTime(now.ToString());
|
||||||
|
Console.WriteLine($"DateTime.Now: {now}");
|
||||||
|
Console.WriteLine($"DateTime.Now.Convert: {convertDate}");
|
||||||
|
Console.WriteLine("");
|
||||||
|
|
||||||
|
string now2 = DateTime.Now.ToString("HH:mm:ss MM-dd-yyyy");
|
||||||
|
string convertDate2 = SetConvertDateTime(now2);
|
||||||
|
Console.WriteLine($"DateTime.Now2: {now2}");
|
||||||
|
Console.WriteLine($"DateTime.Now.Convert2: {convertDate2}");
|
||||||
|
Console.WriteLine("");
|
||||||
|
|
||||||
|
string now3 = "3/3/2026 1:29:43 PM";
|
||||||
|
string convertDate3 = SetConvertDateTime(now3);
|
||||||
|
Console.WriteLine($"DateTime.Now3: {now3}");
|
||||||
|
Console.WriteLine($"DateTime.Now.Convert3: {convertDate3}");
|
||||||
|
Console.WriteLine("");
|
||||||
|
|
||||||
|
//datetime input
|
||||||
|
var now4 = DateTime.Now;
|
||||||
|
string convertDate4 = SetConvertDateTime(now4);
|
||||||
|
Console.WriteLine($"DateTime.Now4: {now4}");
|
||||||
|
Console.WriteLine($"DateTime.Now.Convert4: {convertDate4}");
|
||||||
|
Console.WriteLine("");
|
||||||
|
|
||||||
|
return;
|
||||||
|
|
||||||
|
//html Send
|
||||||
|
//Manager manager = new Manager();
|
||||||
|
|
||||||
|
//Address from = new Address { AddressMail = "TraNotify@kefico.co.kr", AddressName = "" };
|
||||||
|
//List<Address> to = new List<Address> { new Address { AddressMail = "systemx.kjh@systemx.co.kr", AddressName = "" } };
|
||||||
|
//List<Address> cc = new List<Address> { new Address { AddressMail = "systemx.shm@systemx.co.kr", AddressName = "" } };
|
||||||
|
//List<Address> bcc = new List<Address> { };
|
||||||
|
|
||||||
|
//string subject = "TRA 테스트용 메일";
|
||||||
|
//string textSend = manager.SendMailDetail(from, to, cc, bcc, subject, "Tra Notify", MailType.Text);
|
||||||
|
|
||||||
|
|
||||||
|
// string form = manager.GetFormHtml(new HtmlFormType { FormType="", SystemName="" });
|
||||||
|
|
||||||
|
//form = form.Replace("@HEADTITLE@", "헤드타이틀");
|
||||||
|
//form = form.Replace("@TITLE@", "타이틀");
|
||||||
|
//form = form.Replace("@BODY@", "내용");
|
||||||
|
//form = form.Replace("@URL@", "링크");
|
||||||
|
// string htmlSend = manager.SendMailDetail(from, to, cc, bcc, subject, form, MailType.Html);
|
||||||
|
|
||||||
|
|
||||||
|
//Text Send
|
||||||
|
|
||||||
|
|
||||||
|
// //global set
|
||||||
|
// string host = "192.168.0.42";
|
||||||
|
|
||||||
|
// //random value
|
||||||
|
// string ProductId = "00010032-87a4-45ca-b627-b975d41e35df";
|
||||||
|
// // string Mac1 = Guid.NewGuid().ToString();
|
||||||
|
//// string Mac2 = Guid.NewGuid().ToString();
|
||||||
|
|
||||||
|
// //Get
|
||||||
|
// Task.Run(async () =>
|
||||||
|
// {
|
||||||
|
// var res2 = await CPMeta.CPMeta.HealthCheck(host);
|
||||||
|
|
||||||
|
// // var res2 = await CPMeta.CPMeta.GetWbmsMetaByProductId(host, ProductId);
|
||||||
|
|
||||||
|
// Console.ForegroundColor = ConsoleColor.DarkBlue;
|
||||||
|
// Console.WriteLine($"Response: {res2} (Trace Guid:)");
|
||||||
|
// Console.ForegroundColor = ConsoleColor.White;
|
||||||
|
|
||||||
|
// // var res3 = await CPMeta.CPMeta.GetWbmsMetaByMacAddress(host, Mac1);
|
||||||
|
// // var res4 = await CPMeta.CPMeta.GetWbmsMetaByMacAddress(host, Mac2);
|
||||||
|
// }).Wait();
|
||||||
|
|
||||||
|
|
||||||
|
// return;
|
||||||
//global set
|
//global set
|
||||||
string host = "192.168.0.126";
|
string host = "10.224.193.73";
|
||||||
|
|
||||||
//random value
|
|
||||||
string ProductId = Guid.NewGuid().ToString();
|
|
||||||
string Mac1 = Guid.NewGuid().ToString();
|
|
||||||
string Mac2 = Guid.NewGuid().ToString();
|
|
||||||
|
|
||||||
//Set
|
|
||||||
Task.Run(async () =>
|
Task.Run(async () =>
|
||||||
{
|
{
|
||||||
Request_SetWbmsMeta req = new Request_SetWbmsMeta();
|
//1. ecuid
|
||||||
req.ProductID = ProductId;
|
var resEcuid = await KmsProxy.KmsProxy.EcuID_SupplierEcuID(host, new KmsProxy.Models.EcuID.Request_SupplierEcuID
|
||||||
req.MacAddress1 = Mac1;
|
{
|
||||||
req.MacAddress2 = Mac2;
|
EcuID = ""
|
||||||
req.ProductNo = "ProductNo";
|
});
|
||||||
req.Type = "CMU";
|
Console.WriteLine(JsonConvert.SerializeObject(resEcuid, Formatting.Indented));
|
||||||
|
|
||||||
var res = await CPMeta.CPMeta.SetWbmsMetaAsync(host, req);
|
//2. master ecu key
|
||||||
|
var resMasterKeyProvisioning = await KmsProxy.KmsProxy.MasterEcuKey_SupplierKeyProvisioning(host, new KmsProxy.Models.MasterEcuKey.Request_SupplierKeyProvisioning
|
||||||
|
{
|
||||||
|
EcuID = ""
|
||||||
|
});
|
||||||
|
Console.WriteLine(JsonConvert.SerializeObject(resMasterKeyProvisioning, Formatting.Indented));
|
||||||
|
|
||||||
|
var resMasterKeyProvisioningResult = await KmsProxy.KmsProxy.MasterEcuKey_SupplierKeyProvisioningResult(host, new KmsProxy.Models.MasterEcuKey.Request_SupplierKeyProvisioning_Result
|
||||||
|
{
|
||||||
|
EcuID = ""
|
||||||
|
});
|
||||||
|
Console.WriteLine(JsonConvert.SerializeObject(resMasterKeyProvisioningResult, Formatting.Indented));
|
||||||
|
|
||||||
|
//3. SupplierSymmKey
|
||||||
|
var symmKeyProvisioning = await KmsProxy.KmsProxy.SupplierSymmKey_SupplierKeyProvisioning(host, new KmsProxy.Models.SupplierSymmKey.Request_SupplierKeyProvisioning
|
||||||
|
{
|
||||||
|
EcuID = ""
|
||||||
|
});
|
||||||
|
Console.WriteLine(JsonConvert.SerializeObject(symmKeyProvisioning, Formatting.Indented));
|
||||||
|
|
||||||
|
var symmKeyProvisioningResult = await KmsProxy.KmsProxy.SupplierSymmKey_SupplierKeyProvisioningResult(host, new KmsProxy.Models.SupplierSymmKey.Request_SupplierKeyProvisioning_Result
|
||||||
|
{
|
||||||
|
EcuID = ""
|
||||||
|
});
|
||||||
|
Console.WriteLine(JsonConvert.SerializeObject(symmKeyProvisioningResult, Formatting.Indented));
|
||||||
|
|
||||||
|
var symmKeySync = await KmsProxy.KmsProxy.SupplierSymmKey_SupplierKeySyncValue(host, new KmsProxy.Models.SupplierSymmKey.Request_SupplierKeySyncValue
|
||||||
|
{
|
||||||
|
EcuID = ""
|
||||||
|
});
|
||||||
|
Console.WriteLine(JsonConvert.SerializeObject(symmKeySync, Formatting.Indented));
|
||||||
|
|
||||||
|
var symmKeySyncResult = await KmsProxy.KmsProxy.SupplierSymmKey_SupplierKeySyncValueResult(host, new KmsProxy.Models.SupplierSymmKey.Request_SupplierKeySyncValue_Result
|
||||||
|
{
|
||||||
|
EcuID = ""
|
||||||
|
});
|
||||||
|
Console.WriteLine(JsonConvert.SerializeObject(symmKeySyncResult, Formatting.Indented));
|
||||||
|
|
||||||
|
//4. SecOCKey
|
||||||
|
var secOcKeyProvisioning = await KmsProxy.KmsProxy.SecOCKey_SupplierKeyProvisioning(host, new KmsProxy.Models.SecOCKey.Request_SupplierKeyProvisioning
|
||||||
|
{
|
||||||
|
EcuID = ""
|
||||||
|
});
|
||||||
|
Console.WriteLine(JsonConvert.SerializeObject(secOcKeyProvisioning, Formatting.Indented));
|
||||||
|
|
||||||
|
var secOcKeyProvisioningResult = await KmsProxy.KmsProxy.SecOCKey_SupplierKeyProvisioningResult(host, new KmsProxy.Models.SecOCKey.Request_SupplierKeyProvisioning_Result
|
||||||
|
{
|
||||||
|
EcuID = ""
|
||||||
|
});
|
||||||
|
Console.WriteLine(JsonConvert.SerializeObject(secOcKeyProvisioningResult, Formatting.Indented));
|
||||||
|
|
||||||
|
var secOcKeySync = await KmsProxy.KmsProxy.SecOCKey_SupplierKeySyncValue(host, new KmsProxy.Models.SecOCKey.Request_SupplierKeySyncValue
|
||||||
|
{
|
||||||
|
EcuID = ""
|
||||||
|
});
|
||||||
|
Console.WriteLine(JsonConvert.SerializeObject(secOcKeySync, Formatting.Indented));
|
||||||
|
|
||||||
|
var secOcKeySyncResult = await KmsProxy.KmsProxy.SecOCKey_SupplierKeySyncValueResult(host, new KmsProxy.Models.SecOCKey.Request_SupplierKeySyncValue_Result
|
||||||
|
{
|
||||||
|
EcuID = ""
|
||||||
|
});
|
||||||
|
Console.WriteLine(JsonConvert.SerializeObject(secOcKeySyncResult, Formatting.Indented));
|
||||||
|
|
||||||
}).Wait();
|
|
||||||
|
|
||||||
//Get
|
|
||||||
Task.Run(async () =>
|
|
||||||
{
|
|
||||||
var res2 = await CPMeta.CPMeta.GetWbmsMetaByProductId(host, ProductId);
|
|
||||||
var res3 = await CPMeta.CPMeta.GetWbmsMetaByMacAddress(host, Mac1);
|
|
||||||
var res4 = await CPMeta.CPMeta.GetWbmsMetaByMacAddress(host, Mac2);
|
|
||||||
}).Wait();
|
}).Wait();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -139,7 +139,7 @@ namespace SystemX.Core.Services
|
|||||||
return response;
|
return response;
|
||||||
}
|
}
|
||||||
|
|
||||||
protected HttpClientHandler GetClientHandler()
|
protected virtual HttpClientHandler GetClientHandler()
|
||||||
{
|
{
|
||||||
HttpClientHandler clientHandler = new HttpClientHandler();
|
HttpClientHandler clientHandler = new HttpClientHandler();
|
||||||
clientHandler.ServerCertificateCustomValidationCallback = (message, cert, chain, sslPolicyErrors) =>
|
clientHandler.ServerCertificateCustomValidationCallback = (message, cert, chain, sslPolicyErrors) =>
|
||||||
@ -150,7 +150,7 @@ namespace SystemX.Core.Services
|
|||||||
return clientHandler;
|
return clientHandler;
|
||||||
}
|
}
|
||||||
|
|
||||||
protected short SetTimeout(short timeOutSeconds)
|
protected virtual short SetTimeout(short timeOutSeconds)
|
||||||
{
|
{
|
||||||
short timeoutMin = 5;
|
short timeoutMin = 5;
|
||||||
short timeoutMax = 30;
|
short timeoutMax = 30;
|
||||||
|
|||||||
@ -1,5 +1,6 @@
|
|||||||
using Microsoft.OpenApi.Writers;
|
using Microsoft.OpenApi.Writers;
|
||||||
using System.ComponentModel.DataAnnotations;
|
using System.ComponentModel.DataAnnotations;
|
||||||
|
using System.Security.Cryptography.Xml;
|
||||||
|
|
||||||
namespace WebApi.Project.ProxyKMS.Models
|
namespace WebApi.Project.ProxyKMS.Models
|
||||||
{
|
{
|
||||||
@ -101,6 +102,7 @@ namespace WebApi.Project.ProxyKMS.Models
|
|||||||
{
|
{
|
||||||
public string ProvisioningType { get; set; } = string.Empty;
|
public string ProvisioningType { get; set; } = string.Empty;
|
||||||
public string EcuID { get; set; } = string.Empty;
|
public string EcuID { get; set; } = string.Empty;
|
||||||
|
public string KeyID { get; set; } = string.Empty;
|
||||||
}
|
}
|
||||||
public class Response_SupplierKeySyncValue : Response_Common
|
public class Response_SupplierKeySyncValue : Response_Common
|
||||||
{
|
{
|
||||||
@ -176,6 +178,7 @@ namespace WebApi.Project.ProxyKMS.Models
|
|||||||
{
|
{
|
||||||
public string ProvisioningType { get; set; } = string.Empty;
|
public string ProvisioningType { get; set; } = string.Empty;
|
||||||
public string EcuID { get; set; } = string.Empty;
|
public string EcuID { get; set; } = string.Empty;
|
||||||
|
public string KeyID { get; set; } = string.Empty;
|
||||||
}
|
}
|
||||||
public class Response_SupplierKeySyncValue : Response_Common
|
public class Response_SupplierKeySyncValue : Response_Common
|
||||||
{
|
{
|
||||||
|
|||||||
@ -12,6 +12,10 @@ namespace WebApi.Project.ProxyKMS.Models
|
|||||||
public string ApiName { get; set; } = string.Empty;
|
public string ApiName { get; set; } = string.Empty;
|
||||||
|
|
||||||
public List<Function> Functions { get; set; } = new List<Function>();
|
public List<Function> Functions { get; set; } = new List<Function>();
|
||||||
|
|
||||||
|
public bool CertificateVerify { get; set; } = false;
|
||||||
|
public string CertPemPath { get; set; } = string.Empty;
|
||||||
|
public string CertKeyPath { get; set; } = string.Empty;
|
||||||
}
|
}
|
||||||
|
|
||||||
public class Function
|
public class Function
|
||||||
|
|||||||
@ -1,5 +1,7 @@
|
|||||||
using System;
|
using System;
|
||||||
|
using System.Net.Http;
|
||||||
using System.Runtime.CompilerServices;
|
using System.Runtime.CompilerServices;
|
||||||
|
using System.Security.Cryptography.X509Certificates;
|
||||||
using SystemX.Core.DB;
|
using SystemX.Core.DB;
|
||||||
using SystemX.Core.Services;
|
using SystemX.Core.Services;
|
||||||
using WebApi.Library.Enums;
|
using WebApi.Library.Enums;
|
||||||
@ -51,5 +53,121 @@ namespace WebApi.Project.ProxyKMS.Services
|
|||||||
|
|
||||||
return response;
|
return response;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public override async Task<RESPONSE?> PostJsonAsync<REQUEST, RESPONSE>(string url, REQUEST request, short timeOutSeconds = 5) where REQUEST : class where RESPONSE : class
|
||||||
|
{
|
||||||
|
RESPONSE response = null;
|
||||||
|
Guid guid = Guid.NewGuid();
|
||||||
|
var handler = GetClientHandler();
|
||||||
|
using (HttpClient httpClient = new HttpClient(handler))
|
||||||
|
{
|
||||||
|
try
|
||||||
|
{
|
||||||
|
short timeOutSec = SetTimeout(timeOutSeconds);
|
||||||
|
httpClient.Timeout = new TimeSpan(0, 0, timeOutSec);
|
||||||
|
httpClient.BaseAddress = new Uri(url ?? "");
|
||||||
|
LogXnet.WriteLine($"[POST] Request({guid})::{url}{Environment.NewLine}{request?.ToJson()}", LogXLabel.HTTP);
|
||||||
|
DateTime requestTime = DateTime.Now;
|
||||||
|
|
||||||
|
// 추가된 인증서 정보 출력
|
||||||
|
foreach (X509Certificate2 c in handler.ClientCertificates)
|
||||||
|
{
|
||||||
|
LogXnet.WriteLine("Subject: " + c.Subject);
|
||||||
|
LogXnet.WriteLine("Issuer: " + c.Issuer);
|
||||||
|
LogXnet.WriteLine("Thumbprint: " + c.Thumbprint);
|
||||||
|
LogXnet.WriteLine("NotBefore: " + c.NotBefore);
|
||||||
|
LogXnet.WriteLine("NotAfter: " + c.NotAfter);
|
||||||
|
LogXnet.WriteLine("----------------------------");
|
||||||
|
}
|
||||||
|
|
||||||
|
response = await (await httpClient.PostAsJsonAsync(url, request)).Content.ReadFromJsonAsync<RESPONSE>();
|
||||||
|
LogXnet.WriteLine($"[POST] Rseponse({guid}) ({(DateTime.Now - requestTime).TotalSeconds} sec)::{url}{Environment.NewLine}{response?.ToJson()}", LogXLabel.HTTP);
|
||||||
|
}
|
||||||
|
catch (Exception e)
|
||||||
|
{
|
||||||
|
LogXnet.WriteLine(e);
|
||||||
|
LogXnet.WriteLine(e?.InnerException?.InnerException?.Message, LogXLabel.Exception);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return response;
|
||||||
|
}
|
||||||
|
|
||||||
|
public virtual async Task<RESPONSE?> PutJsonAsync<REQUEST, RESPONSE>(string url, REQUEST request, short timeOutSeconds = 5) where REQUEST : class where RESPONSE : class
|
||||||
|
{
|
||||||
|
RESPONSE? response = default(RESPONSE);
|
||||||
|
Guid guid = Guid.NewGuid();
|
||||||
|
|
||||||
|
var handler = GetClientHandler();
|
||||||
|
using (HttpClient httpClient = new HttpClient(handler))
|
||||||
|
{
|
||||||
|
try
|
||||||
|
{
|
||||||
|
var timeOutSec = SetTimeout(timeOutSeconds);
|
||||||
|
httpClient.Timeout = new TimeSpan(0, 0, timeOutSec);
|
||||||
|
httpClient.BaseAddress = new Uri($"{url}");
|
||||||
|
|
||||||
|
LogXnet.WriteLine($"[PUT] Request({guid})::{url}{Environment.NewLine}{request?.ToJson()}", LogXLabel.HTTP);
|
||||||
|
|
||||||
|
DateTime requestTime = DateTime.Now;
|
||||||
|
var res = await httpClient.PutAsJsonAsync(url, request);
|
||||||
|
|
||||||
|
// 추가된 인증서 정보 출력
|
||||||
|
foreach (X509Certificate2 c in handler.ClientCertificates)
|
||||||
|
{
|
||||||
|
LogXnet.WriteLine("Subject: " + c.Subject);
|
||||||
|
LogXnet.WriteLine("Issuer: " + c.Issuer);
|
||||||
|
LogXnet.WriteLine("Thumbprint: " + c.Thumbprint);
|
||||||
|
LogXnet.WriteLine("NotBefore: " + c.NotBefore);
|
||||||
|
LogXnet.WriteLine("NotAfter: " + c.NotAfter);
|
||||||
|
LogXnet.WriteLine("----------------------------");
|
||||||
|
}
|
||||||
|
|
||||||
|
response = await res.Content.ReadFromJsonAsync<RESPONSE>();
|
||||||
|
|
||||||
|
LogXnet.WriteLine($"[PUT] Rseponse({guid}) ({(DateTime.Now - requestTime).TotalSeconds} sec)::{url}{Environment.NewLine}{response?.ToJson()}", LogXLabel.HTTP);
|
||||||
|
}
|
||||||
|
catch (Exception e)
|
||||||
|
{
|
||||||
|
LogXnet.WriteLine(e);
|
||||||
|
LogXnet.WriteLine(e?.InnerException?.InnerException?.Message, LogXLabel.Exception);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return response;
|
||||||
|
}
|
||||||
|
|
||||||
|
protected override HttpClientHandler GetClientHandler()
|
||||||
|
{
|
||||||
|
HttpClientHandler clientHandler = new HttpClientHandler();
|
||||||
|
|
||||||
|
//인증서가 경로에 있으면
|
||||||
|
if (File.Exists(KmsApi.CertPemPath) == true && File.Exists(KmsApi.CertKeyPath) == true)
|
||||||
|
{
|
||||||
|
LogXnet.WriteLine($"Cert.Pem Path:{KmsApi.CertPemPath}", LogXLabel.Debug);
|
||||||
|
LogXnet.WriteLine($"Cert.Key Path:{KmsApi.CertKeyPath}", LogXLabel.Debug);
|
||||||
|
var cert = X509Certificate2.CreateFromPemFile(KmsApi.CertPemPath, KmsApi.CertKeyPath);
|
||||||
|
cert = new X509Certificate2(cert.Export(X509ContentType.Pkcs12));
|
||||||
|
clientHandler.ClientCertificates.Add(cert);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
LogXnet.WriteLine($"File not exist. Cert.Pem Path:{KmsApi.CertPemPath}", LogXLabel.Warning);
|
||||||
|
LogXnet.WriteLine($"File not exist. Cert.Key Path:{KmsApi.CertKeyPath}", LogXLabel.Warning);
|
||||||
|
}
|
||||||
|
|
||||||
|
//ssl 인증서 무시
|
||||||
|
LogXnet.WriteLine($"CertificateVerify:{KmsApi.CertificateVerify}", LogXLabel.Debug);
|
||||||
|
if (KmsApi.CertificateVerify == false)
|
||||||
|
{
|
||||||
|
clientHandler.ServerCertificateCustomValidationCallback = (message, cert, chain, sslPolicyErrors) =>
|
||||||
|
{
|
||||||
|
return true;
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
return clientHandler;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -79,5 +79,18 @@ namespace WebApi.Project.UniqueKeyApi.Controllers
|
|||||||
|
|
||||||
return Results.Ok(response);
|
return Results.Ok(response);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
[HttpGet]
|
||||||
|
public async Task<IResult> GetWbmsLatest([FromQuery] int count = 20, int? ShardID = 1)
|
||||||
|
{
|
||||||
|
Guid guid = Guid.NewGuid();
|
||||||
|
LogXnet.WriteLine($"[Request][{GetRequestMethod()}:{GetMethodName()}][Client IP:{GetClientIP()}][RequestUrl:{GetRequestUrl()}]::({guid}){Environment.NewLine} Count:{count}", LogXLabel.CONTROLLER);
|
||||||
|
|
||||||
|
Response_GetWbms response = await _cpMetaService.GetWbmsLatest(new Request_GetWbmsLatest() { Count = count, ShardID = (int)ShardID }, guid.ToString());
|
||||||
|
|
||||||
|
LogXnet.WriteLine($"[Response]::({guid}){Environment.NewLine} {response.ToJson()}", LogXLabel.CONTROLLER);
|
||||||
|
|
||||||
|
return Results.Ok(response);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -46,6 +46,12 @@ namespace WebApi.Project.UniqueKeyApi.Models
|
|||||||
public int ShardID { get; set; } = 1;
|
public int ShardID { get; set; } = 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public class Request_GetWbmsLatest
|
||||||
|
{
|
||||||
|
public int Count { get; set; } = 20;
|
||||||
|
public int ShardID { get; set; } = 1;
|
||||||
|
}
|
||||||
|
|
||||||
public class Response_GetWbms
|
public class Response_GetWbms
|
||||||
{
|
{
|
||||||
public List<tWbms> Wbms { get; set; }
|
public List<tWbms> Wbms { get; set; }
|
||||||
|
|||||||
@ -309,6 +309,56 @@ namespace WebApi.Project.UniqueKeyApi.Services
|
|||||||
return response;
|
return response;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public async Task<Response_GetWbms> GetWbmsLatest(Request_GetWbmsLatest request, string guid = "")
|
||||||
|
{
|
||||||
|
Response_GetWbms response = new Response_GetWbms();
|
||||||
|
response.Wbms = new List<tWbms>();
|
||||||
|
|
||||||
|
if (request != null)
|
||||||
|
{
|
||||||
|
using (var scope = _scopeFactory.CreateScope())
|
||||||
|
{
|
||||||
|
int shardId = request.ShardID;
|
||||||
|
if (shardId <= 0)
|
||||||
|
shardId = 1;
|
||||||
|
|
||||||
|
var provider = scope.ServiceProvider.GetRequiredService<DbContextProvider>();
|
||||||
|
using (var context = GetCPMetaDBContext(provider, shardId))
|
||||||
|
{
|
||||||
|
if (context is not null)
|
||||||
|
{
|
||||||
|
try
|
||||||
|
{
|
||||||
|
using (var transaction = await context.CreateTransactionAsync(IsolationLevel.ReadUncommitted))
|
||||||
|
{
|
||||||
|
response.Wbms = await context.tWbms.AsNoTracking().OrderByDescending(x => x.cDateTime).Take(request.Count).ToListAsync();
|
||||||
|
|
||||||
|
await context.CloseTransactionAsync(transaction);
|
||||||
|
response.Result = WebApiResult.Success.ToString();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
catch (Exception e)
|
||||||
|
{
|
||||||
|
response.Wbms = null;
|
||||||
|
response.Result = WebApiResult.Failed.ToString();
|
||||||
|
|
||||||
|
LogXnet.WriteLine($"GetWbmsMeta By Latest({request.Count}) Transaction Error::{guid}", LogXLabel.Error);
|
||||||
|
LogXnet.WriteLine(e);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else //invalid shard id
|
||||||
|
{
|
||||||
|
LogXnet.WriteLine($"ShardID Error::{guid}", LogXLabel.Error);
|
||||||
|
response.Result = WebApiResult.Failed.ToString();
|
||||||
|
response.Message = "Invalid shard id";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return response;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
private CPMetaContext? GetCPMetaDBContext(DbContextProvider provider, int dbID)
|
private CPMetaContext? GetCPMetaDBContext(DbContextProvider provider, int dbID)
|
||||||
{
|
{
|
||||||
|
|||||||
@ -15,10 +15,10 @@
|
|||||||
<RadzenPanelMenu>
|
<RadzenPanelMenu>
|
||||||
<RadzenPanelMenuItem Text="Home" Icon="home" Path="/"/>
|
<RadzenPanelMenuItem Text="Home" Icon="home" Path="/"/>
|
||||||
<RadzenPanelMenuItem Text="CPMeta" Icon="assignment" Path="/CpMeta"/>
|
<RadzenPanelMenuItem Text="CPMeta" Icon="assignment" Path="/CpMeta"/>
|
||||||
<RadzenPanelMenuItem Text="ProxyKms" Icon="assignment" Path="/ProxyKms"/>
|
@* <RadzenPanelMenuItem Text="ProxyKms" Icon="assignment" Path="/ProxyKms"/> *@
|
||||||
</RadzenPanelMenu>
|
</RadzenPanelMenu>
|
||||||
</RadzenSidebar>
|
</RadzenSidebar>
|
||||||
<RadzenBody Style="margin:0; padding:1rem; overflow:hidden; font-size: 2rem;">
|
<RadzenBody Style="margin:0; padding:1rem; overflow:auto; font-size: 2rem;">
|
||||||
@Body
|
@Body
|
||||||
</RadzenBody>
|
</RadzenBody>
|
||||||
</RadzenLayout>
|
</RadzenLayout>
|
||||||
|
|||||||
@ -5,6 +5,7 @@
|
|||||||
@using Web.Operation.Services
|
@using Web.Operation.Services
|
||||||
@using Packet
|
@using Packet
|
||||||
|
|
||||||
|
@inject ConfigService<WebClientConfig> _configService
|
||||||
@inject CPMetaService _cpMetaService
|
@inject CPMetaService _cpMetaService
|
||||||
@inject PopupService PopupService
|
@inject PopupService PopupService
|
||||||
|
|
||||||
@ -45,7 +46,11 @@
|
|||||||
</div> *@
|
</div> *@
|
||||||
|
|
||||||
<OperationGrid TDataModel="tWbms" DataList="@response.Wbms">
|
<OperationGrid TDataModel="tWbms" DataList="@response.Wbms">
|
||||||
|
</OperationGrid>
|
||||||
|
|
||||||
|
<br />
|
||||||
|
<RadzenLabel Style="width: 200px; color:darkorange" Text="Latest Data"></RadzenLabel>
|
||||||
|
<OperationGrid TDataModel="tWbms" DataList="@latest.Wbms">
|
||||||
</OperationGrid>
|
</OperationGrid>
|
||||||
|
|
||||||
@code {
|
@code {
|
||||||
@ -55,10 +60,18 @@
|
|||||||
private string SearchProductMacAddress = string.Empty;
|
private string SearchProductMacAddress = string.Empty;
|
||||||
|
|
||||||
Response_GetWbmsMeta response = new Response_GetWbmsMeta();
|
Response_GetWbmsMeta response = new Response_GetWbmsMeta();
|
||||||
|
Response_GetWbmsMeta latest = new Response_GetWbmsMeta();
|
||||||
|
|
||||||
protected override async Task OnInitializedAsync()
|
protected override async Task OnInitializedAsync()
|
||||||
{
|
{
|
||||||
|
ServerAddress = _cpMetaService.ApiHost;
|
||||||
|
|
||||||
|
var apiConfig = _configService.GetConfig().Api.Find(x => x.Id == 1);
|
||||||
|
|
||||||
|
if (apiConfig is not null)
|
||||||
|
{
|
||||||
|
latest = await _cpMetaService.GetWbmsLatest(ServerAddress, apiConfig.LastCount);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private async Task SearchByProductID()
|
private async Task SearchByProductID()
|
||||||
|
|||||||
@ -4,7 +4,7 @@
|
|||||||
@typeparam TDataModel
|
@typeparam TDataModel
|
||||||
|
|
||||||
<RadzenDataGrid class="rz-shadow-1" TItem="TDataModel" Data="@DataList" GridLines="DataGridGridLines.Both"
|
<RadzenDataGrid class="rz-shadow-1" TItem="TDataModel" Data="@DataList" GridLines="DataGridGridLines.Both"
|
||||||
AllowFiltering FilterMode="FilterMode.Simple" AllowColumnResize
|
AllowFiltering FilterMode="FilterMode.Simple" AllowPaging Count=10 PageNumbersCount="10" PagerHorizontalAlign="HorizontalAlign.Center"
|
||||||
SelectionMode="DataGridSelectionMode.Single" Density="@Density.Default">
|
SelectionMode="DataGridSelectionMode.Single" Density="@Density.Default">
|
||||||
<Columns>
|
<Columns>
|
||||||
@foreach (var col in typeof(TDataModel).GetProperties())
|
@foreach (var col in typeof(TDataModel).GetProperties())
|
||||||
|
|||||||
@ -34,6 +34,12 @@
|
|||||||
public int ShardID { get; set; } = 1;
|
public int ShardID { get; set; } = 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public class Request_GetWbmsLatest
|
||||||
|
{
|
||||||
|
public int Count { get; set; } = 20;
|
||||||
|
public int ShardID { get; set; } = 1;
|
||||||
|
}
|
||||||
|
|
||||||
public class Response_GetWbmsMeta
|
public class Response_GetWbmsMeta
|
||||||
{
|
{
|
||||||
public List<tWbms> Wbms { get; set; } = new List<tWbms>();
|
public List<tWbms> Wbms { get; set; } = new List<tWbms>();
|
||||||
|
|||||||
@ -12,7 +12,7 @@ namespace Web.Operation.Services
|
|||||||
private readonly IServiceScopeFactory _scopeFactory;
|
private readonly IServiceScopeFactory _scopeFactory;
|
||||||
private readonly ConfigService<WebClientConfig>? _configService;
|
private readonly ConfigService<WebClientConfig>? _configService;
|
||||||
|
|
||||||
private string ApiHost = string.Empty;
|
public string ApiHost { get; set; } = string.Empty;
|
||||||
|
|
||||||
public CPMetaService(IServiceProvider serviceProvider, IServiceScopeFactory scopeFactory, ConfigService<WebClientConfig> configService)
|
public CPMetaService(IServiceProvider serviceProvider, IServiceScopeFactory scopeFactory, ConfigService<WebClientConfig> configService)
|
||||||
{
|
{
|
||||||
@ -64,5 +64,19 @@ namespace Web.Operation.Services
|
|||||||
|
|
||||||
return res;
|
return res;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public async Task<Response_GetWbmsMeta> GetWbmsLatest(string host, int count = 20, int shardID = 1)
|
||||||
|
{
|
||||||
|
string requestUrl = $"https://{host}/CPMeta/GetWbmsLatest?";
|
||||||
|
requestUrl += $"Count={count}&";
|
||||||
|
requestUrl += $"ShardID={shardID}";
|
||||||
|
|
||||||
|
Http http = new Http();
|
||||||
|
var res = await http.GetJsonAsync<Response_GetWbmsMeta>($"{requestUrl}");
|
||||||
|
|
||||||
|
LogXnet.WriteLine($"{res.ToJson()}", LogXLabel.HTTP);
|
||||||
|
|
||||||
|
return res;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -11,5 +11,6 @@ namespace WebClient.Library.Model
|
|||||||
public int Id { get; set; }
|
public int Id { get; set; }
|
||||||
public string ApiName { get; set; }
|
public string ApiName { get; set; }
|
||||||
public string Host { get; set; }
|
public string Host { get; set; }
|
||||||
|
public int LastCount { get; set; }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user