Share via


AsymmetricAlgorithm.Create Yöntem

Tanım

Asimetrik algoritmayı gerçekleştirmek için kullanılan bir şifreleme nesnesi oluşturur.

Aşırı Yüklemeler

Create()
Geçersiz.
Geçersiz.

Asimetrik algoritmayı gerçekleştirmek için kullanılan varsayılan bir şifreleme nesnesi oluşturur.

Create(String)
Geçersiz.

Asimetrik algoritmanın belirtilen uygulamasının bir örneğini oluşturur.

Create()

Kaynak:
AsymmetricAlgorithm.cs
Kaynak:
AsymmetricAlgorithm.cs
Kaynak:
AsymmetricAlgorithm.cs

Dikkat

The default implementation of this cryptography algorithm is not supported

Dikkat

The default implementation of this cryptography algorithm is not supported.

Asimetrik algoritmayı gerçekleştirmek için kullanılan varsayılan bir şifreleme nesnesi oluşturur.

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

Döndürülenler

CryptoClass> öğesiyle< varsayılan ayarlar değiştirilmediği sürece yeni RSACryptoServiceProvider bir örnek.

Öznitelikler

Özel durumlar

.NET Core 2.0 - 3.1 ve .NET 5 ve üzeri: Her durumda.

Açıklamalar

Bu yöntem .NET 5 ve sonraki sürümlerde kullanımdan kaldırıldı.

Örnek

Aşağıdaki kod örneği, genişletilmiş bir sınıfta yönteminin Create nasıl uygulanduğunu gösterir. Bu kod örneği, sınıfı için AsymmetricAlgorithm sağlanan daha büyük bir örneğin parçasıdır.

    // 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

Ayrıca bkz.

Şunlara uygulanır

Create(String)

Kaynak:
AsymmetricAlgorithm.cs
Kaynak:
AsymmetricAlgorithm.cs
Kaynak:
AsymmetricAlgorithm.cs

Dikkat

Cryptographic factory methods accepting an algorithm name are obsolete. Use the parameterless Create factory method on the algorithm type instead.

Asimetrik algoritmanın belirtilen uygulamasının bir örneğini oluşturur.

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

Parametreler

algName
String

Kullanılacak asimetrik algoritma uygulaması. Aşağıdaki tabloda parametrenin algName geçerli değerleri ve eşledikleri algoritmalar gösterilmektedir.

Parametre değeri Uygulamalar
System.Security.Cryptography.AsimmetricAlgorithmAsymmetricAlgorithm
RSARSA
System.Security.Cryptography.RSARSA
DSADSA
System.Security.Cryptography.DSADSA
EcdsaECDsa
EcdsacngECDsaCng
System.Security.Cryptography.ECDsaCngECDsaCng
ECDHECDiffieHellman
EcdiffiehellmanECDiffieHellman
ECDiffieHellmanCngECDiffieHellmanCng
System.Security.Cryptography.ECDiffieHellmanCngECDiffieHellmanCng

Döndürülenler

Belirtilen asimetrik algoritma uygulamasının yeni bir örneği.

Öznitelikler

Örnekler

Aşağıdaki kod örneği, genişletilmiş bir sınıfta yönteminin Create nasıl uygulanduğunu gösterir. Bu kod örneği, sınıfı için AsymmetricAlgorithm sağlanan daha büyük bir örneğin parçasıdır.

    // 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

Ayrıca bkz.

Şunlara uygulanır