AsymmetricAlgorithm.Create Método
Definición
Importante
Parte de la información hace referencia a la versión preliminar del producto, que puede haberse modificado sustancialmente antes de lanzar la versión definitiva. Microsoft no otorga ninguna garantía, explícita o implícita, con respecto a la información proporcionada aquí.
Crea un objeto criptográfico que se usa para realizar el algoritmo asimétrico.
Sobrecargas
| Nombre | Description |
|---|---|
| Create() |
Obsoletos.
Obsoletos.
Crea un objeto criptográfico predeterminado que se usa para realizar el algoritmo asimétrico. |
| Create(String) |
Obsoletos.
Crea una instancia de la implementación especificada de un algoritmo asimétrico. |
Create()
- Source:
- AsymmetricAlgorithm.cs
- Source:
- AsymmetricAlgorithm.cs
- Source:
- AsymmetricAlgorithm.cs
- Source:
- AsymmetricAlgorithm.cs
- Source:
- AsymmetricAlgorithm.cs
Precaución
The default implementation of this cryptography algorithm is not supported.
Precaución
The default implementation of this cryptography algorithm is not supported
Crea un objeto criptográfico predeterminado que se usa para realizar el algoritmo asimétrico.
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
Devoluciones
RSACryptoServiceProvider Nueva instancia, a menos que se haya cambiado la configuración predeterminada con el <elemento cryptoClass>.
- Atributos
Excepciones
.NET Core 2.0 - 3.1 y .NET 5 y versiones posteriores: en todos los casos.
Comentarios
Este método está obsoleto en .NET 5 y versiones posteriores.
Example
En el ejemplo de código siguiente se muestra cómo implementar el Create método en una clase extendida. Este ejemplo de código forma parte de un ejemplo más grande proporcionado para la AsymmetricAlgorithm clase .
// 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
Consulte también
Se aplica a
Create(String)
- Source:
- AsymmetricAlgorithm.cs
- Source:
- AsymmetricAlgorithm.cs
- Source:
- AsymmetricAlgorithm.cs
- Source:
- AsymmetricAlgorithm.cs
- Source:
- AsymmetricAlgorithm.cs
Precaución
Cryptographic factory methods accepting an algorithm name are obsolete. Use the parameterless Create factory method on the algorithm type instead.
Crea una instancia de la implementación especificada de un algoritmo asimétrico.
public:
static System::Security::Cryptography::AsymmetricAlgorithm ^ Create(System::String ^ algName);
[System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("The default algorithm implementations might be removed, use strong type references like 'RSA.Create()' instead.")]
[System.Obsolete("Cryptographic factory methods accepting an algorithm name are obsolete. Use the parameterless Create factory method on the algorithm type instead.", DiagnosticId="SYSLIB0045", UrlFormat="https://aka.ms/dotnet-warnings/{0}")]
public static System.Security.Cryptography.AsymmetricAlgorithm? Create(string algName);
public static System.Security.Cryptography.AsymmetricAlgorithm? Create(string algName);
[System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("The default algorithm implementations might be removed, use strong type references like 'RSA.Create()' instead.")]
public static System.Security.Cryptography.AsymmetricAlgorithm? Create(string algName);
public static System.Security.Cryptography.AsymmetricAlgorithm Create(string algName);
[<System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("The default algorithm implementations might be removed, use strong type references like 'RSA.Create()' instead.")>]
[<System.Obsolete("Cryptographic factory methods accepting an algorithm name are obsolete. Use the parameterless Create factory method on the algorithm type instead.", DiagnosticId="SYSLIB0045", UrlFormat="https://aka.ms/dotnet-warnings/{0}")>]
static member Create : string -> System.Security.Cryptography.AsymmetricAlgorithm
static member Create : string -> System.Security.Cryptography.AsymmetricAlgorithm
[<System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("The default algorithm implementations might be removed, use strong type references like 'RSA.Create()' instead.")>]
static member Create : string -> System.Security.Cryptography.AsymmetricAlgorithm
Public Shared Function Create (algName As String) As AsymmetricAlgorithm
Parámetros
- algName
- String
Implementación del algoritmo asimétrico que se va a usar. En la tabla siguiente se muestran los valores válidos para el algName parámetro y los algoritmos a los que se asignan.
| Valor del parámetro | Implementaciones |
|---|---|
| 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 |
Devoluciones
Nueva instancia de la implementación del algoritmo asimétrico especificado.
- Atributos
Ejemplos
En el ejemplo de código siguiente se muestra cómo implementar el Create método en una clase extendida. Este ejemplo de código forma parte de un ejemplo más grande proporcionado para la AsymmetricAlgorithm clase .
// 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