Simplify constructors

This commit is contained in:
Michiel Hazelhof 2024-03-31 12:01:46 +02:00
parent 43f2a98c17
commit 34b0669540
No known key found for this signature in database
GPG Key ID: EECB9B96355B5EBF

View File

@ -378,8 +378,8 @@ internal class Program
Set("Trial", false);
Set("LicenseType", Enum.Parse(licenseTypeEnum, "User"));
Set("Hash", Convert.ToBase64String((Byte[])type.GetMethod("ComputeHash").Invoke(license, Array.Empty<Object>())));
Set("Signature", Convert.ToBase64String((Byte[])type.GetMethod("Sign").Invoke(license, new Object[] { cert })));
Set("Hash", Convert.ToBase64String((Byte[])type.GetMethod("ComputeHash").Invoke(license, [])));
Set("Signature", Convert.ToBase64String((Byte[])type.GetMethod("Sign").Invoke(license, [cert])));
Console.WriteLine(JsonConvert.SerializeObject(license, Formatting.Indented));
return;
@ -438,8 +438,8 @@ internal class Program
Set("LicenseType", Enum.Parse(licenseTypeEnum, "Organization"));
Set("LimitCollectionCreationDeletion", true); //This will be used in the new version of BitWarden but can be applied now
Set("Hash", Convert.ToBase64String((Byte[])type.GetMethod("ComputeHash").Invoke(license, Array.Empty<Object>())));
Set("Signature", Convert.ToBase64String((Byte[])type.GetMethod("Sign").Invoke(license, new Object[] { cert })));
Set("Hash", Convert.ToBase64String((Byte[])type.GetMethod("ComputeHash").Invoke(license, [])));
Set("Signature", Convert.ToBase64String((Byte[])type.GetMethod("Sign").Invoke(license, [cert])));
Console.WriteLine(JsonConvert.SerializeObject(license, Formatting.Indented));
return;