MemoryProtectionScope 列挙体
アセンブリ: System.Security (system.security.dll 内)

Public Enumeration MemoryProtectionScope

メンバ名 | 説明 | |
---|---|---|
CrossProcess | Protect メソッドを使用して保護されていたメモリの保護を、任意のプロセスのすべてのコードで解除できます。 | |
SameLogon | メモリの保護を解除できるのは、Protect メソッドを呼び出したコードと同じユーザー コンテキストで実行されるコードのみです。 | |
SameProcess | メモリの保護を解除できるのは、Protect メソッドを呼び出したコードと同じプロセスで実行されるコードのみです。 |


using System; using System.Security.Cryptography; public class MemoryProtectionSample { // Create aditional entropy for use with the Protect method. static byte [] s_aditionalEntropy = { 9, 8, 7, 6, 5 }; public static void Main() { // Create the original data to be encrypted (The data length should be a multiple of 16). byte [] secret = { 1, 2, 3, 4, 1, 2, 3, 4, 1, 2, 3, 4, 1, 2, 3, 4 }; // Encrypt the data in memory. The result is stored in the same same array as the original data. ProtectedMemory.Protect( secret, MemoryProtectionScope.SameLogon ); // Decrypt the data in memory and store in the original array. ProtectedMemory.Unprotect( secret, MemoryProtectionScope.SameLogon ); } }
#using <System.Security.dll> using namespace System; using namespace System::Security::Cryptography; int main() { // Create the original data to be encrypted (The data length should be a multiple of 16). array<Byte>^secret = {1,2,3,4,1,2,3,4,1,2,3,4,1,2,3,4}; // Encrypt the data in memory. The result is stored in the same same array as the original data. ProtectedMemory::Protect( secret, MemoryProtectionScope::SameLogon ); // Decrypt the data in memory and store in the original array. ProtectedMemory::Unprotect( secret, MemoryProtectionScope::SameLogon ); }
import System.*; import System.Security.Cryptography.*; public class MemoryProtectionSample { // Create aditional entropy for use with the Protect method. private static ubyte sAditionalEntropy[] = { 9, 8, 7, 6, 5 }; public static void main(String args[]) { // Create the original data to be encrypted (The data length should // be a multiple of 16). ubyte secret[] = { 1, 2, 3, 4, 1, 2, 3, 4, 1, 2, 3, 4, 1, 2, 3, 4 }; // Encrypt the data in memory. The result is stored in the same same // array as the original data. ProtectedMemory.Protect(secret, MemoryProtectionScope.SameLogon); // Decrypt the data in memory and store in the original array. ProtectedMemory.Unprotect(secret, MemoryProtectionScope.SameLogon); } //main } //MemoryProtectionSample

Windows 98, Windows 2000 SP4, Windows Millennium Edition, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition
開発プラットフォームの中には、.NET Framework によってサポートされていないバージョンがあります。サポートされているバージョンについては、「システム要件」を参照してください。


Weblioに収録されているすべての辞書からMemoryProtectionScope 列挙体を検索する場合は、下記のリンクをクリックしてください。

- MemoryProtectionScope 列挙体のページへのリンク