CspParameters クラス
アセンブリ: mscorlib (mscorlib.dll 内)


CspParameters クラスは、アンマネージ CAPI (Microsoft Cryptography API) から内部的に Microsoft 暗号化サービス プロバイダ (CSP) を使用するマネージ暗号化クラスに渡すことができるパラメータを表します。"CryptoServiceProvider" で終わる名前を持つクラスは、対応する CSP のマネージ コード ラッパーです。
次の処理を行うには、CspParameters クラスを使用します。
-
プロバイダの種類を ProviderType プロパティまたは ProviderName プロパティに渡して、特定の CSP を指定する場合。コンストラクタのオーバーロードを使用して CSP を指定することもできます。
-
暗号化キーを格納できるキー コンテナを作成する場合。キー コンテナを使用すると、最も安全に暗号化キーを永続化して悪意のあるサードパーティから保護できます。キー コンテナの作成の詳細については、「方法 : キー コンテナに非対称キーを格納する」を参照してください。

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
CspParameters クラスを使用してスマート カード暗号化サービス プロバイダを選択するコード例を次に示します。その後で、スマート カードを使用してデータに署名し、そのデータを検証します。
Imports System Imports System.Security.Cryptography Module SCSign Sub Main(ByVal args() As String) ' To idendify the Smart Card CryptoGraphic Providers on your ' computer, use the Microsoft Registry Editor (Regedit.exe). ' The available Smart Card CryptoGraphic Providers are listed ' in HKEY_LOCAL_MACHINE\Software\Microsoft\Cryptography\Defaults\Provider. ' Create a new CspParameters object that identifies a ' Smart Card CryptoGraphic Provider. ' The 1st parameter comes from HKEY_LOCAL_MACHINE\Software\Microsoft\Cryptography\Defaults\Provider Types. ' The 2nd parameter comes from HKEY_LOCAL_MACHINE\Software\Microsoft\Cryptography\Defaults\Provider. Dim csp As New CspParameters(1, "Schlumberger Cryptographic Service Provider") csp.Flags = CspProviderFlags.UseDefaultKeyContainer ' Initialize an RSACryptoServiceProvider object using ' the CspParameters object. Dim rsa As New RSACryptoServiceProvider(csp) ' Create some data to sign. Dim data() As Byte = {0, 1, 2, 3, 4, 5, 6, 7} Console.WriteLine("Data : " + BitConverter.ToString(data)) ' Sign the data using the Smart Card CryptoGraphic Provider. Dim sig As Byte() = rsa.SignData(data, "SHA1") Console.WriteLine("Signature : " + BitConverter.ToString(sig)) ' Verify the data using the Smart Card CryptoGraphic Provider. Dim verified As Boolean = rsa.VerifyData(data, "SHA1", sig) Console.WriteLine("Verified") End Sub End Module
using System; using System.Security.Cryptography; namespace SmartCardSign { class SCSign { static void Main(string[] args) { // To idendify the Smart Card CryptoGraphic Providers on your // computer, use the Microsoft Registry Editor (Regedit.exe). // The available Smart Card CryptoGraphic Providers are listed // in HKEY_LOCAL_MACHINE\Software\Microsoft\Cryptography\Defaults\Provider. // Create a new CspParameters object that identifies a // Smart Card CryptoGraphic Provider. // The 1st parameter comes from HKEY_LOCAL_MACHINE\Software\Microsoft\Cryptography\Defaults\Provider Types. // The 2nd parameter comes from HKEY_LOCAL_MACHINE\Software\Microsoft\Cryptography\Defaults\Provider. CspParameters csp = new CspParameters(1, "Schlumberger Cryptographic Service Provider"); csp.Flags = CspProviderFlags.UseDefaultKeyContainer; // Initialize an RSACryptoServiceProvider object using // the CspParameters object. RSACryptoServiceProvider rsa = new RSACryptoServiceProvider(csp); // Create some data to sign. byte[] data = new byte[] { 0, 1, 2, 3, 4, 5, 6, 7 }; Console.WriteLine("Data : " + BitConverter.ToString(data)); // Sign the data using the Smart Card CryptoGraphic Provider. byte[] sig = rsa.SignData(data, "SHA1"); Console.WriteLine("Signature : " + BitConverter.ToString(sig)); // Verify the data using the Smart Card CryptoGraphic Provider. bool verified = rsa.VerifyData(data, "SHA1", sig); Console.WriteLine("Verified : " + verified); } } }
using namespace System; using namespace System::Security::Cryptography; int main() { // To idendify the Smart Card CryptoGraphic Providers on your // computer, use the Microsoft Registry Editor (Regedit.exe). // The available Smart Card CryptoGraphic Providers are listed // in HKEY_LOCAL_MACHINE\Software\Microsoft\Cryptography\Defaults\Provider. // Create a new CspParameters object that identifies a // Smart Card CryptoGraphic Provider. // The 1st parameter comes from HKEY_LOCAL_MACHINE\Software\Microsoft\Cryptography\Defaults\Provider Types. // The 2nd parameter comes from HKEY_LOCAL_MACHINE\Software\Microsoft\Cryptography\Defaults\Provider. CspParameters^ csp = gcnew CspParameters( 1,L"Schlumberger Cryptographic Service Provider" ); csp->Flags = CspProviderFlags::UseDefaultKeyContainer; // Initialize an RSACryptoServiceProvider object using // the CspParameters object. RSACryptoServiceProvider^ rsa = gcnew RSACryptoServiceProvider( csp ); // Create some data to sign. array<Byte>^data = gcnew array<Byte>{ 0,1,2,3,4,5,6,7 }; Console::WriteLine( L"Data : {0}", BitConverter::ToString( data ) ); // Sign the data using the Smart Card CryptoGraphic Provider. array<Byte>^sig = rsa->SignData( data, L"SHA1" ); Console::WriteLine( L"Signature : {0}", BitConverter::ToString( sig ) ); // Verify the data using the Smart Card CryptoGraphic Provider. bool verified = rsa->VerifyData( data, L"SHA1", sig ); Console::WriteLine( L"Verified : {0}", verified ); }

System.Security.Cryptography.CspParameters


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 によってサポートされていないバージョンがあります。サポートされているバージョンについては、「システム要件」を参照してください。


CspParameters コンストラクタ ()
アセンブリ: mscorlib (mscorlib.dll 内)


この形式の CspParameters は、ProviderType フィールドを値 1 に初期化します。この値は、PROV_RSA_FULL プロバイダを示します。この既定のプロバイダは、RSA アルゴリズムと互換性があります。

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 によってサポートされていないバージョンがあります。サポートされているバージョンについては、「システム要件」を参照してください。


CspParameters コンストラクタ (Int32)
アセンブリ: mscorlib (mscorlib.dll 内)


CspParameters コンストラクタを使用し、プロバイダを表す数値を渡してプロバイダの種類を指定します。既定プロバイダの種類を表す数値は、WinCrypt.h ヘッダー ファイルで定義されます。
他のプロバイダの種類の値については、ProviderType フィールドを参照してください。既定のプロバイダの種類とそれらの動作の詳細については、MSDN ライブラリで CAPI (Microsoft Cryptography API) に関するドキュメントを参照してください。

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 によってサポートされていないバージョンがあります。サポートされているバージョンについては、「システム要件」を参照してください。


CspParameters コンストラクタ (Int32, String)
アセンブリ: mscorlib (mscorlib.dll 内)

Dim dwTypeIn As Integer Dim strProviderNameIn As String Dim instance As New CspParameters(dwTypeIn, strProviderNameIn)
- strProviderNameIn
プロバイダ名。

CspParameters コンストラクタを使用して、プロバイダの種類と名前を指定します。
プロバイダの種類を指定するには、目的のプロバイダの種類を表す数値を渡します。既定プロバイダの種類を表す数値は、WinCrypt.h ヘッダー ファイルで定義されます。
他のプロバイダの種類の値については、ProviderType フィールドを参照してください。既定のプロバイダの種類とそれらの動作の詳細については、MSDN ライブラリで CAPI (Microsoft Cryptography API) に関するドキュメントを参照してください。

CspParameters クラスを使用してスマート カード暗号化サービス プロバイダを選択するコード例を次に示します。その後で、スマート カードを使用してデータに署名し、そのデータを検証します。
Imports System Imports System.Security.Cryptography Module SCSign Sub Main(ByVal args() As String) ' To idendify the Smart Card CryptoGraphic Providers on your ' computer, use the Microsoft Registry Editor (Regedit.exe). ' The available Smart Card CryptoGraphic Providers are listed ' in HKEY_LOCAL_MACHINE\Software\Microsoft\Cryptography\Defaults\Provider. ' Create a new CspParameters object that identifies a ' Smart Card CryptoGraphic Provider. ' The 1st parameter comes from HKEY_LOCAL_MACHINE\Software\Microsoft\Cryptography\Defaults\Provider Types. ' The 2nd parameter comes from HKEY_LOCAL_MACHINE\Software\Microsoft\Cryptography\Defaults\Provider. Dim csp As New CspParameters(1, "Schlumberger Cryptographic Service Provider") csp.Flags = CspProviderFlags.UseDefaultKeyContainer ' Initialize an RSACryptoServiceProvider object using ' the CspParameters object. Dim rsa As New RSACryptoServiceProvider(csp) ' Create some data to sign. Dim data() As Byte = {0, 1, 2, 3, 4, 5, 6, 7} Console.WriteLine("Data : " + BitConverter.ToString(data)) ' Sign the data using the Smart Card CryptoGraphic Provider. Dim sig As Byte() = rsa.SignData(data, "SHA1") Console.WriteLine("Signature : " + BitConverter.ToString(sig)) ' Verify the data using the Smart Card CryptoGraphic Provider. Dim verified As Boolean = rsa.VerifyData(data, "SHA1", sig) Console.WriteLine("Verified") End Sub End Module
using System; using System.Security.Cryptography; namespace SmartCardSign { class SCSign { static void Main(string[] args) { // To idendify the Smart Card CryptoGraphic Providers on your // computer, use the Microsoft Registry Editor (Regedit.exe). // The available Smart Card CryptoGraphic Providers are listed // in HKEY_LOCAL_MACHINE\Software\Microsoft\Cryptography\Defaults\Provider. // Create a new CspParameters object that identifies a // Smart Card CryptoGraphic Provider. // The 1st parameter comes from HKEY_LOCAL_MACHINE\Software\Microsoft\Cryptography\Defaults\Provider Types. // The 2nd parameter comes from HKEY_LOCAL_MACHINE\Software\Microsoft\Cryptography\Defaults\Provider. CspParameters csp = new CspParameters(1, "Schlumberger Cryptographic Service Provider"); csp.Flags = CspProviderFlags.UseDefaultKeyContainer; // Initialize an RSACryptoServiceProvider object using // the CspParameters object. RSACryptoServiceProvider rsa = new RSACryptoServiceProvider(csp); // Create some data to sign. byte[] data = new byte[] { 0, 1, 2, 3, 4, 5, 6, 7 }; Console.WriteLine("Data : " + BitConverter.ToString(data)); // Sign the data using the Smart Card CryptoGraphic Provider. byte[] sig = rsa.SignData(data, "SHA1"); Console.WriteLine("Signature : " + BitConverter.ToString(sig)); // Verify the data using the Smart Card CryptoGraphic Provider. bool verified = rsa.VerifyData(data, "SHA1", sig); Console.WriteLine("Verified : " + verified); } } }
using namespace System; using namespace System::Security::Cryptography; int main() { // To idendify the Smart Card CryptoGraphic Providers on your // computer, use the Microsoft Registry Editor (Regedit.exe). // The available Smart Card CryptoGraphic Providers are listed // in HKEY_LOCAL_MACHINE\Software\Microsoft\Cryptography\Defaults\Provider. // Create a new CspParameters object that identifies a // Smart Card CryptoGraphic Provider. // The 1st parameter comes from HKEY_LOCAL_MACHINE\Software\Microsoft\Cryptography\Defaults\Provider Types. // The 2nd parameter comes from HKEY_LOCAL_MACHINE\Software\Microsoft\Cryptography\Defaults\Provider. CspParameters^ csp = gcnew CspParameters( 1,L"Schlumberger Cryptographic Service Provider" ); csp->Flags = CspProviderFlags::UseDefaultKeyContainer; // Initialize an RSACryptoServiceProvider object using // the CspParameters object. RSACryptoServiceProvider^ rsa = gcnew RSACryptoServiceProvider( csp ); // Create some data to sign. array<Byte>^data = gcnew array<Byte>{ 0,1,2,3,4,5,6,7 }; Console::WriteLine( L"Data : {0}", BitConverter::ToString( data ) ); // Sign the data using the Smart Card CryptoGraphic Provider. array<Byte>^sig = rsa->SignData( data, L"SHA1" ); Console::WriteLine( L"Signature : {0}", BitConverter::ToString( sig ) ); // Verify the data using the Smart Card CryptoGraphic Provider. bool verified = rsa->VerifyData( data, L"SHA1", sig ); Console::WriteLine( L"Verified : {0}", verified ); }

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 によってサポートされていないバージョンがあります。サポートされているバージョンについては、「システム要件」を参照してください。


CspParameters コンストラクタ (Int32, String, String, CryptoKeySecurity, IntPtr)
アセンブリ: mscorlib (mscorlib.dll 内)

Public Sub New ( _ providerType As Integer, _ providerName As String, _ keyContainerName As String, _ cryptoKeySecurity As CryptoKeySecurity, _ parentWindowHandle As IntPtr _ )
Dim providerType As Integer Dim providerName As String Dim keyContainerName As String Dim cryptoKeySecurity As CryptoKeySecurity Dim parentWindowHandle As IntPtr Dim instance As New CspParameters(providerType, providerName, keyContainerName, cryptoKeySecurity, parentWindowHandle)
public CspParameters ( int providerType, string providerName, string keyContainerName, CryptoKeySecurity cryptoKeySecurity, IntPtr parentWindowHandle )
public: CspParameters ( int providerType, String^ providerName, String^ keyContainerName, CryptoKeySecurity^ cryptoKeySecurity, IntPtr parentWindowHandle )
public CspParameters ( int providerType, String providerName, String keyContainerName, CryptoKeySecurity cryptoKeySecurity, IntPtr parentWindowHandle )
public function CspParameters ( providerType : int, providerName : String, keyContainerName : String, cryptoKeySecurity : CryptoKeySecurity, parentWindowHandle : IntPtr )
- providerName
プロバイダ名。
- keyContainerName
コンテナ名。

コンテナ名を使用して、そのコンテナ内に格納されたキーを取得できます。
プロバイダの種類を指定するには、目的のプロバイダの種類を表す数値を渡します。既定プロバイダの種類を表す数値は、WinCrypt.h ヘッダー ファイルで定義されます。
他のプロバイダの種類の値については、ProviderType フィールドを参照してください。既定のプロバイダの種類とそれらの動作の詳細については、MSDN ライブラリで CAPI (Microsoft Cryptography API) に関するドキュメントを参照してください。

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 によってサポートされていないバージョンがあります。サポートされているバージョンについては、「システム要件」を参照してください。


CspParameters コンストラクタ (Int32, String, String, CryptoKeySecurity, SecureString)
アセンブリ: mscorlib (mscorlib.dll 内)

Public Sub New ( _ providerType As Integer, _ providerName As String, _ keyContainerName As String, _ cryptoKeySecurity As CryptoKeySecurity, _ keyPassword As SecureString _ )
Dim providerType As Integer Dim providerName As String Dim keyContainerName As String Dim cryptoKeySecurity As CryptoKeySecurity Dim keyPassword As SecureString Dim instance As New CspParameters(providerType, providerName, keyContainerName, cryptoKeySecurity, keyPassword)
public CspParameters ( int providerType, string providerName, string keyContainerName, CryptoKeySecurity cryptoKeySecurity, SecureString keyPassword )
public: CspParameters ( int providerType, String^ providerName, String^ keyContainerName, CryptoKeySecurity^ cryptoKeySecurity, SecureString^ keyPassword )
public CspParameters ( int providerType, String providerName, String keyContainerName, CryptoKeySecurity cryptoKeySecurity, SecureString keyPassword )
public function CspParameters ( providerType : int, providerName : String, keyContainerName : String, cryptoKeySecurity : CryptoKeySecurity, keyPassword : SecureString )
- providerName
プロバイダ名。
- keyContainerName
コンテナ名。

コンテナ名を使用して、そのコンテナ内に格納されたキーを取得できます。
プロバイダの種類を指定するには、目的のプロバイダの種類を表す数値を渡します。既定プロバイダの種類を表す数値は、WinCrypt.h ヘッダー ファイルで定義されます。
他のプロバイダの種類の値については、ProviderType フィールドを参照してください。既定のプロバイダの種類とそれらの動作の詳細については、MSDN ライブラリで CAPI (Microsoft Cryptography API) に関するドキュメントを参照してください。

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 によってサポートされていないバージョンがあります。サポートされているバージョンについては、「システム要件」を参照してください。


CspParameters コンストラクタ

名前 | 説明 |
---|---|
CspParameters () | CspParameters クラスの新しいインスタンスを初期化します。 .NET Compact Framework によってサポートされています。 |
CspParameters (Int32) | 指定したプロバイダの種類コードコードを使用して、CspParameters クラスの新しいインスタンスを初期化します。 .NET Compact Framework によってサポートされています。 |
CspParameters (Int32, String) | 指定したプロバイダの種類コードと名前を使用して、CspParameters クラスの新しいインスタンスを初期化します。 .NET Compact Framework によってサポートされています。 |
CspParameters (Int32, String, String) | 指定したプロバイダの種類コードと名前、および指定したコンテナ名を使用して、CspParameters クラスの新しいインスタンスを初期化します。 .NET Compact Framework によってサポートされています。 |
CspParameters (Int32, String, String, CryptoKeySecurity, IntPtr) | プロバイダの種類、プロバイダ名、コンテナ名、アクセス情報、およびアンマネージ スマート カード パスワード ダイアログを識別するハンドルを使用して、CspParameters クラスの新しいインスタンスを初期化します。 |
CspParameters (Int32, String, String, CryptoKeySecurity, SecureString) | プロバイダの種類、プロバイダ名、コンテナ名、アクセス情報、およびスマート カード キーに関連付けられたパスワードを使用して、CspParameters クラスの新しいインスタンスを初期化します。 |

CspParameters コンストラクタ (Int32, String, String)
アセンブリ: mscorlib (mscorlib.dll 内)

Public Sub New ( _ dwTypeIn As Integer, _ strProviderNameIn As String, _ strContainerNameIn As String _ )
Dim dwTypeIn As Integer Dim strProviderNameIn As String Dim strContainerNameIn As String Dim instance As New CspParameters(dwTypeIn, strProviderNameIn, strContainerNameIn)
public function CspParameters ( dwTypeIn : int, strProviderNameIn : String, strContainerNameIn : String )
- strProviderNameIn
プロバイダ名。
- strContainerNameIn
コンテナ名。

CspParameters コンストラクタを使用して、プロバイダの種類、プロバイダ名、およびコンテナ名を指定します。
コンテナ名を使用して、そのコンテナ内に格納されたキーを取得できます。
プロバイダの種類を指定するには、目的のプロバイダの種類を表す数値を渡します。既定プロバイダの種類を表す数値は、WinCrypt.h ヘッダー ファイルで定義されます。
他のプロバイダの種類の値については、ProviderType フィールドを参照してください。既定のプロバイダの種類とそれらの動作の詳細については、MSDN ライブラリで CAPI (Microsoft Cryptography API) に関するドキュメントを参照してください。

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 によってサポートされていないバージョンがあります。サポートされているバージョンについては、「システム要件」を参照してください。


CspParameters フィールド
CspParameters プロパティ

名前 | 説明 | |
---|---|---|
![]() | CryptoKeySecurity | コンテナに対するアクセス権および監視規則を表す CryptoKeySecurity オブジェクトを取得または設定します。 |
![]() ![]() | KeyPassword | スマート カード キーに関連付けられたパスワードを取得または設定します。 |
![]() | ParentWindowHandle | スマート カード パスワード ダイアログのアンマネージ親ウィンドウを識別するハンドルを取得または設定します。 |

CspParameters メソッド

名前 | 説明 | |
---|---|---|
![]() | Equals | オーバーロードされます。 2 つの Object インスタンスが等しいかどうかを判断します。 ( Object から継承されます。) |
![]() | GetHashCode | 特定の型のハッシュ関数として機能します。GetHashCode は、ハッシュ アルゴリズムや、ハッシュ テーブルのようなデータ構造での使用に適しています。 ( Object から継承されます。) |
![]() | GetType | 現在のインスタンスの Type を取得します。 ( Object から継承されます。) |
![]() | ReferenceEquals | 指定した複数の Object インスタンスが同一かどうかを判断します。 ( Object から継承されます。) |
![]() | ToString | 現在の Object を表す String を返します。 ( Object から継承されます。) |

CspParameters メンバ
暗号計算を実行する暗号サービス プロバイダ (CSP : Cryptographic Service Provider) に渡されるパラメータを格納します。このクラスは継承できません。
CspParameters データ型で公開されるメンバを以下の表に示します。



名前 | 説明 | |
---|---|---|
![]() | CryptoKeySecurity | コンテナに対するアクセス権および監視規則を表す CryptoKeySecurity オブジェクトを取得または設定します。 |
![]() ![]() | KeyPassword | スマート カード キーに関連付けられたパスワードを取得または設定します。 |
![]() | ParentWindowHandle | スマート カード パスワード ダイアログのアンマネージ親ウィンドウを識別するハンドルを取得または設定します。 |

名前 | 説明 | |
---|---|---|
![]() | Equals | オーバーロードされます。 2 つの Object インスタンスが等しいかどうかを判断します。 (Object から継承されます。) |
![]() | GetHashCode | 特定の型のハッシュ関数として機能します。GetHashCode は、ハッシュ アルゴリズムや、ハッシュ テーブルのようなデータ構造での使用に適しています。 (Object から継承されます。) |
![]() | GetType | 現在のインスタンスの Type を取得します。 (Object から継承されます。) |
![]() | ReferenceEquals | 指定した複数の Object インスタンスが同一かどうかを判断します。 (Object から継承されます。) |
![]() | ToString | 現在の Object を表す String を返します。 (Object から継承されます。) |

- CspParametersのページへのリンク