Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit c55b0f5

Browse files
SeanKilleenRon Petrusha
authored andcommitted
Add note on xplat support for Encrypt/Decrypt on .NET Core (dotnet#2259)
* Add note on xplat support for Encrypt/Decrypt on .NET Core * Update xml/System.IO/File.xml @rpetrusha feedback on language 👍 Co-Authored-By: SeanKilleen <[email protected]> * Update xml/System.IO/File.xml @rpetrusha feedback on language 👍 Co-Authored-By: SeanKilleen <[email protected]> * Update xml/System.IO/File.xml @rpetrusha feedback on language 👍 Co-Authored-By: SeanKilleen <[email protected]> * Update xml/System.IO/File.xml @rpetrusha feedback on language 👍 Co-Authored-By: SeanKilleen <[email protected]> * use note format instead * update styling of note * Changes per feedback
1 parent 0c0d7b4 commit c55b0f5

File tree

1 file changed

+12
-7
lines changed

1 file changed

+12
-7
lines changed

xml/System.IO/File.xml

Lines changed: 12 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1332,15 +1332,18 @@
13321332
13331333
## Remarks
13341334
The <xref:System.IO.File.Decrypt%2A> method allows you to decrypt a file that was encrypted using the <xref:System.IO.File.Encrypt%2A> method. The <xref:System.IO.File.Decrypt%2A> method can decrypt only files that were encrypted using the current user account.
1335-
1335+
1336+
> [!IMPORTANT]
1337+
> This API is only supported on Windows platforms that are able to use the NTFS Encrypting File System (EFS). Any attempt to use this on non-Windows systems, Windows Home Edition systems, or non-NTFS drives results in a <xref:System.PlatformNotSupportedException> or <xref:System.NotSupportedException>, depending on the situation.
1338+
>
1339+
> Use of this API in .NET Core is not recommended; it is included to enable portability for applications that move to .NET Core but still explicitly target Windows.
1340+
13361341
The <xref:System.IO.File.Decrypt%2A> method requires exclusive access to the file being decrypted, and will raise an exception if another process is using the file. If the file is not encrypted, <xref:System.IO.File.Decrypt%2A> will return a nonzero value, which indicates success.
13371342
13381343
Both the <xref:System.IO.File.Encrypt%2A> method and the <xref:System.IO.File.Decrypt%2A> method use the cryptographic service provider (CSP) installed on the computer and the file encryption keys of the process calling the method.
13391344
13401345
The current file system must be formatted as NTFS and the current operating system must be Windows NT or later.
1341-
13421346
1343-
13441347
## Examples
13451348
The following code example uses the <xref:System.IO.File.Encrypt%2A> method and the <xref:System.IO.File.Decrypt%2A> method to encrypt and then decrypt a file. The file must exist for the example to work.
13461349
@@ -1511,10 +1514,14 @@
15111514
<summary>Encrypts a file so that only the account used to encrypt the file can decrypt it.</summary>
15121515
<remarks>
15131516
<format type="text/markdown"><![CDATA[
1514-
15151517
## Remarks
15161518
The <xref:System.IO.File.Encrypt%2A> method allows you to encrypt a file so that only the account used to call this method can decrypt it. Use the <xref:System.IO.File.Decrypt%2A> method to decrypt a file encrypted by the <xref:System.IO.File.Encrypt%2A> method.
1517-
1519+
1520+
> [!IMPORTANT]
1521+
> This API is only supported on Windows platforms that are able to use the NTFS Encrypting File System (EFS). Any attempt to use this on non-Windows systems, Windows Home Edition systems, or non-NTFS drives results in a <xref:System.PlatformNotSupportedException> or <xref:System.NotSupportedException>, depending on the situation.
1522+
>
1523+
> Use of this API in .NET Core is not recommended; it is included to enable portability for applications that move to .NET Core but still explicitly target Windows.
1524+
15181525
The <xref:System.IO.File.Encrypt%2A> method requires exclusive access to the file being encrypted, and will fail if another process is using the file.
15191526
15201527
Both the <xref:System.IO.File.Encrypt%2A> method and the <xref:System.IO.File.Decrypt%2A> method use the cryptographic service provider (CSP) installed on the computer and the file encryption keys of the process calling the method.
@@ -1523,8 +1530,6 @@
15231530
15241531
The current file system must be formatted as NTFS.
15251532
1526-
1527-
15281533
## Examples
15291534
The following code example uses the <xref:System.IO.File.Encrypt%2A> method and the <xref:System.IO.File.Decrypt%2A> method to encrypt and then decrypt a file. The file must exist for the example to work.
15301535

0 commit comments

Comments
 (0)