13 private bool m_unrestricted;
26 if (m_certs ==
null || m_certs.Length < 1)
30 if (m_certs.Length > 1)
34 if (m_certs[0] ==
null)
42 CheckCertificate(value);
43 m_unrestricted =
false;
57 m_unrestricted =
true;
60 m_unrestricted =
false;
78 if (certificate ==
null)
93 publisherIdentityPermission.m_unrestricted = m_unrestricted;
96 publisherIdentityPermission.m_certs =
new X509Certificate[m_certs.Length];
97 for (
int i = 0; i < m_certs.Length; i++)
99 publisherIdentityPermission.m_certs[i] = ((m_certs[i] ==
null) ?
null :
new X509Certificate(m_certs[i]));
102 return publisherIdentityPermission;
122 if (m_certs.Length == 0)
129 if (publisherIdentityPermission ==
null)
133 if (publisherIdentityPermission.m_unrestricted)
147 if (publisherIdentityPermission.m_certs !=
null)
152 if (x509Certificate.
Equals(other))
179 if (publisherIdentityPermission ==
null)
183 if (m_unrestricted && publisherIdentityPermission.m_unrestricted)
186 publisherIdentityPermission2.m_unrestricted =
true;
187 return publisherIdentityPermission2;
191 return publisherIdentityPermission.
Copy();
193 if (publisherIdentityPermission.m_unrestricted)
197 if (m_certs ==
null || publisherIdentityPermission.m_certs ==
null || m_certs.Length == 0 || publisherIdentityPermission.m_certs.Length == 0)
208 if (x509Certificate.
Equals(other))
214 if (arrayList.Count == 0)
220 return publisherIdentityPermission3;
231 if ((m_certs ==
null || m_certs.Length == 0) && !m_unrestricted)
238 if (publisherIdentityPermission ==
null)
242 if (m_unrestricted || publisherIdentityPermission.m_unrestricted)
245 publisherIdentityPermission2.m_unrestricted =
true;
246 return publisherIdentityPermission2;
248 if (m_certs ==
null || m_certs.Length == 0)
250 if (publisherIdentityPermission.m_certs ==
null || publisherIdentityPermission.m_certs.Length == 0)
254 return publisherIdentityPermission.
Copy();
256 if (publisherIdentityPermission.m_certs ==
null || publisherIdentityPermission.m_certs.Length == 0)
264 arrayList.Add(value);
272 if (x509Certificate.
Equals(item))
280 arrayList.Add(x509Certificate);
285 return publisherIdentityPermission3;
294 m_unrestricted =
false;
297 string text = esd.Attribute(
"Unrestricted");
298 if (text !=
null &&
string.Compare(text,
"true",
StringComparison.OrdinalIgnoreCase) == 0)
300 m_unrestricted =
true;
303 string text2 = esd.Attribute(
"X509v3Certificate");
310 if (children !=
null)
314 text2 = item.Attribute(
"X509v3Certificate");
321 if (arrayList.
Count != 0)
336 else if (m_certs !=
null)
338 if (m_certs.Length == 1)
340 securityElement.
AddAttribute(
"X509v3Certificate", m_certs[0].GetRawCertDataString());
344 for (
int i = 0; i < m_certs.Length; i++)
347 securityElement2.
AddAttribute(
"X509v3Certificate", m_certs[i].GetRawCertDataString());
348 securityElement.
AddChild(securityElement2);
352 return securityElement;
355 int IBuiltInPermission.GetTokenIndex()
357 return GetTokenIndex();
360 internal static int GetTokenIndex()
PublisherIdentityPermission(PermissionState state)
Initializes a new instance of the T:System.Security.Permissions.PublisherIdentityPermission class wit...
The exception that is thrown when a null reference (Nothing in Visual Basic) is passed to a method th...
StringComparison
Specifies the culture, case, and sort rules to be used by certain overloads of the M:System....
override SecurityElement ToXml()
Creates an XML encoding of the permission and its current state.
virtual int Count
Gets the number of elements actually contained in the T:System.Collections.ArrayList.
PublisherIdentityPermission(X509Certificate certificate)
Initializes a new instance of the T:System.Security.Permissions.PublisherIdentityPermission class wit...
override void FromXml(SecurityElement esd)
Reconstructs a permission with a specified state from an XML encoding.
void AddChild(SecurityElement child)
Adds a child element to the XML element.
override bool IsSubsetOf(IPermission target)
Determines whether the current permission is a subset of the specified permission.
Provides information about, and means to manipulate, the current environment and platform....
Represents the XML object model for encoding security objects. This class cannot be inherited.
override IPermission Copy()
Creates and returns an identical copy of the current permission.
override IPermission Intersect(IPermission target)
Creates and returns a permission that is the intersection of the current permission and the specified...
Defines the underlying structure of all code access permissions.
Defines methods implemented by permission types.
virtual int Add(object value)
Adds an object to the end of the T:System.Collections.ArrayList.
Represents the identity of a software publisher. This class cannot be inherited.
The exception that is thrown when one of the arguments provided to a method is not valid.
X509Certificate Certificate
Gets or sets an Authenticode X.509v3 certificate that represents the identity of the software publish...
PermissionState
Specifies whether a permission should have all or no access to resources at creation.
virtual byte [] GetRawCertData()
Returns the raw data for the entire X.509v3 certificate as an array of bytes.
void AddAttribute(string name, string value)
Adds a name/value attribute to an XML element.
Specifies that the class can be serialized.
ArrayList Children
Gets or sets the array of child elements of the XML element.
override bool Equals(object obj)
Compares two T:System.Security.Cryptography.X509Certificates.X509Certificate objects for equality.
override IPermission Union(IPermission target)
Creates a permission that is the union of the current permission and the specified permission.
The exception that is thrown when an invoked method is not supported, or when there is an attempt to ...
Provides methods that help you use X.509 v.3 certificates.
virtual object [] ToArray()
Copies the elements of the T:System.Collections.ArrayList to a new T:System.Object array.
Implements the T:System.Collections.IList interface using an array whose size is dynamically increase...