Android Keystore for Unity

An Android keystore lets you store cryptographic key entries for security. Android Keystore can be used to sign your apk, sign data, store certificates, and a variety of other needs.

To release your app to a marketplace, you will need to setup the keystore. All updates to the same app will require the same key used to setup. This provides a level of security and prevents others from accessing your app without permission.

You can create, configure and load Android keystores in Unity using the built in Keystore Manager.

note
For more information on Android Keystore System, read the Android Documentation

Setup

To generate a keystore and setup, open up your project in Unity.

While in Unity, go to Edit > Project Settings From the left-hand side, locate Player and select the Android tab.

Scroll down to Publishing Settings Click Keystore Manager

In the Keystore Manager, you can use the dropdown to create a new Keystore or select an exisiting one.

Options Descriptions
Keystore dropdown Specifies which keystore to use in the Keystore Manager window. You can either create a new keystore, or load an existing one
Password The password for the keystore. If you create a new keystore, use this to create a password for the keystore. If you load an existing keystore, use this to enter the password for existing keystore.
Confirm Password The confirmed password for the new keystore. Set the value of this property to the same as Password.

Create a New Keystore

  1. Click the Keystore Manager button to open the window.
  2. In the top-left of the window, select the dropdown Keystore > Create New.
  3. You will have two different options to store your keystore.
    • Anywhere - The default location that Unity stores the keystore is the root folder of your project folder.
    • In Dedicated Location - By default, it will be store in your User Home directory. This can be changed by going to Edit > Preferences > External Tools > Android > Keystores Dedicated Location.
  4. Enter the following information for your Keystore. (Be sure to save the information somewhere in a safe place)

Properties Descriptions
Alias A name for your key.
Password The password for your key.
Confirm password Set to the same as Password
Validity (years) The number of years your key is valid for.(Default is 50 years) The same key will be used for updates so this should be the number of years you would like to manage your application for.
First and Last Name Your First and Last Name
Organizational Unit Division you are a part of
Organization Name of you company
City or Locality Your City or locality
State or Province Your State or Province
Country Code Your Country Code

Load a Keystore

  1. To Load the Keystore, Under the Project Keystore heading, enable Custom Keystore.
  2. Click the drop-down below Custom Keystore
  3. Select Browse to load a keystore from your local drive.
  4. Enter the password for the keystore in the Password field.

Select a project key

After loading your keystore, select a key from the keystore to use as the project key.

  1. Navigate to the Android Publishing Settings.
  2. Under the Project Key heading, set Alias to the key you want to use.
  3. In the Password field, enter the password for your key.
note
More Information on Android Keystore for Unity can be found on the Unity Website.

Using the Keystore in WVS

To use your Android Keystore in WVS, you will encode it with OpenSSL as base64. If you don’t already have OpenSSL you can download from their website.

Open the command prompt or terminal and run the following command to encode your Keystore.

openssl base64 -A -in <yourKeystore>.keystore

You can copy the output from the command and store it somewhere safe. This information will be needed when you setup your flows in WVS.

Troubleshooting

For additional support, please reach out to us on our Discord.

Was this helpful?

We would love to hear your feedback, Submit a ticket in our Issue Tracker.


Report a problem with this page.