170 lines
5.4 KiB
C#
170 lines
5.4 KiB
C#
using System;
|
|
using System.Runtime.InteropServices;
|
|
|
|
namespace System.Security.Permissions
|
|
{
|
|
/// <summary>Allows security actions for <see cref="T:System.Security.Permissions.KeyContainerPermission" /> to be applied to code using declarative security. This class cannot be inherited.</summary>
|
|
// 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
|
|
{
|
|
/// <summary>Initializes a new instance of the <see cref="T:System.Security.Permissions.KeyContainerPermissionAttribute" /> class with the specified security action.</summary>
|
|
/// <param name="action">One of the <see cref="T:System.Security.Permissions.SecurityAction" /> values. </param>
|
|
// Token: 0x060031FB RID: 12795 RVA: 0x000AB9E4 File Offset: 0x000A9BE4
|
|
public KeyContainerPermissionAttribute(SecurityAction action)
|
|
: base(action)
|
|
{
|
|
this._spec = -1;
|
|
this._type = -1;
|
|
}
|
|
|
|
/// <summary>Gets or sets the key container permissions.</summary>
|
|
/// <returns>A bitwise combination of the <see cref="T:System.Security.Permissions.KeyContainerPermissionFlags" /> values. The default is <see cref="F:System.Security.Permissions.KeyContainerPermissionFlags.NoFlags" />.</returns>
|
|
// 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;
|
|
}
|
|
}
|
|
|
|
/// <summary>Gets or sets the name of the key container.</summary>
|
|
/// <returns>The name of the key container.</returns>
|
|
// 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;
|
|
}
|
|
}
|
|
|
|
/// <summary>Gets or sets the key specification.</summary>
|
|
/// <returns>One of the AT_ values defined in the Wincrypt.h header file. </returns>
|
|
// 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;
|
|
}
|
|
}
|
|
|
|
/// <summary>Gets or sets the name of the key store.</summary>
|
|
/// <returns>The name of the key store. The default is "*".</returns>
|
|
// 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;
|
|
}
|
|
}
|
|
|
|
/// <summary>Gets or sets the provider name.</summary>
|
|
/// <returns>The name of the provider.</returns>
|
|
// 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;
|
|
}
|
|
}
|
|
|
|
/// <summary>Gets or sets the provider type.</summary>
|
|
/// <returns>One of the PROV_ values defined in the Wincrypt.h header file. </returns>
|
|
// 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;
|
|
}
|
|
}
|
|
|
|
/// <summary>Creates and returns a new <see cref="T:System.Security.Permissions.KeyContainerPermission" />.</summary>
|
|
/// <returns>A <see cref="T:System.Security.Permissions.KeyContainerPermission" /> that corresponds to the attribute.</returns>
|
|
// 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;
|
|
}
|
|
}
|