Skip to content

Class PackKey

Namespace: Apogee.Content.Packs
Assembly: Apogee.Content.dll

The secret that encrypts a game's packs: 32 bytes, written as 64 hexadecimal digits. The build tool and the editor read it from the environment (APOGEE_PACK_KEY, which the .env file of the repository sets), and an export writes it, masked, into the executable of the game it makes (Apogee.Export.PackKeySlot; obfuscation, not protection) so that a shipped game needs no variable. Without a key packs are not encrypted. It is never written to a pack, a log, or an error message.

public sealed class PackKey

Inheritance

object ← PackKey

Inherited Members

object.Equals(object?), object.Equals(object?, object?), object.GetHashCode(), object.GetType(), object.ReferenceEquals(object?, object?), object.ToString()

Constructors

PackKey(ReadOnlySpan<byte>)

public PackKey(ReadOnlySpan<byte> bytes)

Parameters

bytes ReadOnlySpan<byte>

Fields

EnvironmentVariable

The environment variable the tools read the key from.

public const string EnvironmentVariable = "APOGEE_PACK_KEY"

Field Value

string

Methods

FromEnvironment(string)

The key in APOGEE_PACK_KEY, or null when it is not set (packs are then not encrypted).

public static PackKey? FromEnvironment(string variable = "APOGEE_PACK_KEY")

Parameters

variable string

Returns

PackKey?

Exceptions

FormatException

The variable is set to something that is not a key.

Parse(string)

public static PackKey Parse(string text)

Parameters

text string

Returns

PackKey

Exceptions

FormatException

The text is not 64 hexadecimal digits.

ToString()

Returns a string that represents the current object.

public override string ToString()

Returns

string

A string that represents the current object.