CspParameters.KeyContainerName フィールド
アセンブリ: mscorlib (mscorlib.dll 内)



CspParameters クラスを使用してキー コンテナを作成し、そのコンテナにキーを保存するコード例を次に示します。
Imports System Imports System.IO Imports System.Security.Cryptography Public Class StoreKey Public Shared Sub Main() ' creates the CspParameters object and sets the key container name used to store the RSA key pair Dim cp As New CspParameters() cp.KeyContainerName = "MyKeyContainerName" ' instantiates the rsa instance accessing the key container MyKeyContainerName Dim rsa As New RSACryptoServiceProvider(cp) ' add the below line to delete the key entry in MyKeyContainerName ' rsa.PersistKeyInCsp = false; 'writes out the current key pair used in the rsa instance Console.WriteLine("Key is : " & rsa.ToXmlString(True)) End Sub 'Main End Class 'StoreKey
using System; using System.IO; using System.Security.Cryptography; public class StoreKey { public static void Main() { // creates the CspParameters object and sets the key container name used to store the RSA key pair CspParameters cp = new CspParameters(); cp.KeyContainerName = "MyKeyContainerName"; // instantiates the rsa instance accessing the key container MyKeyContainerName RSACryptoServiceProvider rsa = new RSACryptoServiceProvider(cp); // add the below line to delete the key entry in MyKeyContainerName // rsa.PersistKeyInCsp = false; //writes out the current key pair used in the rsa instance Console.WriteLine("Key is : \n" + rsa.ToXmlString(true)); } }
using namespace System; using namespace System::IO; using namespace System::Security::Cryptography; int main() { // creates the CspParameters object and sets the key container name used to store the RSA key pair CspParameters^ cp = gcnew CspParameters; cp->KeyContainerName = "MyKeyContainerName"; // instantiates the rsa instance accessing the key container MyKeyContainerName RSACryptoServiceProvider^ rsa = gcnew RSACryptoServiceProvider( cp ); // add the below line to delete the key entry in MyKeyContainerName // rsa.PersistKeyInCsp = false; //writes out the current key pair used in the rsa instance Console::WriteLine( "Key is : \n{0}", rsa->ToXmlString( true ) ); }
import System.*; import System.IO.*; import System.Security.Cryptography.*; public class StoreKey { public static void main(String[] args) { // creates the CspParameters object and sets the key container name // used to store the RSA key pair CspParameters cp = new CspParameters(); cp.KeyContainerName = "MyKeyContainerName"; // instantiates the rsa instance accessing the key container // MyKeyContainerName RSACryptoServiceProvider rsa = new RSACryptoServiceProvider(cp); // add the below line to delete the key entry in MyKeyContainerName // rsa.PersistKeyInCsp = false; //writes out the current key pair used in the rsa instance Console.WriteLine("Key is : \n" + rsa.ToXmlString(true)); } //main } //StoreKey

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


Weblioに収録されているすべての辞書からCspParameters.KeyContainerName フィールドを検索する場合は、下記のリンクをクリックしてください。

- CspParameters.KeyContainerName フィールドのページへのリンク