mirror of
https://github.com/copyrighttxt/watrbx-game-engine.git
synced 2026-09-04 20:57:49 +00:00
35 lines
955 B
C#
35 lines
955 B
C#
using System;
|
|
using System.Collections.Generic;
|
|
using System.Linq;
|
|
using System.Text;
|
|
using System.Security.Cryptography;
|
|
using System.IO;
|
|
|
|
namespace Roblox.Test
|
|
{
|
|
public class ScriptSigner
|
|
{
|
|
public ScriptSigner()
|
|
{
|
|
string path = "Server/RobloxWebSite/Game/rbxPrivate.blob";
|
|
int upcount = 0;
|
|
while (!System.IO.File.Exists(path))
|
|
{
|
|
path = "../" + path;
|
|
|
|
if (upcount++ >= 10)
|
|
{
|
|
throw new FileNotFoundException("Cannot find Server/RobloxWebSite/Game/rbxPrivate.blob in any of the parent directories of the current dir");
|
|
}
|
|
}
|
|
blob = System.IO.File.ReadAllBytes(path);
|
|
}
|
|
private byte[] blob;
|
|
|
|
public string SignScript(string script)
|
|
{
|
|
return "%" + SharedSecurityNotary.CreateSignature(script, blob) + "%" + script;
|
|
}
|
|
}
|
|
}
|