using System; using System.Runtime.InteropServices; namespace System.Security.Permissions { /// Allows security actions for to be applied to code using declarative security. This class cannot be inherited. // Token: 0x02000558 RID: 1368 [ComVisible(true)] [AttributeUsage(AttributeTargets.Assembly | AttributeTargets.Class | AttributeTargets.Struct | AttributeTargets.Constructor | AttributeTargets.Method, AllowMultiple = true, Inherited = false)] [Serializable] public sealed class KeyContainerPermissionAttribute : CodeAccessSecurityAttribute { /// Initializes a new instance of the class with the specified security action. /// One of the values. // Token: 0x060031FB RID: 12795 RVA: 0x000AB9E4 File Offset: 0x000A9BE4 public KeyContainerPermissionAttribute(SecurityAction action) : base(action) { this._spec = -1; this._type = -1; } /// Gets or sets the key container permissions. /// A bitwise combination of the values. The default is . // Token: 0x170009CC RID: 2508 // (get) Token: 0x060031FC RID: 12796 RVA: 0x000AB9FC File Offset: 0x000A9BFC // (set) Token: 0x060031FD RID: 12797 RVA: 0x000ABA04 File Offset: 0x000A9C04 public KeyContainerPermissionFlags Flags { get { return this._flags; } set { this._flags = value; } } /// Gets or sets the name of the key container. /// The name of the key container. // Token: 0x170009CD RID: 2509 // (get) Token: 0x060031FE RID: 12798 RVA: 0x000ABA10 File Offset: 0x000A9C10 // (set) Token: 0x060031FF RID: 12799 RVA: 0x000ABA18 File Offset: 0x000A9C18 public string KeyContainerName { get { return this._containerName; } set { this._containerName = value; } } /// Gets or sets the key specification. /// One of the AT_ values defined in the Wincrypt.h header file. // Token: 0x170009CE RID: 2510 // (get) Token: 0x06003200 RID: 12800 RVA: 0x000ABA24 File Offset: 0x000A9C24 // (set) Token: 0x06003201 RID: 12801 RVA: 0x000ABA2C File Offset: 0x000A9C2C public int KeySpec { get { return this._spec; } set { this._spec = value; } } /// Gets or sets the name of the key store. /// The name of the key store. The default is "*". // Token: 0x170009CF RID: 2511 // (get) Token: 0x06003202 RID: 12802 RVA: 0x000ABA38 File Offset: 0x000A9C38 // (set) Token: 0x06003203 RID: 12803 RVA: 0x000ABA40 File Offset: 0x000A9C40 public string KeyStore { get { return this._store; } set { this._store = value; } } /// Gets or sets the provider name. /// The name of the provider. // Token: 0x170009D0 RID: 2512 // (get) Token: 0x06003204 RID: 12804 RVA: 0x000ABA4C File Offset: 0x000A9C4C // (set) Token: 0x06003205 RID: 12805 RVA: 0x000ABA54 File Offset: 0x000A9C54 public string ProviderName { get { return this._providerName; } set { this._providerName = value; } } /// Gets or sets the provider type. /// One of the PROV_ values defined in the Wincrypt.h header file. // Token: 0x170009D1 RID: 2513 // (get) Token: 0x06003206 RID: 12806 RVA: 0x000ABA60 File Offset: 0x000A9C60 // (set) Token: 0x06003207 RID: 12807 RVA: 0x000ABA68 File Offset: 0x000A9C68 public int ProviderType { get { return this._type; } set { this._type = value; } } /// Creates and returns a new . /// A that corresponds to the attribute. // Token: 0x06003208 RID: 12808 RVA: 0x000ABA74 File Offset: 0x000A9C74 public override IPermission CreatePermission() { if (base.Unrestricted) { return new KeyContainerPermission(PermissionState.Unrestricted); } if (this.EmptyEntry()) { return new KeyContainerPermission(this._flags); } KeyContainerPermissionAccessEntry[] array = new KeyContainerPermissionAccessEntry[] { new KeyContainerPermissionAccessEntry(this._store, this._providerName, this._type, this._containerName, this._spec, this._flags) }; return new KeyContainerPermission(this._flags, array); } // Token: 0x06003209 RID: 12809 RVA: 0x000ABAEC File Offset: 0x000A9CEC private bool EmptyEntry() { return this._containerName == null && this._spec == 0 && this._store == null && this._providerName == null && this._type == 0; } // Token: 0x0400147C RID: 5244 private KeyContainerPermissionFlags _flags; // Token: 0x0400147D RID: 5245 private string _containerName; // Token: 0x0400147E RID: 5246 private int _spec; // Token: 0x0400147F RID: 5247 private string _store; // Token: 0x04001480 RID: 5248 private string _providerName; // Token: 0x04001481 RID: 5249 private int _type; } }