scripts
This commit is contained in:
@@ -0,0 +1,156 @@
|
||||
using System;
|
||||
using System.Runtime.InteropServices;
|
||||
using System.Security.Permissions;
|
||||
|
||||
namespace System.Security.Policy
|
||||
{
|
||||
/// <summary>Provides the strong name of a code assembly as evidence for policy evaluation. This class cannot be inherited.</summary>
|
||||
// Token: 0x020005A0 RID: 1440
|
||||
[ComVisible(true)]
|
||||
[Serializable]
|
||||
public sealed class StrongName : IBuiltInEvidence, IIdentityPermissionFactory
|
||||
{
|
||||
/// <summary>Initializes a new instance of the <see cref="T:System.Security.Policy.StrongName" /> class with the strong name public key blob, name, and version.</summary>
|
||||
/// <param name="blob">The <see cref="T:System.Security.Permissions.StrongNamePublicKeyBlob" /> of the software publisher. </param>
|
||||
/// <param name="name">The simple name section of the strong name. </param>
|
||||
/// <param name="version">The <see cref="T:System.Version" /> of the strong name. </param>
|
||||
/// <exception cref="T:System.ArgumentNullException">The <paramref name="blob" /> parameter is null.-or- The <paramref name="name" /> parameter is null.-or- The <paramref name="version" /> parameter is null. </exception>
|
||||
/// <exception cref="T:System.ArgumentException">The <paramref name="name" /> parameter is an empty string (""). </exception>
|
||||
// Token: 0x060034B0 RID: 13488 RVA: 0x000B5BF0 File Offset: 0x000B3DF0
|
||||
public StrongName(StrongNamePublicKeyBlob blob, string name, Version version)
|
||||
{
|
||||
if (blob == null)
|
||||
{
|
||||
throw new ArgumentNullException("blob");
|
||||
}
|
||||
if (name == null)
|
||||
{
|
||||
throw new ArgumentNullException("name");
|
||||
}
|
||||
if (version == null)
|
||||
{
|
||||
throw new ArgumentNullException("version");
|
||||
}
|
||||
if (name.Length == 0)
|
||||
{
|
||||
throw new ArgumentException(Locale.GetText("Empty"), "name");
|
||||
}
|
||||
this.publickey = blob;
|
||||
this.name = name;
|
||||
this.version = version;
|
||||
}
|
||||
|
||||
// Token: 0x060034B1 RID: 13489 RVA: 0x000B5C74 File Offset: 0x000B3E74
|
||||
int IBuiltInEvidence.GetRequiredSize(bool verbose)
|
||||
{
|
||||
return ((!verbose) ? 1 : 5) + this.name.Length;
|
||||
}
|
||||
|
||||
// Token: 0x060034B2 RID: 13490 RVA: 0x000B5C90 File Offset: 0x000B3E90
|
||||
[MonoTODO("IBuiltInEvidence")]
|
||||
int IBuiltInEvidence.InitFromBuffer(char[] buffer, int position)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
// Token: 0x060034B3 RID: 13491 RVA: 0x000B5C94 File Offset: 0x000B3E94
|
||||
[MonoTODO("IBuiltInEvidence")]
|
||||
int IBuiltInEvidence.OutputToBuffer(char[] buffer, int position, bool verbose)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
/// <summary>Gets the simple name of the current <see cref="T:System.Security.Policy.StrongName" />.</summary>
|
||||
/// <returns>The simple name part of the <see cref="T:System.Security.Policy.StrongName" />.</returns>
|
||||
// Token: 0x17000A55 RID: 2645
|
||||
// (get) Token: 0x060034B4 RID: 13492 RVA: 0x000B5C98 File Offset: 0x000B3E98
|
||||
public string Name
|
||||
{
|
||||
get
|
||||
{
|
||||
return this.name;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>Gets the <see cref="T:System.Security.Permissions.StrongNamePublicKeyBlob" /> of the current <see cref="T:System.Security.Policy.StrongName" />.</summary>
|
||||
/// <returns>The <see cref="T:System.Security.Permissions.StrongNamePublicKeyBlob" /> of the current <see cref="T:System.Security.Policy.StrongName" />.</returns>
|
||||
// Token: 0x17000A56 RID: 2646
|
||||
// (get) Token: 0x060034B5 RID: 13493 RVA: 0x000B5CA0 File Offset: 0x000B3EA0
|
||||
public StrongNamePublicKeyBlob PublicKey
|
||||
{
|
||||
get
|
||||
{
|
||||
return this.publickey;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>Gets the <see cref="T:System.Version" /> of the current <see cref="T:System.Security.Policy.StrongName" />.</summary>
|
||||
/// <returns>The <see cref="T:System.Version" /> of the current <see cref="T:System.Security.Policy.StrongName" />.</returns>
|
||||
// Token: 0x17000A57 RID: 2647
|
||||
// (get) Token: 0x060034B6 RID: 13494 RVA: 0x000B5CA8 File Offset: 0x000B3EA8
|
||||
public Version Version
|
||||
{
|
||||
get
|
||||
{
|
||||
return this.version;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>Creates an equivalent copy of the current <see cref="T:System.Security.Policy.StrongName" />.</summary>
|
||||
/// <returns>A new, identical copy of the current <see cref="T:System.Security.Policy.StrongName" />.</returns>
|
||||
// Token: 0x060034B7 RID: 13495 RVA: 0x000B5CB0 File Offset: 0x000B3EB0
|
||||
public object Copy()
|
||||
{
|
||||
return new StrongName(this.publickey, this.name, this.version);
|
||||
}
|
||||
|
||||
/// <summary>Creates a <see cref="T:System.Security.Permissions.StrongNameIdentityPermission" /> that corresponds to the current <see cref="T:System.Security.Policy.StrongName" />.</summary>
|
||||
/// <returns>A <see cref="T:System.Security.Permissions.StrongNameIdentityPermission" /> for the specified <see cref="T:System.Security.Policy.StrongName" />.</returns>
|
||||
/// <param name="evidence">The <see cref="T:System.Security.Policy.Evidence" /> from which to construct the <see cref="T:System.Security.Permissions.StrongNameIdentityPermission" />. </param>
|
||||
// Token: 0x060034B8 RID: 13496 RVA: 0x000B5CCC File Offset: 0x000B3ECC
|
||||
public IPermission CreateIdentityPermission(Evidence evidence)
|
||||
{
|
||||
return new StrongNameIdentityPermission(this.publickey, this.name, this.version);
|
||||
}
|
||||
|
||||
/// <summary>Determines whether the specified strong name is equal to the current strong name.</summary>
|
||||
/// <returns>true if the specified strong name is equal to the current strong name; otherwise, false.</returns>
|
||||
/// <param name="o">The strong name to compare against the current strong name. </param>
|
||||
// Token: 0x060034B9 RID: 13497 RVA: 0x000B5CE8 File Offset: 0x000B3EE8
|
||||
public override bool Equals(object o)
|
||||
{
|
||||
StrongName strongName = o as StrongName;
|
||||
return strongName != null && !(this.name != strongName.Name) && this.Version.Equals(strongName.Version) && this.PublicKey.Equals(strongName.PublicKey);
|
||||
}
|
||||
|
||||
/// <summary>Gets the hash code of the current <see cref="T:System.Security.Policy.StrongName" />.</summary>
|
||||
/// <returns>The hash code of the current <see cref="T:System.Security.Policy.StrongName" />.</returns>
|
||||
// Token: 0x060034BA RID: 13498 RVA: 0x000B5D48 File Offset: 0x000B3F48
|
||||
public override int GetHashCode()
|
||||
{
|
||||
return this.publickey.GetHashCode();
|
||||
}
|
||||
|
||||
/// <summary>Creates a string representation of the current <see cref="T:System.Security.Policy.StrongName" />.</summary>
|
||||
/// <returns>A representation of the current <see cref="T:System.Security.Policy.StrongName" />.</returns>
|
||||
// Token: 0x060034BB RID: 13499 RVA: 0x000B5D58 File Offset: 0x000B3F58
|
||||
public override string ToString()
|
||||
{
|
||||
SecurityElement securityElement = new SecurityElement(typeof(StrongName).Name);
|
||||
securityElement.AddAttribute("version", "1");
|
||||
securityElement.AddAttribute("Key", this.publickey.ToString());
|
||||
securityElement.AddAttribute("Name", this.name);
|
||||
securityElement.AddAttribute("Version", this.version.ToString());
|
||||
return securityElement.ToString();
|
||||
}
|
||||
|
||||
// Token: 0x04001576 RID: 5494
|
||||
private StrongNamePublicKeyBlob publickey;
|
||||
|
||||
// Token: 0x04001577 RID: 5495
|
||||
private string name;
|
||||
|
||||
// Token: 0x04001578 RID: 5496
|
||||
private Version version;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user