CspParametersとは? わかりやすく解説

CspParameters クラス

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

名前空間: System.Security.Cryptography
アセンブリ: mscorlib (mscorlib.dll 内)
構文構文

<ComVisibleAttribute(True)> _
Public NotInheritable Class
 CspParameters
Dim instance As CspParameters
[ComVisibleAttribute(true)] 
public sealed class CspParameters
[ComVisibleAttribute(true)] 
public ref class CspParameters sealed
/** @attribute ComVisibleAttribute(true) */ 
public final class CspParameters
ComVisibleAttribute(true) 
public final class CspParameters
解説解説

CspParameters クラスは、アンマネージ CAPI (Microsoft Cryptography API) から内部的に Microsoft 暗号化サービス プロバイダ (CSP) を使用するマネージ暗号化クラスに渡すことができるパラメータを表します。"CryptoServiceProvider" で終わる名前を持つクラスは、対応する CSP のマネージ コード ラッパーです。

次の処理を行うには、CspParameters クラスを使用します。

使用例使用例

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.Object
  System.Security.Cryptography.CspParameters
スレッド セーフスレッド セーフ
この型の public static (Visual Basic では Shared) メンバはすべて、スレッド セーフです。インスタンス メンバの場合は、スレッド セーフであるとは限りません。
プラットフォームプラットフォーム
バージョン情報バージョン情報
参照参照

CspParameters コンストラクタ ()

CspParameters クラスの新しいインスタンスを初期化します。

名前空間: System.Security.Cryptography
アセンブリ: mscorlib (mscorlib.dll 内)
構文構文

public CspParameters ()
public:
CspParameters ()
public CspParameters ()
public function CspParameters ()

CspParameters の新しく作成したインスタンス。

解説解説

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

他のプロバイダの種類については、ProviderType フィールドを参照してください。

使用例使用例

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 クラス
CspParameters メンバ
System.Security.Cryptography 名前空間
その他の技術情報
暗号サービス

CspParameters コンストラクタ (Int32)

指定したプロバイダの種類コードコードを使用して、CspParameters クラスの新しいインスタンスを初期化します。

名前空間: System.Security.Cryptography
アセンブリ: mscorlib (mscorlib.dll 内)
構文構文

Public Sub New ( _
    dwTypeIn As Integer _
)
Dim dwTypeIn As Integer

Dim instance As New CspParameters(dwTypeIn)
public CspParameters (
    int dwTypeIn
)
public:
CspParameters (
    int dwTypeIn
)
public CspParameters (
    int dwTypeIn
)
public function CspParameters (
    dwTypeIn : int
)

パラメータ

dwTypeIn

作成するプロバイダの種類を示すプロバイダの種類コード。

解説解説
使用例使用例

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 クラス
CspParameters メンバ
System.Security.Cryptography 名前空間
その他の技術情報
暗号サービス

CspParameters コンストラクタ (Int32, String)

指定したプロバイダの種類コードと名前を使用して、CspParameters クラスの新しいインスタンスを初期化します。

名前空間: System.Security.Cryptography
アセンブリ: mscorlib (mscorlib.dll 内)
構文構文

Public Sub New ( _
    dwTypeIn As Integer, _
    strProviderNameIn As String _
)
Dim dwTypeIn As Integer
Dim strProviderNameIn As String

Dim instance As New CspParameters(dwTypeIn,
 strProviderNameIn)
public CspParameters (
    int dwTypeIn,
    string strProviderNameIn
)
public:
CspParameters (
    int dwTypeIn, 
    String^ strProviderNameIn
)
public CspParameters (
    int dwTypeIn, 
    String strProviderNameIn
)
public function CspParameters (
    dwTypeIn : int, 
    strProviderNameIn : String
)

パラメータ

dwTypeIn

作成するプロバイダの種類を示すプロバイダの種類コード。

strProviderNameIn

プロバイダ名。

解説解説
使用例使用例

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 );
}

プラットフォームプラットフォーム
バージョン情報バージョン情報
参照参照
関連項目
CspParameters クラス
CspParameters メンバ
System.Security.Cryptography 名前空間
その他の技術情報
暗号サービス

CspParameters コンストラクタ (Int32, String, String, CryptoKeySecurity, IntPtr)

メモ : このコンストラクタは、.NET Framework version 2.0 で新しく追加されたものです。

プロバイダの種類、プロバイダ名、コンテナ名、アクセス情報、およびアンマネージ スマート カード パスワード ダイアログを識別するハンドルを使用して、CspParameters クラスの新しいインスタンスを初期化します。

名前空間: System.Security.Cryptography
アセンブリ: 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
)

パラメータ

providerType

作成するプロバイダの種類を示すプロバイダの種類コード。

providerName

プロバイダ名。

keyContainerName

コンテナ名。

cryptoKeySecurity

コンテナに対するアクセス権および監視規則を表す CryptoKeySecurity オブジェクト。

parentWindowHandle

スマート カード パスワード ダイアログの親ウィンドウを識別するハンドル。

解説解説
プラットフォームプラットフォーム
バージョン情報バージョン情報
参照参照
関連項目
CspParameters クラス
CspParameters メンバ
System.Security.Cryptography 名前空間

CspParameters コンストラクタ (Int32, String, String, CryptoKeySecurity, SecureString)

メモ : このコンストラクタは、.NET Framework version 2.0 で新しく追加されたものです。

プロバイダの種類、プロバイダ名、コンテナ名、アクセス情報、およびスマート カード キーに関連付けられたパスワードを使用して、CspParameters クラスの新しいインスタンスを初期化します。

名前空間: System.Security.Cryptography
アセンブリ: 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
)

パラメータ

providerType

作成するプロバイダの種類を示すプロバイダの種類コード。

providerName

プロバイダ名。

keyContainerName

コンテナ名。

cryptoKeySecurity

コンテナに対するアクセス権および監視規則を表す CryptoKeySecurity オブジェクト。

keyPassword

スマート カード キーに関連付けられたパスワード。

解説解説
プラットフォームプラットフォーム
バージョン情報バージョン情報
参照参照
関連項目
CspParameters クラス
CspParameters メンバ
System.Security.Cryptography 名前空間

CspParameters コンストラクタ

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 クラス
CspParameters メンバ
System.Security.Cryptography 名前空間

その他の技術情報

暗号サービス

CspParameters コンストラクタ (Int32, String, String)

指定したプロバイダの種類コードと名前、および指定したコンテナ名を使用して、CspParameters クラスの新しいインスタンスを初期化します。

名前空間: System.Security.Cryptography
アセンブリ: 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 CspParameters (
    int dwTypeIn,
    string strProviderNameIn,
    string strContainerNameIn
)
public:
CspParameters (
    int dwTypeIn, 
    String^ strProviderNameIn, 
    String^ strContainerNameIn
)
public CspParameters (
    int dwTypeIn, 
    String strProviderNameIn, 
    String strContainerNameIn
)
public function CspParameters (
    dwTypeIn : int, 
    strProviderNameIn : String, 
    strContainerNameIn : String
)

パラメータ

dwTypeIn

作成するプロバイダの種類を示すプロバイダの種類コード。

strProviderNameIn

プロバイダ名。

strContainerNameIn

コンテナ名。

解説解説
プラットフォームプラットフォーム
バージョン情報バージョン情報
参照参照
関連項目
CspParameters クラス
CspParameters メンバ
System.Security.Cryptography 名前空間
その他の技術情報
暗号サービス

CspParameters フィールド


パブリック フィールドパブリック フィールド

  名前 説明
パブリック フィールド ProviderType CspParameters のプロバイダの種類コードを表します。
参照参照

関連項目

CspParameters クラス
System.Security.Cryptography 名前空間

その他の技術情報

暗号サービス

CspParameters プロパティ


パブリック プロパティパブリック プロパティ

  名前 説明
パブリック プロパティ CryptoKeySecurity コンテナに対するアクセス権および監視規則を表す CryptoKeySecurity オブジェクトを取得または設定します。
パブリック プロパティ .NET Compact Framework によるサポート KeyPassword スマート カード キーに関連付けられたパスワードを取得または設定します。
パブリック プロパティ ParentWindowHandle スマート カード パスワード ダイアログのアンマネージ親ウィンドウを識別するハンドルを取得または設定します。
参照参照

関連項目

CspParameters クラス
System.Security.Cryptography 名前空間

その他の技術情報

暗号サービス

CspParameters メソッド


CspParameters メンバ

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

CspParameters データ型で公開されるメンバを以下の表に示します。


パブリック コンストラクタパブリック コンストラクタ
パブリック フィールドパブリック フィールド
  名前 説明
パブリック フィールド ProviderType CspParameters のプロバイダの種類コードを表します。
パブリック プロパティパブリック プロパティ
  名前 説明
パブリック プロパティ CryptoKeySecurity コンテナに対するアクセス権および監視規則を表す CryptoKeySecurity オブジェクトを取得または設定します。
パブリック プロパティ .NET Compact Framework によるサポート KeyPassword スマート カード キーに関連付けられたパスワードを取得または設定します。
パブリック プロパティ ParentWindowHandle スマート カード パスワード ダイアログのアンマネージ親ウィンドウを識別するハンドルを取得または設定します。
パブリック メソッドパブリック メソッド
参照参照

関連項目

CspParameters クラス
System.Security.Cryptography 名前空間

その他の技術情報

暗号サービス



英和和英テキスト翻訳

英語⇒日本語日本語⇒英語

辞書ショートカット

すべての辞書の索引

「CspParameters」の関連用語

CspParametersのお隣キーワード
検索ランキング

   

英語⇒日本語
日本語⇒英語
   



CspParametersのページの著作権

   
日本マイクロソフト株式会社日本マイクロソフト株式会社
© 2026 Microsoft.All rights reserved.

©2026 GRAS Group, Inc.RSS