diff options
author | Viktor Hofer <viktor.hofer@microsoft.com> | 2017-03-30 21:38:31 +0300 |
---|---|---|
committer | Dan Moseley <danmose@microsoft.com> | 2017-03-30 21:38:31 +0300 |
commit | 73da1b3b3472a8bd91e35f91c9a61c3070cb7628 (patch) | |
tree | cf7a05e18a8079b4ac291ed7f3e784d21cfebd34 /src/System.Security.Permissions | |
parent | 755f816d20536dbf87c80baa411a6da00bf94203 (diff) |
Some types missed from System.Security.Permissions (#17677)
* impl stub System.Security.Permissions
* stub for SS.Permissions
* add baseline
* review adjustments
* Do not include sources on netfx build
Diffstat (limited to 'src/System.Security.Permissions')
23 files changed, 627 insertions, 8 deletions
diff --git a/src/System.Security.Permissions/ref/System.Security.Permissions.cs b/src/System.Security.Permissions/ref/System.Security.Permissions.cs index 35bb056435..23bed3cc76 100644 --- a/src/System.Security.Permissions/ref/System.Security.Permissions.cs +++ b/src/System.Security.Permissions/ref/System.Security.Permissions.cs @@ -2,6 +2,9 @@ // The .NET Foundation licenses this file to you under the MIT license. // See the LICENSE file in the project root for more information. +using System.Collections; +using System.Security.Cryptography; + [assembly: System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.Security.IPermission))] [assembly: System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.Security.ISecurityEncodable))] [assembly: System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.Security.SecurityElement))] @@ -366,6 +369,23 @@ namespace System.Security.Permissions Read = 1, Write = 2, } + [AttributeUsage(AttributeTargets.Method | AttributeTargets.Constructor | AttributeTargets.Class | AttributeTargets.Struct | AttributeTargets.Assembly, AllowMultiple = true, Inherited = false)] + public sealed class FileIOPermissionAttribute : CodeAccessSecurityAttribute + { + public FileIOPermissionAttribute(SecurityAction action) : base(action) { } + public string Read { get; set; } + public string Write { get; set; } + public string Append { get; set; } + public string PathDiscovery { get; set; } + public string ViewAccessControl { get; set; } + public string ChangeAccessControl { get; set; } + [Obsolete] + public string All { get; set; } + public string ViewAndModify { get; set; } + public FileIOPermissionAccess AllFiles { get; set; } + public FileIOPermissionAccess AllLocalFiles { get; set; } + public override IPermission CreatePermission() { return null; } + } public sealed partial class GacIdentityPermission : System.Security.CodeAccessPermission { public GacIdentityPermission() { } @@ -415,10 +435,138 @@ namespace System.Security.Permissions Synchronization = 1, UI = 128, } + public enum IsolatedStorageContainment + { + None = 0x00, + DomainIsolationByUser = 0x10, + ApplicationIsolationByUser = 0x15, + AssemblyIsolationByUser = 0x20, + DomainIsolationByMachine = 0x30, + AssemblyIsolationByMachine = 0x40, + ApplicationIsolationByMachine = 0x45, + DomainIsolationByRoamingUser = 0x50, + AssemblyIsolationByRoamingUser = 0x60, + ApplicationIsolationByRoamingUser = 0x65, + AdministerIsolatedStorageByUser = 0x70, + UnrestrictedIsolatedStorage = 0xF0 + } + public sealed class IsolatedStorageFilePermission : IsolatedStoragePermission + { + public IsolatedStorageFilePermission(PermissionState state) : base(state) { } + public override IPermission Union(IPermission target) { return null; } + public override bool IsSubsetOf(IPermission target) { return false; } + public override IPermission Intersect(IPermission target) { return null; } + public override IPermission Copy() { return null; } + public override SecurityElement ToXml() { return null; } + } + [AttributeUsage(AttributeTargets.Method | AttributeTargets.Constructor + | AttributeTargets.Class | AttributeTargets.Struct | AttributeTargets.Assembly, + AllowMultiple = true, Inherited = false)] + sealed public class IsolatedStorageFilePermissionAttribute : IsolatedStoragePermissionAttribute + { + public IsolatedStorageFilePermissionAttribute(SecurityAction action) : base(action) { } + public override IPermission CreatePermission() { return null; } + } + [SecurityPermission(SecurityAction.InheritanceDemand, ControlEvidence = true, ControlPolicy = true)] + public abstract class IsolatedStoragePermission : CodeAccessPermission, IUnrestrictedPermission + { + protected IsolatedStoragePermission(PermissionState state) { } + public long UserQuota { get; set; } + public IsolatedStorageContainment UsageAllowed { get; set; } + public bool IsUnrestricted() { return false; } + public override SecurityElement ToXml() { return default(SecurityElement); } + public override void FromXml(SecurityElement esd) { } + } + public abstract class IsolatedStoragePermissionAttribute : CodeAccessSecurityAttribute + { + protected IsolatedStoragePermissionAttribute(SecurityAction action) : base(action) { } + public long UserQuota { get; set; } + public IsolatedStorageContainment UsageAllowed { get; set; } + } public partial interface IUnrestrictedPermission { bool IsUnrestricted(); } + public sealed class KeyContainerPermission : CodeAccessPermission, IUnrestrictedPermission + { + public KeyContainerPermission(PermissionState state) { } + public KeyContainerPermission(KeyContainerPermissionFlags flags) { } + public KeyContainerPermission(KeyContainerPermissionFlags flags, KeyContainerPermissionAccessEntry[] accessList) { } + public KeyContainerPermissionFlags Flags { get; } + public KeyContainerPermissionAccessEntryCollection AccessEntries { get; } + public bool IsUnrestricted() { return false; } + private bool IsEmpty() { return false; } + public override bool IsSubsetOf(IPermission target) { return false; } + public override IPermission Intersect(IPermission target) { return null; } + public override IPermission Union(IPermission target) { return null; } + public override IPermission Copy() { return null; } + public override SecurityElement ToXml() { return null; } + public override void FromXml(SecurityElement securityElement) { } + } + public sealed class KeyContainerPermissionAccessEntry + { + public KeyContainerPermissionAccessEntry(string keyContainerName, KeyContainerPermissionFlags flags) { } + public KeyContainerPermissionAccessEntry(CspParameters parameters, KeyContainerPermissionFlags flags) { } + public KeyContainerPermissionAccessEntry(string keyStore, string providerName, int providerType, + string keyContainerName, int keySpec, KeyContainerPermissionFlags flags) + { } + public string KeyStore { get; set; } + public string ProviderName { get; set; } + public int ProviderType { get; set; } + public string KeyContainerName { get; set; } + public int KeySpec { get; set; } + public KeyContainerPermissionFlags Flags { get; set; } + public override bool Equals(object o) { return false; } + public override int GetHashCode() { return 0; } + } + public sealed class KeyContainerPermissionAccessEntryCollection : ICollection + { + public KeyContainerPermissionAccessEntry this[int index] { get { return null; } } + public int Count { get; } + public int Add(KeyContainerPermissionAccessEntry accessEntry) { return 0; } + public void Clear() { } + public int IndexOf(KeyContainerPermissionAccessEntry accessEntry) { return 0; } + public void Remove(KeyContainerPermissionAccessEntry accessEntry) { } + public KeyContainerPermissionAccessEntryEnumerator GetEnumerator() { return null; } + public void CopyTo(KeyContainerPermissionAccessEntry[] array, int index) { } + public void CopyTo(Array array, int index) { throw new NotImplementedException(); } + System.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator() { throw new NotImplementedException(); } + public bool IsSynchronized { get; } + public object SyncRoot { get; } + } + public sealed class KeyContainerPermissionAccessEntryEnumerator : System.Collections.IEnumerator + { + public KeyContainerPermissionAccessEntry Current { get; } + object System.Collections.IEnumerator.Current { get; } + public bool MoveNext() { return false; } + public void Reset() { } + } + [AttributeUsage(AttributeTargets.Method | AttributeTargets.Constructor | AttributeTargets.Class | AttributeTargets.Struct | AttributeTargets.Assembly, AllowMultiple = true, Inherited = false)] + public sealed class KeyContainerPermissionAttribute : CodeAccessSecurityAttribute + { + public KeyContainerPermissionAttribute(SecurityAction action) : base(action) { } + public string KeyStore { get; set; } + public string ProviderName { get; set; } + public int ProviderType { get; set; } + public string KeyContainerName { get; set; } + public int KeySpec { get; set; } + public KeyContainerPermissionFlags Flags { get; set; } + public override IPermission CreatePermission() { return null; } + } + public enum KeyContainerPermissionFlags + { + NoFlags = 0x0000, + Create = 0x0001, + Open = 0x0002, + Delete = 0x0004, + Import = 0x0010, + Export = 0x0020, + Sign = 0x0100, + Decrypt = 0x0200, + ViewAcl = 0x1000, + ChangeAcl = 0x2000, + AllFlags = 0x3337 + } [System.AttributeUsageAttribute((System.AttributeTargets)109, AllowMultiple = true, Inherited = false)] public sealed partial class PermissionSetAttribute : System.Security.Permissions.CodeAccessSecurityAttribute { @@ -562,6 +710,37 @@ namespace System.Security.Permissions public string Write { get; set; } public override System.Security.IPermission CreatePermission() { throw null; } } + [SecurityPermission(SecurityAction.InheritanceDemand, ControlEvidence = true, ControlPolicy = true)] + public abstract class ResourcePermissionBase : CodeAccessPermission, IUnrestrictedPermission + { + public const string Any = "*"; + public const string Local = "."; + protected ResourcePermissionBase() { } + protected ResourcePermissionBase(PermissionState state) { } + private static Hashtable CreateHashtable() { return null; } + private string ComputerName { get; set; } + private bool IsEmpty { get; } + protected Type PermissionAccessType { get; set; } + protected string[] TagNames { get; set; } + protected void AddPermissionAccess(ResourcePermissionBaseEntry entry) { } + protected void Clear() { } + public override IPermission Copy() { return null; } + protected ResourcePermissionBaseEntry[] GetPermissionEntries() { return null; } + public override void FromXml(SecurityElement securityElement) { } + public override IPermission Intersect(IPermission target) { return null; } + public override bool IsSubsetOf(IPermission target) { return false; } + public bool IsUnrestricted() { return false; } + protected void RemovePermissionAccess(ResourcePermissionBaseEntry entry) { } + public override SecurityElement ToXml() { return null; } + public override IPermission Union(IPermission target) { return null; } + } + public class ResourcePermissionBaseEntry + { + public ResourcePermissionBaseEntry() { } + public ResourcePermissionBaseEntry(int permissionAccess, string[] permissionAccessPath) { } + public int PermissionAccess { get; } + public string[] PermissionAccessPath { get; } + } public sealed partial class SecurityPermission : System.Security.CodeAccessPermission, System.Security.Permissions.IUnrestrictedPermission { public SecurityPermission(System.Security.Permissions.PermissionState state) { } @@ -594,6 +773,50 @@ namespace System.Security.Permissions public string Site { get; set; } public override System.Security.IPermission CreatePermission() { throw null; } } + public sealed class StorePermission : CodeAccessPermission, IUnrestrictedPermission + { + public StorePermission(PermissionState state) { } + public StorePermission(StorePermissionFlags flag) { } + public StorePermissionFlags Flags { get; set; } + public bool IsUnrestricted() { return false; } + public override IPermission Union(IPermission target) { return null; } + public override bool IsSubsetOf(IPermission target) { return false; } + public override IPermission Intersect(IPermission target) { return null; } + public override IPermission Copy() { return null; } + public override SecurityElement ToXml() { return null; } + public override void FromXml(SecurityElement securityElement) { } + } + [AttributeUsage(AttributeTargets.Method | AttributeTargets.Constructor | AttributeTargets.Class | AttributeTargets.Struct | AttributeTargets.Assembly, AllowMultiple = true, Inherited = false)] + public sealed class StorePermissionAttribute : CodeAccessSecurityAttribute + { + public StorePermissionAttribute(SecurityAction action) : base(action) { } + public StorePermissionFlags Flags { get; set; } + public bool CreateStore { get; set; } + public bool DeleteStore { get; set; } + public bool EnumerateStores { get; set; } + public bool OpenStore { get; set; } + public bool AddToStore { get; set; } + public bool RemoveFromStore { get; set; } + public bool EnumerateCertificates { get; set; } + public override IPermission CreatePermission() { return null; } + } + [Flags] + public enum StorePermissionFlags + { + NoFlags = 0x00, + + CreateStore = 0x01, + DeleteStore = 0x02, + EnumerateStores = 0x04, + + OpenStore = 0x10, + AddToStore = 0x20, + RemoveFromStore = 0x40, + EnumerateCertificates = 0x80, + + AllFlags = 0xF7 + } + public sealed partial class StrongNameIdentityPermission : System.Security.CodeAccessPermission { public StrongNameIdentityPermission(System.Security.Permissions.PermissionState state) { } @@ -637,6 +860,14 @@ namespace System.Security.Permissions public override System.Security.SecurityElement ToXml() { throw null; } public override System.Security.IPermission Union(System.Security.IPermission target) { throw null; } } + [AttributeUsage(AttributeTargets.Method | AttributeTargets.Constructor | AttributeTargets.Class | AttributeTargets.Struct | AttributeTargets.Assembly, AllowMultiple = true, Inherited = false)] + public sealed class TypeDescriptorPermissionAttribute : CodeAccessSecurityAttribute + { + public TypeDescriptorPermissionAttribute(SecurityAction action) : base(action) { } + public TypeDescriptorPermissionFlags Flags { get; set; } + public bool RestrictedRegistrationAccess { get; set; } + public override IPermission CreatePermission() { return null; } + } [System.FlagsAttribute] public enum TypeDescriptorPermissionFlags { diff --git a/src/System.Security.Permissions/src/ApiCompatBaseline.net463.txt b/src/System.Security.Permissions/src/ApiCompatBaseline.net463.txt deleted file mode 100644 index 6d32d0ba32..0000000000 --- a/src/System.Security.Permissions/src/ApiCompatBaseline.net463.txt +++ /dev/null @@ -1,6 +0,0 @@ -CannotAddAbstractMembers : Member 'System.Security.CodeAccessPermission.FromXml(System.Security.SecurityElement)' is abstract in the implementation but is missing in the contract. -CannotAddAbstractMembers : Member 'System.Security.CodeAccessPermission.ToXml()' is abstract in the implementation but is missing in the contract. -InterfacesShouldHaveSameMembers : Implementation interface member 'System.Security.ISecurityEncodable.FromXml(System.Security.SecurityElement)' is not in the contract. -InterfacesShouldHaveSameMembers : Implementation interface member 'System.Security.ISecurityEncodable.ToXml()' is not in the contract. -InterfacesShouldHaveSameMembers : Implementation interface member 'System.Security.ISecurityPolicyEncodable.FromXml(System.Security.SecurityElement, System.Security.Policy.PolicyLevel)' is not in the contract. -InterfacesShouldHaveSameMembers : Implementation interface member 'System.Security.ISecurityPolicyEncodable.ToXml(System.Security.Policy.PolicyLevel)' is not in the contract. diff --git a/src/System.Security.Permissions/src/ApiCompatBaseline.netfx.txt b/src/System.Security.Permissions/src/ApiCompatBaseline.netfx.txt new file mode 100644 index 0000000000..b4aedd7cc7 --- /dev/null +++ b/src/System.Security.Permissions/src/ApiCompatBaseline.netfx.txt @@ -0,0 +1,5 @@ +Compat issues with assembly System.Security.Permissions: +MembersMustExist : Member 'System.Security.Permissions.KeyContainerPermissionAccessEntryCollection..ctor()' does not exist in the implementation but it does exist in the contract. +MembersMustExist : Member 'System.Security.Permissions.KeyContainerPermissionAccessEntryCollection.CopyTo(System.Array, System.Int32)' does not exist in the implementation but it does exist in the contract. +MembersMustExist : Member 'System.Security.Permissions.KeyContainerPermissionAccessEntryEnumerator..ctor()' does not exist in the implementation but it does exist in the contract. +Total Issues: 3 diff --git a/src/System.Security.Permissions/src/System.Security.Permissions.csproj b/src/System.Security.Permissions/src/System.Security.Permissions.csproj index dbfd54e937..526d369855 100644 --- a/src/System.Security.Permissions/src/System.Security.Permissions.csproj +++ b/src/System.Security.Permissions/src/System.Security.Permissions.csproj @@ -127,11 +127,32 @@ <Reference Include="System.Runtime" /> <Reference Include="System.Runtime.Extensions" /> <Reference Include="System.Security.AccessControl" /> + <Reference Include="System.Security.Cryptography.Csp" /> <Reference Include="System.Security.Cryptography.Primitives" /> <Reference Include="System.Security.Cryptography.X509Certificates" /> <Reference Include="System.Security.Principal" /> <Reference Include="System.Threading" /> <Reference Include="System.Threading.Thread" /> </ItemGroup> + <ItemGroup Condition="'$(TargetGroup)' == 'uap' Or '$(TargetGroup)' == 'netcoreapp'"> + <Compile Include="System\Security\Permissions\FileIOPermissionAttribute.cs" /> + <Compile Include="System\Security\Permissions\IsolatedStorageContainment.cs" /> + <Compile Include="System\Security\Permissions\IsolatedStorageFilePermission.cs" /> + <Compile Include="System\Security\Permissions\IsolatedStorageFilePermissionAttribute.cs" /> + <Compile Include="System\Security\Permissions\IsolatedStoragePermission.cs" /> + <Compile Include="System\Security\Permissions\IsolatedStoragePermissionAttribute.cs" /> + <Compile Include="System\Security\Permissions\KeyContainerPermission.cs" /> + <Compile Include="System\Security\Permissions\KeyContainerPermissionAccessEntry.cs" /> + <Compile Include="System\Security\Permissions\KeyContainerPermissionAccessEntryCollection.cs" /> + <Compile Include="System\Security\Permissions\KeyContainerPermissionAccessEntryEnumerator.cs" /> + <Compile Include="System\Security\Permissions\KeyContainerPermissionAttribute.cs" /> + <Compile Include="System\Security\Permissions\KeyContainerPermissionFlags.cs" /> + <Compile Include="System\Security\Permissions\ResourcePermissionBase.cs" /> + <Compile Include="System\Security\Permissions\ResourcePermissionBaseEntry.cs" /> + <Compile Include="System\Security\Permissions\StorePermission.cs" /> + <Compile Include="System\Security\Permissions\StorePermissionAttribute.cs" /> + <Compile Include="System\Security\Permissions\StorePermissionFlags.cs" /> + <Compile Include="System\Security\Permissions\TypeDescriptorPermissionAttribute.cs" /> + </ItemGroup> <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.targets))\dir.targets" /> </Project>
\ No newline at end of file diff --git a/src/System.Security.Permissions/src/System/Security/Permissions/FileDialogPermission.cs b/src/System.Security.Permissions/src/System/Security/Permissions/FileDialogPermission.cs index ea190107d6..d00edf3c20 100644 --- a/src/System.Security.Permissions/src/System/Security/Permissions/FileDialogPermission.cs +++ b/src/System.Security.Permissions/src/System/Security/Permissions/FileDialogPermission.cs @@ -7,9 +7,9 @@ namespace System.Security.Permissions [Serializable] public sealed partial class FileDialogPermission : CodeAccessPermission, IUnrestrictedPermission { - public FileDialogPermission(System.Security.Permissions.FileDialogPermissionAccess access) { } + public FileDialogPermission(FileDialogPermissionAccess access) { } public FileDialogPermission(PermissionState state) { } - public System.Security.Permissions.FileDialogPermissionAccess Access { get; set; } + public FileDialogPermissionAccess Access { get; set; } public override IPermission Copy() { return this; } public override void FromXml(SecurityElement esd) { } public override IPermission Intersect(IPermission target) { return default(IPermission); } diff --git a/src/System.Security.Permissions/src/System/Security/Permissions/FileIOPermissionAttribute.cs b/src/System.Security.Permissions/src/System/Security/Permissions/FileIOPermissionAttribute.cs new file mode 100644 index 0000000000..1af1cd3cc8 --- /dev/null +++ b/src/System.Security.Permissions/src/System/Security/Permissions/FileIOPermissionAttribute.cs @@ -0,0 +1,24 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. +// See the LICENSE file in the project root for more information. + +namespace System.Security.Permissions +{ + [AttributeUsage(AttributeTargets.Method | AttributeTargets.Constructor | AttributeTargets.Class | AttributeTargets.Struct | AttributeTargets.Assembly, AllowMultiple = true, Inherited = false)] + public sealed class FileIOPermissionAttribute : CodeAccessSecurityAttribute + { + public FileIOPermissionAttribute(SecurityAction action) : base(action) { } + public string Read { get; set; } + public string Write { get; set; } + public string Append { get; set; } + public string PathDiscovery { get; set; } + public string ViewAccessControl { get; set; } + public string ChangeAccessControl { get; set; } + [Obsolete] + public string All { get; set; } + public string ViewAndModify { get; set; } + public FileIOPermissionAccess AllFiles { get; set; } + public FileIOPermissionAccess AllLocalFiles { get; set; } + public override IPermission CreatePermission() { return null; } + } +}
\ No newline at end of file diff --git a/src/System.Security.Permissions/src/System/Security/Permissions/IsolatedStorageContainment.cs b/src/System.Security.Permissions/src/System/Security/Permissions/IsolatedStorageContainment.cs new file mode 100644 index 0000000000..9b876d0b58 --- /dev/null +++ b/src/System.Security.Permissions/src/System/Security/Permissions/IsolatedStorageContainment.cs @@ -0,0 +1,23 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. +// See the LICENSE file in the project root for more information. + +namespace System.Security.Permissions +{ + public enum IsolatedStorageContainment + { + None = 0x00, + DomainIsolationByUser = 0x10, + ApplicationIsolationByUser = 0x15, + AssemblyIsolationByUser = 0x20, + DomainIsolationByMachine = 0x30, + AssemblyIsolationByMachine = 0x40, + ApplicationIsolationByMachine = 0x45, + DomainIsolationByRoamingUser = 0x50, + AssemblyIsolationByRoamingUser = 0x60, + ApplicationIsolationByRoamingUser = 0x65, + AdministerIsolatedStorageByUser = 0x70, + //AdministerIsolatedStorageByMachine = 0x80, + UnrestrictedIsolatedStorage = 0xF0 + } +} diff --git a/src/System.Security.Permissions/src/System/Security/Permissions/IsolatedStorageFilePermission.cs b/src/System.Security.Permissions/src/System/Security/Permissions/IsolatedStorageFilePermission.cs new file mode 100644 index 0000000000..2508806cd1 --- /dev/null +++ b/src/System.Security.Permissions/src/System/Security/Permissions/IsolatedStorageFilePermission.cs @@ -0,0 +1,16 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. +// See the LICENSE file in the project root for more information. + +namespace System.Security.Permissions +{ + public sealed class IsolatedStorageFilePermission : IsolatedStoragePermission + { + public IsolatedStorageFilePermission(PermissionState state) : base(state) { } + public override IPermission Union(IPermission target) { return null; } + public override bool IsSubsetOf(IPermission target) { return false; } + public override IPermission Intersect(IPermission target) { return null; } + public override IPermission Copy() { return null; } + public override SecurityElement ToXml() { return null; } + } +} diff --git a/src/System.Security.Permissions/src/System/Security/Permissions/IsolatedStorageFilePermissionAttribute.cs b/src/System.Security.Permissions/src/System/Security/Permissions/IsolatedStorageFilePermissionAttribute.cs new file mode 100644 index 0000000000..948fb97727 --- /dev/null +++ b/src/System.Security.Permissions/src/System/Security/Permissions/IsolatedStorageFilePermissionAttribute.cs @@ -0,0 +1,16 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. +// See the LICENSE file in the project root for more information. + +namespace System.Security.Permissions +{ + [AttributeUsage(AttributeTargets.Method | AttributeTargets.Constructor + | AttributeTargets.Class | AttributeTargets.Struct | AttributeTargets.Assembly, + AllowMultiple = true, Inherited = false)] + sealed public class IsolatedStorageFilePermissionAttribute : IsolatedStoragePermissionAttribute + { + public IsolatedStorageFilePermissionAttribute(SecurityAction action) : base(action) { } + public override IPermission CreatePermission() { return null; } + } + +} diff --git a/src/System.Security.Permissions/src/System/Security/Permissions/IsolatedStoragePermission.cs b/src/System.Security.Permissions/src/System/Security/Permissions/IsolatedStoragePermission.cs new file mode 100644 index 0000000000..2b0dbbdc99 --- /dev/null +++ b/src/System.Security.Permissions/src/System/Security/Permissions/IsolatedStoragePermission.cs @@ -0,0 +1,17 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. +// See the LICENSE file in the project root for more information. + +namespace System.Security.Permissions +{ + [SecurityPermission(SecurityAction.InheritanceDemand, ControlEvidence = true, ControlPolicy = true)] + public abstract class IsolatedStoragePermission : CodeAccessPermission, IUnrestrictedPermission + { + protected IsolatedStoragePermission(PermissionState state) { } + public long UserQuota { get; set; } + public IsolatedStorageContainment UsageAllowed { get; set; } + public bool IsUnrestricted() { return false; } + public override SecurityElement ToXml() { return default(SecurityElement); } + public override void FromXml(SecurityElement esd) { } + } +} diff --git a/src/System.Security.Permissions/src/System/Security/Permissions/IsolatedStoragePermissionAttribute.cs b/src/System.Security.Permissions/src/System/Security/Permissions/IsolatedStoragePermissionAttribute.cs new file mode 100644 index 0000000000..37a23c6488 --- /dev/null +++ b/src/System.Security.Permissions/src/System/Security/Permissions/IsolatedStoragePermissionAttribute.cs @@ -0,0 +1,13 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. +// See the LICENSE file in the project root for more information. + +namespace System.Security.Permissions +{ + public abstract class IsolatedStoragePermissionAttribute : CodeAccessSecurityAttribute + { + protected IsolatedStoragePermissionAttribute(SecurityAction action) : base(action) { } + public long UserQuota { get; set; } + public IsolatedStorageContainment UsageAllowed { get; set; } + } +} diff --git a/src/System.Security.Permissions/src/System/Security/Permissions/KeyContainerPermission.cs b/src/System.Security.Permissions/src/System/Security/Permissions/KeyContainerPermission.cs new file mode 100644 index 0000000000..ee2b98f469 --- /dev/null +++ b/src/System.Security.Permissions/src/System/Security/Permissions/KeyContainerPermission.cs @@ -0,0 +1,23 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. +// See the LICENSE file in the project root for more information. + +namespace System.Security.Permissions +{ + public sealed class KeyContainerPermission : CodeAccessPermission, IUnrestrictedPermission + { + public KeyContainerPermission(PermissionState state) { } + public KeyContainerPermission(KeyContainerPermissionFlags flags) { } + public KeyContainerPermission(KeyContainerPermissionFlags flags, KeyContainerPermissionAccessEntry[] accessList) { } + public KeyContainerPermissionFlags Flags { get; } + public KeyContainerPermissionAccessEntryCollection AccessEntries { get; } + public bool IsUnrestricted() { return false; } + private bool IsEmpty() { return false; } + public override bool IsSubsetOf(IPermission target) { return false; } + public override IPermission Intersect(IPermission target) { return null; } + public override IPermission Union(IPermission target) { return null; } + public override IPermission Copy() { return null; } + public override SecurityElement ToXml() { return null; } + public override void FromXml(SecurityElement securityElement) { } + } +}
\ No newline at end of file diff --git a/src/System.Security.Permissions/src/System/Security/Permissions/KeyContainerPermissionAccessEntry.cs b/src/System.Security.Permissions/src/System/Security/Permissions/KeyContainerPermissionAccessEntry.cs new file mode 100644 index 0000000000..56f4eb5309 --- /dev/null +++ b/src/System.Security.Permissions/src/System/Security/Permissions/KeyContainerPermissionAccessEntry.cs @@ -0,0 +1,25 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. +// See the LICENSE file in the project root for more information. + +using System.Security.Cryptography; + +namespace System.Security.Permissions +{ + public sealed class KeyContainerPermissionAccessEntry + { + public KeyContainerPermissionAccessEntry(string keyContainerName, KeyContainerPermissionFlags flags) { } + public KeyContainerPermissionAccessEntry(CspParameters parameters, KeyContainerPermissionFlags flags) { } + public KeyContainerPermissionAccessEntry(string keyStore, string providerName, int providerType, + string keyContainerName, int keySpec, KeyContainerPermissionFlags flags) + { } + public string KeyStore { get; set; } + public string ProviderName { get; set; } + public int ProviderType { get; set; } + public string KeyContainerName { get; set; } + public int KeySpec { get; set; } + public KeyContainerPermissionFlags Flags { get; set; } + public override bool Equals(object o) { return false; } + public override int GetHashCode() { return 0; } + } +} diff --git a/src/System.Security.Permissions/src/System/Security/Permissions/KeyContainerPermissionAccessEntryCollection.cs b/src/System.Security.Permissions/src/System/Security/Permissions/KeyContainerPermissionAccessEntryCollection.cs new file mode 100644 index 0000000000..28300db1e6 --- /dev/null +++ b/src/System.Security.Permissions/src/System/Security/Permissions/KeyContainerPermissionAccessEntryCollection.cs @@ -0,0 +1,24 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. +// See the LICENSE file in the project root for more information. + +using System.Collections; + +namespace System.Security.Permissions +{ + public sealed class KeyContainerPermissionAccessEntryCollection : ICollection + { + public KeyContainerPermissionAccessEntry this[int index] { get { return null; } } + public int Count { get; } + public int Add(KeyContainerPermissionAccessEntry accessEntry) { return 0; } + public void Clear() { } + public int IndexOf(KeyContainerPermissionAccessEntry accessEntry) { return 0; } + public void Remove(KeyContainerPermissionAccessEntry accessEntry) { } + public KeyContainerPermissionAccessEntryEnumerator GetEnumerator() { return null; } + public void CopyTo(KeyContainerPermissionAccessEntry[] array, int index) { } + public void CopyTo(Array array, int index) { throw new NotImplementedException(); } + IEnumerator IEnumerable.GetEnumerator() { throw new NotImplementedException(); } + public bool IsSynchronized { get; } + public object SyncRoot { get; } + } +} diff --git a/src/System.Security.Permissions/src/System/Security/Permissions/KeyContainerPermissionAccessEntryEnumerator.cs b/src/System.Security.Permissions/src/System/Security/Permissions/KeyContainerPermissionAccessEntryEnumerator.cs new file mode 100644 index 0000000000..6875708f67 --- /dev/null +++ b/src/System.Security.Permissions/src/System/Security/Permissions/KeyContainerPermissionAccessEntryEnumerator.cs @@ -0,0 +1,16 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. +// See the LICENSE file in the project root for more information. + +using System.Collections; + +namespace System.Security.Permissions +{ + public sealed class KeyContainerPermissionAccessEntryEnumerator : IEnumerator + { + public KeyContainerPermissionAccessEntry Current { get; } + object IEnumerator.Current { get; } + public bool MoveNext() { return false; } + public void Reset() { } + } +} diff --git a/src/System.Security.Permissions/src/System/Security/Permissions/KeyContainerPermissionAttribute.cs b/src/System.Security.Permissions/src/System/Security/Permissions/KeyContainerPermissionAttribute.cs new file mode 100644 index 0000000000..029cf3b0e6 --- /dev/null +++ b/src/System.Security.Permissions/src/System/Security/Permissions/KeyContainerPermissionAttribute.cs @@ -0,0 +1,19 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. +// See the LICENSE file in the project root for more information. + +namespace System.Security.Permissions +{ + [AttributeUsage(AttributeTargets.Method | AttributeTargets.Constructor | AttributeTargets.Class | AttributeTargets.Struct | AttributeTargets.Assembly, AllowMultiple = true, Inherited = false)] + public sealed class KeyContainerPermissionAttribute : CodeAccessSecurityAttribute + { + public KeyContainerPermissionAttribute(SecurityAction action) : base(action) { } + public string KeyStore { get; set; } + public string ProviderName { get; set; } + public int ProviderType { get; set; } + public string KeyContainerName { get; set; } + public int KeySpec { get; set; } + public KeyContainerPermissionFlags Flags { get; set; } + public override IPermission CreatePermission() { return null; } + } +} diff --git a/src/System.Security.Permissions/src/System/Security/Permissions/KeyContainerPermissionFlags.cs b/src/System.Security.Permissions/src/System/Security/Permissions/KeyContainerPermissionFlags.cs new file mode 100644 index 0000000000..89bfb3556c --- /dev/null +++ b/src/System.Security.Permissions/src/System/Security/Permissions/KeyContainerPermissionFlags.cs @@ -0,0 +1,26 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. +// See the LICENSE file in the project root for more information. + +namespace System.Security.Permissions +{ + public enum KeyContainerPermissionFlags + { + NoFlags = 0x0000, + + Create = 0x0001, + Open = 0x0002, + Delete = 0x0004, + + Import = 0x0010, + Export = 0x0020, + + Sign = 0x0100, + Decrypt = 0x0200, + + ViewAcl = 0x1000, + ChangeAcl = 0x2000, + + AllFlags = 0x3337 + } +} diff --git a/src/System.Security.Permissions/src/System/Security/Permissions/ResourcePermissionBase.cs b/src/System.Security.Permissions/src/System/Security/Permissions/ResourcePermissionBase.cs new file mode 100644 index 0000000000..e34ae4d471 --- /dev/null +++ b/src/System.Security.Permissions/src/System/Security/Permissions/ResourcePermissionBase.cs @@ -0,0 +1,33 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. +// See the LICENSE file in the project root for more information. + +using System.Collections; + +namespace System.Security.Permissions +{ + [SecurityPermission(SecurityAction.InheritanceDemand, ControlEvidence = true, ControlPolicy = true)] + public abstract class ResourcePermissionBase : CodeAccessPermission, IUnrestrictedPermission + { + public const string Any = "*"; + public const string Local = "."; + protected ResourcePermissionBase() { } + protected ResourcePermissionBase(PermissionState state) { } + private static Hashtable CreateHashtable() { return null; } + private string ComputerName { get; set; } + private bool IsEmpty { get; } + protected Type PermissionAccessType { get; set; } + protected string[] TagNames { get; set; } + protected void AddPermissionAccess(ResourcePermissionBaseEntry entry) { } + protected void Clear() { } + public override IPermission Copy() { return null; } + protected ResourcePermissionBaseEntry[] GetPermissionEntries() { return null; } + public override void FromXml(SecurityElement securityElement) { } + public override IPermission Intersect(IPermission target) { return null; } + public override bool IsSubsetOf(IPermission target) { return false; } + public bool IsUnrestricted() { return false; } + protected void RemovePermissionAccess(ResourcePermissionBaseEntry entry) { } + public override SecurityElement ToXml() { return null; } + public override IPermission Union(IPermission target) { return null; } + } +} diff --git a/src/System.Security.Permissions/src/System/Security/Permissions/ResourcePermissionBaseEntry.cs b/src/System.Security.Permissions/src/System/Security/Permissions/ResourcePermissionBaseEntry.cs new file mode 100644 index 0000000000..c841992f97 --- /dev/null +++ b/src/System.Security.Permissions/src/System/Security/Permissions/ResourcePermissionBaseEntry.cs @@ -0,0 +1,14 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. +// See the LICENSE file in the project root for more information. + +namespace System.Security.Permissions +{ + public class ResourcePermissionBaseEntry + { + public ResourcePermissionBaseEntry() { } + public ResourcePermissionBaseEntry(int permissionAccess, string[] permissionAccessPath) { } + public int PermissionAccess { get; } + public string[] PermissionAccessPath { get; } + } +} diff --git a/src/System.Security.Permissions/src/System/Security/Permissions/StorePermission.cs b/src/System.Security.Permissions/src/System/Security/Permissions/StorePermission.cs new file mode 100644 index 0000000000..5b6b1edb23 --- /dev/null +++ b/src/System.Security.Permissions/src/System/Security/Permissions/StorePermission.cs @@ -0,0 +1,20 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. +// See the LICENSE file in the project root for more information. + +namespace System.Security.Permissions +{ + public sealed class StorePermission : CodeAccessPermission, IUnrestrictedPermission + { + public StorePermission(PermissionState state) { } + public StorePermission(StorePermissionFlags flag) { } + public StorePermissionFlags Flags { get; set; } + public bool IsUnrestricted() { return false; } + public override IPermission Union(IPermission target) { return null; } + public override bool IsSubsetOf(IPermission target) { return false; } + public override IPermission Intersect(IPermission target) { return null; } + public override IPermission Copy() { return null; } + public override SecurityElement ToXml() { return null; } + public override void FromXml(SecurityElement securityElement) { } + } +} diff --git a/src/System.Security.Permissions/src/System/Security/Permissions/StorePermissionAttribute.cs b/src/System.Security.Permissions/src/System/Security/Permissions/StorePermissionAttribute.cs new file mode 100644 index 0000000000..e219053b01 --- /dev/null +++ b/src/System.Security.Permissions/src/System/Security/Permissions/StorePermissionAttribute.cs @@ -0,0 +1,21 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. +// See the LICENSE file in the project root for more information. + +namespace System.Security.Permissions +{ + [AttributeUsage(AttributeTargets.Method | AttributeTargets.Constructor | AttributeTargets.Class | AttributeTargets.Struct | AttributeTargets.Assembly, AllowMultiple = true, Inherited = false)] + public sealed class StorePermissionAttribute : CodeAccessSecurityAttribute + { + public StorePermissionAttribute(SecurityAction action) : base(action) { } + public StorePermissionFlags Flags { get; set; } + public bool CreateStore { get; set; } + public bool DeleteStore { get; set; } + public bool EnumerateStores { get; set; } + public bool OpenStore { get; set; } + public bool AddToStore { get; set; } + public bool RemoveFromStore { get; set; } + public bool EnumerateCertificates { get; set; } + public override IPermission CreatePermission() { return null; } + } +} diff --git a/src/System.Security.Permissions/src/System/Security/Permissions/StorePermissionFlags.cs b/src/System.Security.Permissions/src/System/Security/Permissions/StorePermissionFlags.cs new file mode 100644 index 0000000000..ae59f54686 --- /dev/null +++ b/src/System.Security.Permissions/src/System/Security/Permissions/StorePermissionFlags.cs @@ -0,0 +1,23 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. +// See the LICENSE file in the project root for more information. + +namespace System.Security.Permissions +{ + [Flags] + public enum StorePermissionFlags + { + NoFlags = 0x00, + + CreateStore = 0x01, + DeleteStore = 0x02, + EnumerateStores = 0x04, + + OpenStore = 0x10, + AddToStore = 0x20, + RemoveFromStore = 0x40, + EnumerateCertificates = 0x80, + + AllFlags = 0xF7 + } +} diff --git a/src/System.Security.Permissions/src/System/Security/Permissions/TypeDescriptorPermissionAttribute.cs b/src/System.Security.Permissions/src/System/Security/Permissions/TypeDescriptorPermissionAttribute.cs new file mode 100644 index 0000000000..95174a7df5 --- /dev/null +++ b/src/System.Security.Permissions/src/System/Security/Permissions/TypeDescriptorPermissionAttribute.cs @@ -0,0 +1,15 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. +// See the LICENSE file in the project root for more information. + +namespace System.Security.Permissions +{ + [AttributeUsage(AttributeTargets.Method | AttributeTargets.Constructor | AttributeTargets.Class | AttributeTargets.Struct | AttributeTargets.Assembly, AllowMultiple = true, Inherited = false)] + public sealed class TypeDescriptorPermissionAttribute : CodeAccessSecurityAttribute + { + public TypeDescriptorPermissionAttribute(SecurityAction action) : base(action) { } + public TypeDescriptorPermissionFlags Flags { get; set; } + public bool RestrictedRegistrationAccess { get; set; } + public override IPermission CreatePermission() { return null; } + } +} |