1
0
mirror of https://github.com/bitwarden/server.git synced 2025-06-30 07:36:14 -05:00

licensing signature refactor

This commit is contained in:
Kyle Spearrin
2017-08-16 13:55:01 -04:00
parent 593cfe1f71
commit 912e875a33
3 changed files with 44 additions and 28 deletions

View File

@ -351,5 +351,25 @@ namespace Bit.Core.Utilities
// Standard base64 decoder
return Convert.FromBase64String(output);
}
public static string FormatLicenseSignatureValue(object val)
{
if(val == null)
{
return string.Empty;
}
if(val.GetType() == typeof(DateTime))
{
return ToEpocSeconds((DateTime)val).ToString();
}
if(val.GetType() == typeof(bool))
{
return val.ToString().ToLowerInvariant();
}
return val.ToString();
}
}
}