Skip to content
This repository has been archived by the owner on Jul 1, 2020. It is now read-only.

Generating RSA Key Pair

Süleyman Yasir KULA edited this page May 15, 2020 · 11 revisions

NOTE: the public key is usually embedded into the application (e.g. it can be stored in a string constant) but the private key must be stored in a safe location. If private key is compromised, then we can no longer assume that the xml files are signed by a trusted party.

Click here to show/hide

Use the Patcher generate_rsa_key_pair command:

  • private: the filepath that the private RSA key will be generated at
  • public: the filepath that the public RSA key will be generated at

Example: Patcher generate_rsa_key_pair -private="C:\Users\USERNAME\Desktop\private.key" -public="C:\Users\USERNAME\Desktop\public.key"

Via Scripting API

Click here to show/hide

Namespace: SimplePatchToolSecurity

static void SecurityUtils.CreateRSAKeyPair( out string publicKey, out string privateKey ): creates public and private RSA keys and returns them as raw strings (i.e. it doesn't save the keys to text files)

Example code: SimplePatchToolConsoleApp.Program.GenerateRSAKeyPair

Click here to show/hide

Open Window-Simple Patch Tool window, click the Open Legacy Window button and switch to the SECURITY tab:

unity-security-tab

Then, simply click the Create RSA Key Pair button and select a folder in which the RSA key pair will be generated.

Clone this wiki locally