AsymmetricAlgorithm.Create メソッド

定義

非対称アルゴリズムを実行するために使用する暗号オブジェクトを作成します。Creates a cryptographic object used to perform the asymmetric algorithm.

オーバーロード

Create()

非対称アルゴリズムを実行するために使用する既定の暗号オブジェクトを作成します。Creates a default cryptographic object used to perform the asymmetric algorithm.

Create(String)

非対称アルゴリズムの指定した実装のインスタンスを作成します。Creates an instance of the specified implementation of an asymmetric algorithm.

Create()

非対称アルゴリズムを実行するために使用する既定の暗号オブジェクトを作成します。Creates a default cryptographic object used to perform the asymmetric algorithm.

public:
 static System::Security::Cryptography::AsymmetricAlgorithm ^ Create();
public static System.Security.Cryptography.AsymmetricAlgorithm Create ();
static member Create : unit -> System.Security.Cryptography.AsymmetricAlgorithm
Public Shared Function Create () As AsymmetricAlgorithm

戻り値

<cryptoClass> 要素を使用して既定の設定が変更されていない限り、新しい RSACryptoServiceProvider インスタンス。A new RSACryptoServiceProvider instance, unless the default settings have been changed with the <cryptoClass> element.

次のコード例は、拡張クラスにCreateメソッドを実装する方法を示しています。The following code example demonstrates how to implement the Create method in an extended class. このコード例は、 AsymmetricAlgorithmクラスに対して提供される大規模な例の一部です。This code example is part of a larger example provided for the AsymmetricAlgorithm class.

    // The create function attempts to create a CustomCrypto 
    // object using the assembly name. This functionality requires 
    // modification of the machine.config file. Add the following 
    // section to the configuration element and modify the values 
    // of the cryptoClass to reflect what isinstalled 
    // in your machines GAC.
    //        <cryptoClass CustomCrypto="Contoso.CustomCrypto,
    //          CustomCrypto,
    //          Culture=neutral,
    //          PublicKeyToken=fdb9f9c4851028bf,
    //          Version=1.0.1448.27640" />
    //      <nameEntry name="Contoso.CustomCrypto" 
    //         class="CustomCrypto" />
    //      <nameEntry name="CustomCrypto" class="CustomCrypto" />

public:
    static CustomCrypto^ Create() 
    {
        return Create("CustomCrypto");
    }
// The create function attempts to create a CustomCrypto object using
// the assembly name. This functionality requires modification of the
// machine.config file. Add the following section to the configuration
// element and modify the values of the cryptoClass to reflect what is
// installed in your machines GAC.
//        <cryptoClass CustomCrypto="Contoso.CustomCrypto, 
//          CustomCrypto, 
//          Culture=neutral, 
//          PublicKeyToken=fdb9f9c4851028bf, 
//          Version=1.0.1448.27640" />
//      <nameEntry name="Contoso.CustomCrypto" class="CustomCrypto" />
//      <nameEntry name="CustomCrypto" class="CustomCrypto" />
new static public CustomCrypto Create() 
{
    return Create("CustomCrypto");
}
' The create function attempts to create a vbCustomCrypto object using
' the assembly name. This functionality requires modification of the
' machine.config file. Add the following section to the configuration
' element and modify the values of the cryptoClass to reflect what is
' installed in your machines GAC.
'          <cryptoClass vbCustomCrypto="Contoso.vbCustomCrypto, 
'            vbCustomCrypto, 
'            Culture=neutral, 
'            PublicKeyToken=fdb9f9c4851028bf, 
'            Version=1.0.1448.27640" />
'        <nameEntry name="Contoso.vbCustomCrypto" 
'                   class="vbCustomCrypto" />
'        <nameEntry name="vbCustomCrypto" class="vbCustomCrypto" />
Public Shadows Function Create() As vbCustomCrypto
    Return Create("vbCustomCrypto")
End Function

こちらもご覧ください

Create(String)

非対称アルゴリズムの指定した実装のインスタンスを作成します。Creates an instance of the specified implementation of an asymmetric algorithm.

public:
 static System::Security::Cryptography::AsymmetricAlgorithm ^ Create(System::String ^ algName);
public static System.Security.Cryptography.AsymmetricAlgorithm Create (string algName);
static member Create : string -> System.Security.Cryptography.AsymmetricAlgorithm
Public Shared Function Create (algName As String) As AsymmetricAlgorithm

パラメーター

algName
String

使用する非対称アルゴリズムの実装。The asymmetric algorithm implementation to use. algName パラメーターの有効値、およびそれらの割り当て先のアルゴリズムを次の表に示します。The following table shows the valid values for the algName parameter and the algorithms they map to.

パラメーター値Parameter value Implements
System.Security.Cryptography.AsymmetricAlgorithmSystem.Security.Cryptography.AsymmetricAlgorithm AsymmetricAlgorithm
RSARSA RSA
System.Security.Cryptography.RSASystem.Security.Cryptography.RSA RSA
DSADSA DSA
System.Security.Cryptography.DSASystem.Security.Cryptography.DSA DSA
ECDsaECDsa ECDsa
ECDsaCngECDsaCng ECDsaCng
System.Security.Cryptography.ECDsaCngSystem.Security.Cryptography.ECDsaCng ECDsaCng
ECDHECDH ECDiffieHellman
ECDiffieHellmanECDiffieHellman ECDiffieHellman
ECDiffieHellmanCngECDiffieHellmanCng ECDiffieHellmanCng
System.Security.Cryptography.ECDiffieHellmanCngSystem.Security.Cryptography.ECDiffieHellmanCng ECDiffieHellmanCng

戻り値

指定した非対称アルゴリズムの実装の新しいインスタンス。A new instance of the specified asymmetric algorithm implementation.

次のコード例は、拡張クラスにCreateメソッドを実装する方法を示しています。The following code example demonstrates how to implement the Create method in an extended class. このコード例は、 AsymmetricAlgorithmクラスに対して提供される大規模な例の一部です。This code example is part of a larger example provided for the AsymmetricAlgorithm class.

    // The create function attempts to create a CustomCrypto object 
    // using the assembly name. This functionality requires 
    // modification of the machine.config file. Add the following 
    // section to the configuration element and modify the values 
    // of the cryptoClass to reflect what is installed 
    // in your machines GAC.
    //       <cryptoClass CustomCrypto="Contoso.CustomCrypto,
    //         CustomCrypto,
    //         Culture=neutral,
    //         PublicKeyToken=fdb9f9c4851028bf,
    //         Version=1.0.1448.27640" />
    //     <nameEntry name="Contoso.CustomCrypto" 
    //        class="CustomCrypto" />
    //     <nameEntry name="CustomCrypto" class="CustomCrypto" />

public:
    static CustomCrypto^ Create(String^ algorithmName) 
    {
        return (CustomCrypto^) 
            CryptoConfig::CreateFromName(algorithmName);
    }
// The create function attempts to create a CustomCrypto object using
// the assembly name. This functionality requires modification of the
// machine.config file. Add the following section to the configuration
// element and modify the values of the cryptoClass to reflect what is
// installed in your machines GAC.
//       <cryptoClass CustomCrypto="Contoso.CustomCrypto, 
//         CustomCrypto, 
//         Culture=neutral, 
//         PublicKeyToken=fdb9f9c4851028bf, 
//         Version=1.0.1448.27640" />
//     <nameEntry name="Contoso.CustomCrypto" class="CustomCrypto" />
//     <nameEntry name="CustomCrypto" class="CustomCrypto" />
new static public CustomCrypto Create(String algorithmName) 
{
    return (CustomCrypto) CryptoConfig.CreateFromName(algorithmName);
}
' The create function attempts to create a vbCustomCrypto object using
' the assembly name. This functionality requires modification of the
' machine.config file. Add the following section to the configuration
' element and modify the values of the cryptoClass to reflect what is
' installed in your machines GAC.
'          <cryptoClass vbCustomCrypto="Contoso.vbCustomCrypto, 
'            vbCustomCrypto, 
'            Culture=neutral, 
'            PublicKeyToken=fdb9f9c4851028bf, 
'            Version=1.0.1448.27640" />
'        <nameEntry name="Contoso.vbCustomCrypto" 
'                   class="vbCustomCrypto" />
'        <nameEntry name="vbCustomCrypto" class="vbCustomCrypto" />
Public Shadows Function Create( _
    ByVal algorithmName As String) As vbCustomCrypto

    Return CType( _
        CryptoConfig.CreateFromName(algorithmName), _
        vbCustomCrypto)

End Function

こちらもご覧ください

適用対象