You are viewing documentation for v1.1. Switch to current version โ†’

๐Ÿ” License Helper

Short Description

Helpers to create, encrypt, and read license files used by Gorgeous Core.

Long Description

FGorgeousCoreLicenseHelper manages encrypted license files stored inside the GorgeousCore plugin. It supports creating license files with multiple entries, decrypting them, appending timestamped entries, and reading historic entries for auditing or validation.

๐Ÿš€ Features

  • Create encrypted license files.
  • Read and decrypt license contents.
  • Append entries and read historic timestamped entries.

CreateEncryptedLicenseFile(const TArray<FString>&, const FString&)

Creates an encrypted license file containing multiple strings. Uses the ProjectId as the AES key material.

Parameter Name Type Description
LicenseStrings TArray<FString> Strings to store in the license file.
ProjectId FString Project ID used as encryption key.
TArray<FString> Data = { TEXT("User:Alice"), TEXT("Tier:Pro") };
bool bOk = FGorgeousCoreLicenseHelper::CreateEncryptedLicenseFile(Data, TEXT("project-123"));

ReadAndDecryptLicenseFile (overloads)

Reads and decrypts the license file returning either the full string array or the first string (backward-compatible overload). Also returns the creation timestamp.

Parameter Name Type Description
ProjectId FString Project ID used as decryption key.
OutLicenseStrings TArray<FString>& (out) Decrypted entries.
OutLicenseString FString& (out) First decrypted entry (overload).
OutDateTime FDateTime& (out) Creation timestamp.
TArray<FString> Entries;
FDateTime Created;
if (FGorgeousCoreLicenseHelper::ReadAndDecryptLicenseFile(TEXT("project-123"), Entries, Created))
{
    // use entries
}

AddLicenseEntry / ReadAllLicenseEntries

Append a timestamped entry to the encrypted license file and read all historic entries with their timestamps.

Parameter Name Type Description
EntryString FString Entry to append.
ProjectId FString Project ID encryption key.
OutEntries TArray<TPair<FDateTime,FString>>& (out) Pairs of timestamp and entry when reading.
FGorgeousCoreLicenseHelper::AddLicenseEntry(TEXT("ActivatedFeatureX"), TEXT("project-123"));
TArray<TPair<FDateTime, FString>> Entries;
FGorgeousCoreLicenseHelper::ReadAllLicenseEntries(TEXT("project-123"), Entries);