Hardcode the Public key of Bunifu.Licensing

This commit is contained in:
hexadecimal
2025-04-24 22:06:25 +03:00
parent 26837b66b2
commit 33a57edc36
4 changed files with 22 additions and 1 deletions
+3
View File
@@ -8,6 +8,9 @@
<AssemblyName>Bunifu.Licensing</AssemblyName>
<GenerateAssemblyInfo>false</GenerateAssemblyInfo>
<EnableDefaultCompileItems>false</EnableDefaultCompileItems>
<SignAssembly>true</SignAssembly>
<AssemblyOriginatorKeyFile>BunifuPublicKey.snk</AssemblyOriginatorKeyFile>
<PublicSign>true</PublicSign>
</PropertyGroup>
<!-- Define framework-specific constants -->
Binary file not shown.
@@ -19,3 +19,11 @@ using System.Runtime.Versioning;
[assembly: AssemblyTitle("Bunifu.Licensing")]
[assembly: TargetPlatform("Windows7.0")]
[assembly: SupportedOSPlatform("Windows7.0")]
// Add the public key for strong name signing
[assembly: AssemblyDelaySign(false)]
// Setting the expected public key token for "f89b4760ba7dcb6b"
// This is 'f89b4760ba7dcb6b' represented as a byte array
[assembly: AssemblyKeyFile("")]
[assembly: AssemblyKeyName("")]
[assembly: InternalsVisibleTo("Bunifu.UI.WinForms, PublicKey=002400000480000094000000060200000024000052534131000400000100010015a63d7b1e081b01dfd944ffa5d44a59339a92a607f9decd3eb33b009dab5a2b92afe61e538d16b2d1feb7808228c32c4e139c19aa4e41c5efad6e20a4d06f7abb18233aeef010506ddbc218feaf8d50aa64f27e8f50cfd655da46af9a596fef982c893f6a4c6327ad4fd30c798a3310551361524f0f699aafa2adda8aa77bf1")]
+10
View File
@@ -0,0 +1,10 @@
$publicKeyHex = "002400000480000094000000060200000024000052534131000400000100010015a63d7b1e081b01dfd944ffa5d44a59339a92a607f9decd3eb33b009dab5a2b92afe61e538d16b2d1feb7808228c32c4e139c19aa4e41c5efad6e20a4d06f7abb18233aeef010506ddbc218feaf8d50aa64f27e8f50cfd655da46af9a596fef982c893f6a4c6327ad4fd30c798a3310551361524f0f699aafa2adda8aa77bf1"
# Convert hex string to byte array
$bytes = for ($i = 0; $i -lt $publicKeyHex.Length; $i += 2) {
[Convert]::ToByte($publicKeyHex.Substring($i, 2), 16)
}
# Write bytes to file
[System.IO.File]::WriteAllBytes("$PSScriptRoot\BunifuPublicKey.snk", $bytes)
Write-Host "Key file created successfully at $PSScriptRoot\BunifuPublicKey.snk"