Class PackageTrustPolicy
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
RequireSignature
Whether an unsigned package must be rejected.
public bool RequireSignature { get; }
Property Value
TrustedPublicKeys
Trusted signer IDs mapped to ECDSA public-key PEM text.
public IReadOnlyDictionary<string, string> TrustedPublicKeys { get; }
Property Value
Methods
AllowUnsignedExecutableCode()
Explicitly permits unsigned package code. This grants arbitrary code execution.
public static PackageTrustPolicy AllowUnsignedExecutableCode()
Returns
ContentOnly(IReadOnlyDictionary<string, string>?)
Permits content but never loads the package assembly.
public static PackageTrustPolicy ContentOnly(IReadOnlyDictionary<string, string>? trustedPublicKeys = null)
Parameters
trustedPublicKeysIReadOnlyDictionary<string, string>
Returns
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
trustedPublicKeysIReadOnlyDictionary<string, string>allowExecutableCodebool