<PackageReference Include="System.Security.Permissions" Version="5.0.0-preview.1.20120.5" />

DataProtectionPermissionAttribute

Allows security actions for DataProtectionPermission to be applied to code using declarative security. This class cannot be inherited.
public DataProtectionPermissionFlags Flags { get; set; }

Gets or sets the data protection permissions.

public bool ProtectData { get; set; }

Gets or sets a value indicating whether data can be encrypted using the ProtectedData class.

public bool ProtectMemory { get; set; }

Gets or sets a value indicating whether memory can be encrypted using the ProtectedMemory class.

public bool UnprotectData { get; set; }

Gets or sets a value indicating whether data can be unencrypted using the ProtectedData class.

public bool UnprotectMemory { get; set; }

Gets or sets a value indicating whether memory can be unencrypted using the ProtectedMemory class.

Initializes a new instance of the DataProtectionPermissionAttribute class with the specified SecurityAction.