RealDocs

UAssetManager::GetCachedPrimaryAssetEncryptionKeyGuid

function Engine Since unknown
#include "Engine/AssetManager.h"
Access: public Specifiers: virtual

Description

Gets the encryption key guid attached to a primary asset, which is invalid if the asset isn't encrypted.

Caveats & Gotchas

  • OutGuid is only meaningful for cooked/packaged builds using encrypted pak chunks; in the editor it typically comes back invalid.
  • Always check FGuid::IsValid() on OutGuid afterward rather than assuming it was set, since an unencrypted asset leaves it untouched.

Signature

virtual void GetCachedPrimaryAssetEncryptionKeyGuid(FPrimaryAssetId InPrimaryAssetId, FGuid& OutGuid)

Parameters

Name Type Description Default
InPrimaryAssetId FPrimaryAssetId The primary asset to look up the cached encryption key guid for.
OutGuid FGuid& Filled with the encryption key guid if the asset is encrypted.

Return Type

void

Example

Check whether a primary asset is encrypted C++
FGuid KeyGuid;
UAssetManager::Get().GetCachedPrimaryAssetEncryptionKeyGuid(MyPrimaryAssetId, KeyGuid);
if (KeyGuid.IsValid())
{
	UE_LOG(LogTemp, Log, TEXT("Asset uses encryption key %s"), *KeyGuid.ToString());
}

Version History

Introduced in: unknown

Version Status Notes
5.6 stable

Feedback

Was this helpful?

Suggest an edit

Select a field above to begin editing.