Table of Contents

Class PackageTrustPolicy

Namespace
Axolotl2D.Packages
Assembly
Axolotl2D.dll

Separately controls package authenticity requirements and permission to execute module code.

public sealed class PackageTrustPolicy
Inheritance
PackageTrustPolicy
Inherited Members

Properties

AllowExecutableCode

Whether a successfully validated package may load its managed code.

public bool AllowExecutableCode { get; }

Property Value

bool

RequireSignature

Whether an unsigned package must be rejected.

public bool RequireSignature { get; }

Property Value

bool

TrustedPublicKeys

Trusted signer IDs mapped to ECDSA public-key PEM text.

public IReadOnlyDictionary<string, string> TrustedPublicKeys { get; }

Property Value

IReadOnlyDictionary<string, string>

Methods

AllowUnsignedExecutableCode()

Explicitly permits unsigned package code. This grants arbitrary code execution.

public static PackageTrustPolicy AllowUnsignedExecutableCode()

Returns

PackageTrustPolicy

ContentOnly(IReadOnlyDictionary<string, string>?)

Permits content but never loads the package assembly.

public static PackageTrustPolicy ContentOnly(IReadOnlyDictionary<string, string>? trustedPublicKeys = null)

Parameters

trustedPublicKeys IReadOnlyDictionary<string, string>

Returns

PackageTrustPolicy

RequireTrustedSignature(IReadOnlyDictionary<string, string>, bool)

Requires a signature from the supplied keyring before optionally allowing code.

public static PackageTrustPolicy RequireTrustedSignature(IReadOnlyDictionary<string, string> trustedPublicKeys, bool allowExecutableCode = true)

Parameters

trustedPublicKeys IReadOnlyDictionary<string, string>
allowExecutableCode bool

Returns

PackageTrustPolicy