This documentation is archived and is not being maintained.

SecurityElement Class

Represents the XML object model for encoding security objects. This class cannot be inherited.

For a list of all members of this type, see SecurityElement Members.

System.Object
   System.Security.SecurityElement

[Visual Basic]
<Serializable>
NotInheritable Public Class SecurityElement
[C#]
[Serializable]
public sealed class SecurityElement
[C++]
[Serializable]
public __gc __sealed class SecurityElement
[JScript]
public
   Serializable
class SecurityElement

Thread Safety

Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.

Remarks

This class is intended to be a lightweight implementation of a simple XML object model for use within the security system, and not for use as a general XML object model. This documentation assumes a basic knowledge of XML.

The simple XML object model for an element consists of the following parts:

  • The tag is the element name.
  • The attributes are zero or more name/value attribute pairs on the element.
  • The children are zero or more elements nested within <tag> and </tag>.

It is strongly suggested that attribute based XML representation is used to express security elements and their values. This means properties of an element are expressed as attributes and property values are expressed as attribute values. Avoid nesting text within tags. For any <tag>text</tag> representation a representation of type <tag value=text/> is usually available. Using this attribute-based XML representation increases readability and allows easy WMI portability of the resulting XML serialization.

An attribute name must be one character or longer, and cannot be a null reference (Nothing in Visual Basic). If element-based value representation is used, elements with a text string that is a null reference (Nothing) are represented in the <tag/> form; otherwise, text is delimited by the <tag> and </tag> tokens. Both forms can be combined with attributes, which are shown if present.

The tags, attributes, and text of elements, if present, are always case-sensitive. The XML form contains quotations and escapes where necessary. String values that include characters invalid for use in XML result in an ArgumentException. These rules apply to all properties and methods.

Note   For performance reasons, character validity is only checked when the element is encoded into XML text form, and not on every set of a property or method. Static methods allow explicit checking where needed.

Requirements

Namespace: System.Security

Platforms: Windows 98, Windows NT 4.0, Windows Millennium Edition, Windows 2000, Windows XP Home Edition, Windows XP Professional, Windows Server 2003 family

Assembly: Mscorlib (in Mscorlib.dll)

See Also

SecurityElement Members | System.Security Namespace

Show: