AsymmetricAlgorithm.Create メソッド
定義
重要
一部の情報は、リリース前に大きく変更される可能性があるプレリリースされた製品に関するものです。 Microsoft は、ここに記載されている情報について、明示または黙示を問わず、一切保証しません。
非対称アルゴリズムを実行するために使用する暗号オブジェクトを作成します。
オーバーロード
Create() |
互換性のために残されています。
互換性のために残されています。
非対称アルゴリズムを実行するために使用する既定の暗号オブジェクトを作成します。 |
Create(String) |
非対称アルゴリズムの指定した実装のインスタンスを作成します。 |
Create()
注意事項
The default implementation of this cryptography algorithm is not supported
注意事項
The default implementation of this cryptography algorithm is not supported.
非対称アルゴリズムを実行するために使用する既定の暗号オブジェクトを作成します。
public:
static System::Security::Cryptography::AsymmetricAlgorithm ^ Create();
[System.Obsolete("The default implementation of this cryptography algorithm is not supported", DiagnosticId="SYSLIB0007", UrlFormat="https://aka.ms/dotnet-warnings/{0}")]
public static System.Security.Cryptography.AsymmetricAlgorithm Create ();
[System.Obsolete("The default implementation of this cryptography algorithm is not supported.", DiagnosticId="SYSLIB0007", UrlFormat="https://aka.ms/dotnet-warnings/{0}")]
public static System.Security.Cryptography.AsymmetricAlgorithm Create ();
public static System.Security.Cryptography.AsymmetricAlgorithm Create ();
[<System.Obsolete("The default implementation of this cryptography algorithm is not supported", DiagnosticId="SYSLIB0007", UrlFormat="https://aka.ms/dotnet-warnings/{0}")>]
static member Create : unit -> System.Security.Cryptography.AsymmetricAlgorithm
[<System.Obsolete("The default implementation of this cryptography algorithm is not supported.", DiagnosticId="SYSLIB0007", UrlFormat="https://aka.ms/dotnet-warnings/{0}")>]
static member Create : unit -> System.Security.Cryptography.AsymmetricAlgorithm
static member Create : unit -> System.Security.Cryptography.AsymmetricAlgorithm
Public Shared Function Create () As AsymmetricAlgorithm
戻り値
<cryptoClass> 要素を使用して既定の設定が変更されていない限り、新しい RSACryptoServiceProvider インスタンス。
- 属性
例外
.NET Core 2.0 - 3.1 および .NET 5 以降: すべての場合。
注釈
このメソッドは、.NET 5 以降のバージョンでは使用されていません。
例
次のコード例は、拡張クラスにメソッドを Create 実装する方法を示しています。 このコード例は、AsymmetricAlgorithm クラスのために提供されている大規模な例の一部です。
// 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)
非対称アルゴリズムの指定した実装のインスタンスを作成します。
public:
static System::Security::Cryptography::AsymmetricAlgorithm ^ Create(System::String ^ algName);
public static System.Security.Cryptography.AsymmetricAlgorithm? Create (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
使用する非対称アルゴリズムの実装。 algName
パラメーターの有効値、およびそれらの割り当て先のアルゴリズムを次の表に示します。
パラメーター値 | は |
---|---|
System.Security.Cryptography.AsymmetricAlgorithm | AsymmetricAlgorithm |
RSA | RSA |
System.Security.Cryptography.RSA | RSA |
DSA | DSA |
System.Security.Cryptography.DSA | DSA |
ECDsa | ECDsa |
ECDsaCng | ECDsaCng |
System.Security.Cryptography.ECDsaCng | ECDsaCng |
ECDH | ECDiffieHellman |
ECDiffieHellman | ECDiffieHellman |
ECDiffieHellmanCng | ECDiffieHellmanCng |
System.Security.Cryptography.ECDiffieHellmanCng | ECDiffieHellmanCng |
戻り値
指定した非対称アルゴリズムの実装の新しいインスタンス。
例
次のコード例は、拡張クラスにメソッドを Create 実装する方法を示しています。 このコード例は、AsymmetricAlgorithm クラスのために提供されている大規模な例の一部です。
// 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