From 8ae1807fc8f5c189f5991c2500a289d21af63ca9 Mon Sep 17 00:00:00 2001 From: John Cardinal Date: Wed, 23 Sep 2026 14:17:59 -0700 Subject: [PATCH] case 4670 v7 key culture fixes to determinant Invariant explicitly --- server/biz/KeyFactory.cs | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/server/biz/KeyFactory.cs b/server/biz/KeyFactory.cs index c3aae91..b598cb7 100644 --- a/server/biz/KeyFactory.cs +++ b/server/biz/KeyFactory.cs @@ -7,6 +7,7 @@ using Org.BouncyCastle.Crypto; using Org.BouncyCastle.OpenSsl; using Sockeye.Models; using Sockeye.Util; +using System.Globalization; @@ -311,12 +312,10 @@ namespace Sockeye.Biz //stamp a unique value in the key so it can be revoked later //used to use the digest value of the key for this with xml key //whole unix timestamp seconds but kept as a double to work beyond 2038 + //case 4670 w.WritePropertyName("Id"); - var vv = Math.Truncate((DateTime.UtcNow.Subtract(new DateTime(1970, 1, 1))).TotalSeconds); - string sId = vv.ToString(); - if (sId.Contains(",")) - sId = sId.Split('.')[0]; - w.WriteValue(sId); + w.WriteValue(Math.Truncate((DateTime.UtcNow.Subtract(new DateTime(1970, 1, 1))).TotalSeconds).ToString(CultureInfo.InvariantCulture)); + w.WritePropertyName("Created"); w.WriteValue(System.DateTime.Now); @@ -348,7 +347,8 @@ namespace Sockeye.Biz w.WriteValue(l.MaintenanceExpire.AddYears(2)); w.WritePropertyName("TotalScheduleableUsers"); - w.WriteValue(l.Users.ToString());//Needs to be a string to match rockfish format + //cae 4670 + w.WriteValue(l.Users.ToString(CultureInfo.InvariantCulture));//Needs to be a string to match rockfish format w.WritePropertyName("Expires"); w.WriteValue(l.MaintenanceExpire);