AsymmetricAlgorithm.Create Metodo
Definizione
Importante
Alcune informazioni sono relative alla release non definitiva del prodotto, che potrebbe subire modifiche significative prima della release definitiva. Microsoft non riconosce alcuna garanzia, espressa o implicita, in merito alle informazioni qui fornite.
Crea un oggetto di crittografia usato per eseguire l'algoritmo asimmetrico.
Overload
Create() |
Obsoleti.
Obsoleti.
Crea un oggetto predefinito di crittografia usato per eseguire l'algoritmo asimmetrico. |
Create(String) |
Obsoleti.
Crea un'istanza dell'implementazione specificata di un algoritmo asimmetrico. |
Create()
- Origine:
- AsymmetricAlgorithm.cs
- Origine:
- AsymmetricAlgorithm.cs
- Origine:
- AsymmetricAlgorithm.cs
Attenzione
The default implementation of this cryptography algorithm is not supported
Attenzione
The default implementation of this cryptography algorithm is not supported.
Crea un oggetto predefinito di crittografia usato per eseguire l'algoritmo asimmetrico.
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
Restituisce
Nuova istanza di RSACryptoServiceProvider, a meno che le impostazioni predefinite non siano state modificate tramite l'elemento <cryptoClass>.
- Attributi
Eccezioni
.NET Core 2.0 - 3.1 e .NET 5 e versioni successive: in tutti i casi.
Commenti
Questo metodo è obsoleto in .NET 5 e versioni successive.
Esempio
Nell'esempio di codice seguente viene illustrato come implementare il Create metodo in una classe estesa. Questo esempio di codice fa parte di un esempio più ampio fornito per la AsymmetricAlgorithm classe .
// 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
Vedi anche
Si applica a
Create(String)
- Origine:
- AsymmetricAlgorithm.cs
- Origine:
- AsymmetricAlgorithm.cs
- Origine:
- AsymmetricAlgorithm.cs
Attenzione
Cryptographic factory methods accepting an algorithm name are obsolete. Use the parameterless Create factory method on the algorithm type instead.
Crea un'istanza dell'implementazione specificata di un algoritmo asimmetrico.
public:
static System::Security::Cryptography::AsymmetricAlgorithm ^ Create(System::String ^ algName);
public static System.Security.Cryptography.AsymmetricAlgorithm? Create (string algName);
[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);
static member Create : string -> System.Security.Cryptography.AsymmetricAlgorithm
[<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
Public Shared Function Create (algName As String) As AsymmetricAlgorithm
Parametri
- algName
- String
L'implementazione dell'algoritmo asimmetrico da usare. La tabella seguente illustra i valori validi per il parametro algName
e gli algoritmi a cui sono mappati.
Valore del parametro | implementa |
---|---|
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 |
Restituisce
Nuova istanza dell'implementazione dell'algoritmo asimmetrico specificato.
- Attributi
Esempio
Nell'esempio di codice seguente viene illustrato come implementare il Create metodo in una classe estesa. Questo esempio di codice fa parte di un esempio più ampio fornito per la AsymmetricAlgorithm classe .
// 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