[성현모] KMS Packet 수정.

This commit is contained in:
SHM
2026-03-03 14:20:49 +09:00
parent 99e5397307
commit 20958808d6
3 changed files with 78 additions and 43 deletions

View File

@ -115,6 +115,8 @@
this.richTextBox21 = new System.Windows.Forms.RichTextBox(); this.richTextBox21 = new System.Windows.Forms.RichTextBox();
this.button11 = new System.Windows.Forms.Button(); this.button11 = new System.Windows.Forms.Button();
this.richTextBox22 = new System.Windows.Forms.RichTextBox(); this.richTextBox22 = new System.Windows.Forms.RichTextBox();
this.textBox1 = new System.Windows.Forms.TextBox();
this.label36 = new System.Windows.Forms.Label();
this.panel1.SuspendLayout(); this.panel1.SuspendLayout();
this.tabControl1.SuspendLayout(); this.tabControl1.SuspendLayout();
this.tabPage1.SuspendLayout(); this.tabPage1.SuspendLayout();
@ -136,6 +138,8 @@
// //
// panel1 // panel1
// //
this.panel1.Controls.Add(this.label36);
this.panel1.Controls.Add(this.textBox1);
this.panel1.Controls.Add(this.textPort); this.panel1.Controls.Add(this.textPort);
this.panel1.Controls.Add(this.label4); this.panel1.Controls.Add(this.label4);
this.panel1.Controls.Add(this.textHost); this.panel1.Controls.Add(this.textHost);
@ -992,6 +996,23 @@
this.richTextBox22.TabIndex = 0; this.richTextBox22.TabIndex = 0;
this.richTextBox22.Text = ""; this.richTextBox22.Text = "";
// //
// textBox1
//
this.textBox1.Location = new System.Drawing.Point(590, 19);
this.textBox1.Name = "textBox1";
this.textBox1.Size = new System.Drawing.Size(399, 21);
this.textBox1.TabIndex = 4;
this.textBox1.Text = "333735413051493048424d55000300010000000000000000000000";
//
// label36
//
this.label36.AutoSize = true;
this.label36.Location = new System.Drawing.Point(492, 24);
this.label36.Name = "label36";
this.label36.Size = new System.Drawing.Size(92, 12);
this.label36.TabIndex = 5;
this.label36.Text = "Example EcuID";
//
// Form1 // Form1
// //
this.AutoScaleDimensions = new System.Drawing.SizeF(7F, 12F); this.AutoScaleDimensions = new System.Drawing.SizeF(7F, 12F);
@ -1123,6 +1144,8 @@
private System.Windows.Forms.RichTextBox richTextBox21; private System.Windows.Forms.RichTextBox richTextBox21;
private System.Windows.Forms.Button button11; private System.Windows.Forms.Button button11;
private System.Windows.Forms.RichTextBox richTextBox22; private System.Windows.Forms.RichTextBox richTextBox22;
private System.Windows.Forms.Label label36;
private System.Windows.Forms.TextBox textBox1;
} }
} }

View File

@ -9,9 +9,9 @@ namespace KmsProxy.Models
{ {
public class Request_SupplierEcuID public class Request_SupplierEcuID
{ {
public string EcuType { get; set; } = string.Empty; public string EcuType { get; set; } = "01";
public string Phase { get; set; } = string.Empty; public string Phase { get; set; } = "Dev";
public string SupplierID { get; set; } = string.Empty; public string SupplierID { get; set; } = "03";
public string EcuID { get; set; } = string.Empty; public string EcuID { get; set; } = string.Empty;
public string Serial { get; set; } = string.Empty; public string Serial { get; set; } = string.Empty;
} }
@ -26,7 +26,7 @@ namespace KmsProxy.Models
{ {
public class Request_SupplierKeyProvisioning public class Request_SupplierKeyProvisioning
{ {
public string ProvisioningType { get; set; } = string.Empty; public string ProvisioningType { get; set; } = "EcuMasterKey";
public string EcuID { get; set; } = string.Empty; public string EcuID { get; set; } = string.Empty;
public string KeyID { get; set; } = string.Empty; public string KeyID { get; set; } = string.Empty;
} }
@ -50,7 +50,7 @@ namespace KmsProxy.Models
// //
public class Request_SupplierKeyProvisioning_Result public class Request_SupplierKeyProvisioning_Result
{ {
public string ProvisioningType { get; set; } = string.Empty; public string ProvisioningType { get; set; } = "SupplierSymmKey";
public string EcuID { get; set; } = string.Empty; public string EcuID { get; set; } = string.Empty;
public string ResultMessage { get; set; } = string.Empty; public string ResultMessage { get; set; } = string.Empty;
public string ResultStatus { get; set; } = string.Empty; public string ResultStatus { get; set; } = string.Empty;
@ -65,7 +65,7 @@ namespace KmsProxy.Models
{ {
public class Request_SupplierKeyProvisioning public class Request_SupplierKeyProvisioning
{ {
public string ProvisioningType { get; set; } = string.Empty; public string ProvisioningType { get; set; } = "SupplierSymmKey";
public string EcuID { get; set; } = string.Empty; public string EcuID { get; set; } = string.Empty;
public string KeyID { get; set; } = string.Empty; public string KeyID { get; set; } = string.Empty;
} }
@ -88,7 +88,7 @@ namespace KmsProxy.Models
// //
public class Request_SupplierKeyProvisioning_Result public class Request_SupplierKeyProvisioning_Result
{ {
public string ProvisioningType { get; set; } = string.Empty; public string ProvisioningType { get; set; } = "SupplierSymmKey";
public string EcuID { get; set; } = string.Empty; public string EcuID { get; set; } = string.Empty;
public string ResultMessage { get; set; } = string.Empty; public string ResultMessage { get; set; } = string.Empty;
public string ResultStatus { get; set; } = string.Empty; public string ResultStatus { get; set; } = string.Empty;
@ -100,7 +100,7 @@ namespace KmsProxy.Models
// //
public class Request_SupplierKeySyncValue public class Request_SupplierKeySyncValue
{ {
public string ProvisioningType { get; set; } = string.Empty; public string ProvisioningType { get; set; } = "SupplierSymmKey";
public string EcuID { get; set; } = string.Empty; public string EcuID { get; set; } = string.Empty;
public string KeyID { get; set; } = string.Empty; public string KeyID { get; set; } = string.Empty;
} }
@ -121,7 +121,7 @@ namespace KmsProxy.Models
// //
public class Request_SupplierKeySyncValue_Result public class Request_SupplierKeySyncValue_Result
{ {
public string ProvisioningType { get; set; } = string.Empty; public string ProvisioningType { get; set; } = "SupplierSymmKey";
public string EcuID { get; set; } = string.Empty; public string EcuID { get; set; } = string.Empty;
public string ResultMessage { get; set; } = string.Empty; public string ResultMessage { get; set; } = string.Empty;
public string ResultStatus { get; set; } = string.Empty; public string ResultStatus { get; set; } = string.Empty;
@ -136,7 +136,7 @@ namespace KmsProxy.Models
{ {
public class Request_SupplierKeyProvisioning public class Request_SupplierKeyProvisioning
{ {
public string ProvisioningType { get; set; } = string.Empty; public string ProvisioningType { get; set; } = "SecOCKey";
public string EcuID { get; set; } = string.Empty; public string EcuID { get; set; } = string.Empty;
public string KeyID { get; set; } = string.Empty; public string KeyID { get; set; } = string.Empty;
public string SupplierSecretKey { get; set; } = string.Empty; public string SupplierSecretKey { get; set; } = string.Empty;
@ -163,7 +163,7 @@ namespace KmsProxy.Models
// //
public class Request_SupplierKeyProvisioning_Result public class Request_SupplierKeyProvisioning_Result
{ {
public string ProvisioningType { get; set; } = string.Empty; public string ProvisioningType { get; set; } = "SecOCKey";
public string EcuID { get; set; } = string.Empty; public string EcuID { get; set; } = string.Empty;
public string KeyID { get; set; } = string.Empty; public string KeyID { get; set; } = string.Empty;
public string ResultMessage { get; set; } = string.Empty; public string ResultMessage { get; set; } = string.Empty;
@ -176,7 +176,7 @@ namespace KmsProxy.Models
// //
public class Request_SupplierKeySyncValue public class Request_SupplierKeySyncValue
{ {
public string ProvisioningType { get; set; } = string.Empty; public string ProvisioningType { get; set; } = "SecOCKey";
public string EcuID { get; set; } = string.Empty; public string EcuID { get; set; } = string.Empty;
public string KeyID { get; set; } = string.Empty; public string KeyID { get; set; } = string.Empty;
} }
@ -197,7 +197,7 @@ namespace KmsProxy.Models
// //
public class Request_SupplierKeySyncValue_Result public class Request_SupplierKeySyncValue_Result
{ {
public string ProvisioningType { get; set; } = string.Empty; public string ProvisioningType { get; set; } = "SecOCKey";
public string EcuID { get; set; } = string.Empty; public string EcuID { get; set; } = string.Empty;
public string KeyID { get; set; } = string.Empty; public string KeyID { get; set; } = string.Empty;
public string ResultMessage { get; set; } = string.Empty; public string ResultMessage { get; set; } = string.Empty;

View File

@ -6,44 +6,56 @@ using System.Globalization;
using System.Threading.Tasks; using System.Threading.Tasks;
namespace PlayGround.NetFramework namespace PlayGround.NetFramework
{ {
public static class Date
{
public static string ToKst24String(DateTimeOffset dateTime)
{
var kstZone = TimeZoneInfo.FindSystemTimeZoneById("Korea Standard Time");
var kst = TimeZoneInfo.ConvertTime(dateTime, kstZone);
return kst.ToString("yyyy-MM-dd HH:mm:ss", CultureInfo.InvariantCulture);
}
}
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)
{ {
// 각 국가 TimeZone 가져오기 //string input
var indiaZone = TimeZoneInfo.FindSystemTimeZoneById("India Standard Time"); DateTime now = DateTime.Now;
var vietnamZone = TimeZoneInfo.FindSystemTimeZoneById("SE Asia Standard Time"); string convertDate = SetConvertDateTime(now.ToString());
var usaEasternZone = TimeZoneInfo.FindSystemTimeZoneById("Eastern Standard Time"); Console.WriteLine($"DateTime.Now: {now}");
var kstZone = TimeZoneInfo.FindSystemTimeZoneById("Korea Standard Time"); Console.WriteLine($"DateTime.Now.Convert: {convertDate}");
Console.WriteLine("");
// 각 국가 현재 시간 생성 string now2 = DateTime.Now.ToString("HH:mm:ss MM-dd-yyyy");
DateTimeOffset indiaNow = TimeZoneInfo.ConvertTime(DateTimeOffset.UtcNow, indiaZone); string convertDate2 = SetConvertDateTime(now2);
DateTimeOffset vietnamNow = TimeZoneInfo.ConvertTime(DateTimeOffset.UtcNow, vietnamZone); Console.WriteLine($"DateTime.Now2: {now2}");
DateTimeOffset usaNow = TimeZoneInfo.ConvertTime(DateTimeOffset.UtcNow, usaEasternZone); Console.WriteLine($"DateTime.Now.Convert2: {convertDate2}");
Console.WriteLine("");
Console.WriteLine("=== 원본 시간 ==="); string now3 = "3/3/2026 1:29:43 PM";
Console.WriteLine($"India : {indiaNow:yyyy-MM-dd HH:mm:ss}"); string convertDate3 = SetConvertDateTime(now3);
Console.WriteLine($"Vietnam : {vietnamNow:yyyy-MM-dd HH:mm:ss}"); Console.WriteLine($"DateTime.Now3: {now3}");
Console.WriteLine($"USA(ET) : {usaNow:yyyy-MM-dd HH:mm:ss}"); Console.WriteLine($"DateTime.Now.Convert3: {convertDate3}");
Console.WriteLine("");
Console.WriteLine(); //datetime input
Console.WriteLine("=== KST 변환 ==="); var now4 = DateTime.Now;
string convertDate4 = SetConvertDateTime(now4);
Console.WriteLine($"India → KST : {Date.ToKst24String(indiaNow)}"); Console.WriteLine($"DateTime.Now4: {now4}");
Console.WriteLine($"Vietnam → KST : {Date.ToKst24String(vietnamNow)}"); Console.WriteLine($"DateTime.Now.Convert4: {convertDate4}");
Console.WriteLine($"USA → KST : {Date.ToKst24String(usaNow)}"); Console.WriteLine("");
return; return;