Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -91,18 +91,8 @@

[!INCLUDE[cas-deprecated](~/includes/cas-deprecated.md)]

This attribute class associates a <xref:System.Security.Permissions.SecurityAction>, for example, `Demand`, with a custom security attribute.

The types that derive from <xref:System.Security.Permissions.CodeAccessSecurityAttribute> are used to help restrict access to resources or securable operations.

The security information declared by a security attribute is stored in the metadata of the attribute target and is accessed by the system at run time. Security attributes are used only for declarative security. Use the corresponding permission class derived from <xref:System.Security.CodeAccessPermission> for imperative security.

]]></format>
</remarks>
<block subset="none" type="overrides">
<para>All permission attributes derived from this class must have only a single constructor that takes a <see cref="T:System.Security.Permissions.SecurityAction" /> as its only parameter.</para>
</block>
<altmember cref="T:System.Security.CodeAccessPermission" />
<related type="Article" href="/dotnet/standard/attributes/">Extending Metadata Using Attributes</related>
</Docs>
<Members>
Expand Down Expand Up @@ -155,14 +145,7 @@
<Docs>
<param name="action">One of the <see cref="T:System.Security.Permissions.SecurityAction" /> values.</param>
<summary>Initializes a new instance of <see cref="T:System.Security.Permissions.CodeAccessSecurityAttribute" /> with the specified <see cref="T:System.Security.Permissions.SecurityAction" />.</summary>
<remarks>
<format type="text/markdown"><![CDATA[

## Remarks
You cannot create an instance of this class. You must inherit from this class to make use of its functionality.

]]></format>
</remarks>
<remarks>To be added.</remarks>
<block subset="none" type="overrides">
<para>Derived classes must have only one constructor that takes a <see cref="T:System.Security.Permissions.SecurityAction" /> as its only parameter.</para>
</block>
Expand Down
83 changes: 9 additions & 74 deletions xml/System.Security.Permissions/DataProtectionPermission.xml
Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,6 @@

[!INCLUDE[cas-deprecated](~/includes/cas-deprecated.md)]

This permission is used to control the ability to encrypt data and memory using the <xref:System.Security.Cryptography.ProtectedData> and <xref:System.Security.Cryptography.ProtectedMemory> classes.

]]></format>
</remarks>
<altmember cref="T:System.Security.Permissions.DataProtectionPermissionAttribute" />
Expand Down Expand Up @@ -133,14 +131,7 @@
<Docs>
<param name="state">One of the <see cref="T:System.Security.Permissions.PermissionState" /> values.</param>
<summary>Initializes a new instance of the <see cref="T:System.Security.Permissions.DataProtectionPermission" /> class with the specified permission state.</summary>
<remarks>
<format type="text/markdown"><![CDATA[

## Remarks
Creates either `None` (fully restricted) or `Unrestricted` access to data and memory.

]]></format>
</remarks>
<remarks>To be added.</remarks>
<exception cref="T:System.ArgumentException">
<paramref name="state" /> is not a valid <see cref="T:System.Security.Permissions.PermissionState" /> value.</exception>
<altmember cref="T:System.Security.Permissions.DataProtectionPermissionAttribute" />
Expand Down Expand Up @@ -178,14 +169,7 @@
<Docs>
<summary>Creates and returns an identical copy of the current permission.</summary>
<returns>A copy of the current permission.</returns>
<remarks>
<format type="text/markdown"><![CDATA[

## Remarks
A copy of the permission represents the same access to resources as the original permission.

]]></format>
</remarks>
<remarks>To be added.</remarks>
</Docs>
</Member>
<Member MemberName="Flags">
Expand Down Expand Up @@ -219,14 +203,7 @@
<Docs>
<summary>Gets or sets the data and memory protection flags.</summary>
<value>A bitwise combination of the <see cref="T:System.Security.Permissions.DataProtectionPermissionFlags" /> values.</value>
<remarks>
<format type="text/markdown"><![CDATA[

## Remarks
This property specifies whether the `Protect` and `Unprotect` methods of the <xref:System.Security.Cryptography.ProtectedData> and <xref:System.Security.Cryptography.ProtectedMemory> classes can be used.

]]></format>
</remarks>
<remarks>To be added.</remarks>
<exception cref="T:System.ArgumentException">The specified value is not a valid combination of the <see cref="T:System.Security.Permissions.DataProtectionPermissionFlags" /> values.</exception>
</Docs>
</Member>
Expand Down Expand Up @@ -264,14 +241,7 @@
<Docs>
<param name="securityElement">A <see cref="T:System.Security.SecurityElement" /> that contains the XML encoding used to reconstruct the permission.</param>
<summary>Reconstructs a permission with a specific state from an XML encoding.</summary>
<remarks>
<format type="text/markdown"><![CDATA[

## Remarks
The <xref:System.Security.Permissions.DataProtectionPermission.FromXml*> method reconstructs a <xref:System.Security.Permissions.DataProtectionPermission> object from an XML encoding defined by the <xref:System.Security.SecurityElement> class. Use the <xref:System.Security.Permissions.DataProtectionPermission.ToXml*> method to XML-encode the <xref:System.Security.Permissions.DataProtectionPermission>, including state information.

]]></format>
</remarks>
<remarks>To be added.</remarks>
<exception cref="T:System.ArgumentNullException">
<paramref name="securityElement" /> is <see langword="null" />.</exception>
<exception cref="T:System.ArgumentException">
Expand Down Expand Up @@ -317,14 +287,7 @@
<param name="target">A permission to intersect with the current permission. It must be the same type as the current permission.</param>
<summary>Creates and returns a permission that is the intersection of the current permission and the specified permission.</summary>
<returns>A new permission that represents the intersection of the current permission and the specified permission. This new permission is <see langword="null" /> if the intersection is empty.</returns>
<remarks>
<format type="text/markdown"><![CDATA[

## Remarks
The intersection of two permissions is a permission that describes the set of operations they both describe in common. Only a demand that passes both individual permissions will pass the intersection.

]]></format>
</remarks>
<remarks>To be added.</remarks>
<exception cref="T:System.ArgumentException">
<paramref name="target" /> is not <see langword="null" /> and does not specify a permission of the same type as the current permission.</exception>
</Docs>
Expand Down Expand Up @@ -365,14 +328,7 @@
<summary>Determines whether the current permission is a subset of the specified permission.</summary>
<returns>
<see langword="true" /> if the current permission is a subset of the specified permission; otherwise, <see langword="false" />.</returns>
<remarks>
<format type="text/markdown"><![CDATA[

## Remarks
The current permission is a subset of the specified permission if the current permission specifies a set of operations that is wholly contained in the specified permission. For example, a permission for <xref:System.Security.Permissions.DataProtectionPermissionFlags.ProtectData> access is a subset of a permission for <xref:System.Security.Permissions.DataProtectionPermissionFlags.AllFlags> access.

]]></format>
</remarks>
<remarks>To be added.</remarks>
<exception cref="T:System.ArgumentException">
<paramref name="target" /> is not <see langword="null" /> and does not specify a permission of the same type as the current permission.</exception>
</Docs>
Expand Down Expand Up @@ -413,14 +369,7 @@
<summary>Returns a value indicating whether the current permission is unrestricted.</summary>
<returns>
<see langword="true" /> if the current permission is unrestricted; otherwise, <see langword="false" />.</returns>
<remarks>
<format type="text/markdown"><![CDATA[

## Remarks
An unrestricted permission represents access to all resources protected by the permission.

]]></format>
</remarks>
<remarks>To be added.</remarks>
</Docs>
</Member>
<Member MemberName="ToXml">
Expand Down Expand Up @@ -455,14 +404,7 @@
<Docs>
<summary>Creates an XML encoding of the permission and its current state.</summary>
<returns>An XML encoding of the permission, including state information.</returns>
<remarks>
<format type="text/markdown"><![CDATA[

## Remarks
Use the <xref:System.Security.Permissions.DataProtectionPermission.FromXml*> method to restore the state information from a <xref:System.Security.SecurityElement>.

]]></format>
</remarks>
<remarks>To be added.</remarks>
</Docs>
</Member>
<Member MemberName="Union">
Expand Down Expand Up @@ -500,14 +442,7 @@
<param name="target">A permission to combine with the current permission. It must be of the same type as the current permission.</param>
<summary>Creates a permission that is the union of the current permission and the specified permission.</summary>
<returns>A new permission that represents the union of the current permission and the specified permission.</returns>
<remarks>
<format type="text/markdown"><![CDATA[

## Remarks
The result of a call to <xref:System.Security.Permissions.DataProtectionPermission.Union*> is a permission that represents all operations represented by both the current permission and the specified permission. Any demand that passes either permission passes their union.

]]></format>
</remarks>
<remarks>To be added.</remarks>
<exception cref="T:System.ArgumentException">
<paramref name="target" /> is not <see langword="null" /> and does not specify a permission of the same type as the current permission.</exception>
</Docs>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,10 +48,6 @@

[!INCLUDE[cas-deprecated](~/includes/cas-deprecated.md)]

The scope of the declaration that is allowed depends on the <xref:System.Security.Permissions.SecurityAction> value that is used.

The security information declared by a security attribute is stored in the metadata of the attribute target and is accessed by the system at run time. <xref:System.Security.Permissions.DataProtectionPermissionAttribute> is used only for declarative security. For imperative security, use the <xref:System.Security.Permissions.DataProtectionPermission> class.

]]></format>
</remarks>
</Docs>
Expand Down Expand Up @@ -122,16 +118,7 @@
<Docs>
<summary>Creates and returns a new <see cref="T:System.Security.Permissions.DataProtectionPermission" />.</summary>
<returns>A <see cref="T:System.Security.Permissions.DataProtectionPermission" /> that corresponds to the attribute.</returns>
<remarks>
<format type="text/markdown"><![CDATA[

## Remarks
This method should only be called by the security system, never by application code.

At compile time, attributes convert security declarations to a serialized form in metadata. Declarative security data in metadata is created from the permission that this method returns.

]]></format>
</remarks>
<remarks>To be added.</remarks>
</Docs>
</Member>
<Member MemberName="Flags">
Expand Down Expand Up @@ -200,14 +187,7 @@
<summary>Gets or sets a value indicating whether data can be encrypted using the <see cref="T:System.Security.Cryptography.ProtectedData" /> class.</summary>
<value>
<see langword="true" /> if data can be encrypted; otherwise, <see langword="false" />.</value>
<remarks>
<format type="text/markdown"><![CDATA[

## Remarks
If the value is `false`, a <xref:System.Security.SecurityException> occurs when the <xref:System.Security.Cryptography.ProtectedData.Protect*?displayProperty=nameWithType> method is called.

]]></format>
</remarks>
<remarks>To be added.</remarks>
</Docs>
</Member>
<Member MemberName="ProtectMemory">
Expand Down Expand Up @@ -242,14 +222,7 @@
<summary>Gets or sets a value indicating whether memory can be encrypted using the <see cref="T:System.Security.Cryptography.ProtectedMemory" /> class.</summary>
<value>
<see langword="true" /> if memory can be encrypted; otherwise, <see langword="false" />.</value>
<remarks>
<format type="text/markdown"><![CDATA[

## Remarks
If the value is `false`, a <xref:System.Security.SecurityException> occurs when the <xref:System.Security.Cryptography.ProtectedMemory.Protect*?displayProperty=nameWithType> method is called.

]]></format>
</remarks>
<remarks>To be added.</remarks>
</Docs>
</Member>
<Member MemberName="UnprotectData">
Expand Down Expand Up @@ -284,14 +257,7 @@
<summary>Gets or sets a value indicating whether data can be unencrypted using the <see cref="T:System.Security.Cryptography.ProtectedData" /> class.</summary>
<value>
<see langword="true" /> if data can be unencrypted; otherwise, <see langword="false" />.</value>
<remarks>
<format type="text/markdown"><![CDATA[

## Remarks
If this value is `false`, a <xref:System.Security.SecurityException> occurs when the <xref:System.Security.Cryptography.ProtectedData.Unprotect*?displayProperty=nameWithType> method is called.

]]></format>
</remarks>
<remarks>To be added.</remarks>
</Docs>
</Member>
<Member MemberName="UnprotectMemory">
Expand Down Expand Up @@ -326,14 +292,7 @@
<summary>Gets or sets a value indicating whether memory can be unencrypted using the <see cref="T:System.Security.Cryptography.ProtectedMemory" /> class.</summary>
<value>
<see langword="true" /> if memory can be unencrypted; otherwise, <see langword="false" />.</value>
<remarks>
<format type="text/markdown"><![CDATA[

## Remarks
If this value is `false`, a <xref:System.Security.SecurityException> occurs when the <xref:System.Security.Cryptography.ProtectedMemory.Unprotect*?displayProperty=nameWithType> method is called.

]]></format>
</remarks>
<remarks>To be added.</remarks>
</Docs>
</Member>
</Members>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,17 +41,12 @@
<Docs>
<summary>Specifies the access permissions for encrypting data and memory.</summary>
<remarks>
<format type="text/markdown"><![CDATA[
<format type="text/markdown"><![CDATA[

## Remarks

[!INCLUDE[cas-deprecated](~/includes/cas-deprecated.md)]

This enumeration is used by the <xref:System.Security.Permissions.DataProtectionPermission> and <xref:System.Security.Permissions.DataProtectionPermissionAttribute> classes to protect access to encrypted data and memory using the <xref:System.Security.Cryptography.ProtectedData> and <xref:System.Security.Cryptography.ProtectedMemory> classes.

> [!CAUTION]
> Many of these flags can have powerful effects and should be granted only to highly trusted code.

]]></format>
</remarks>
</Docs>
Expand Down
Loading
Loading