SymmetricAlgorithm.Create 方法

定义

创建用于执行对称算法的加密对象。

重载

Create()
已过时.
已过时.

创建用于执行对称算法的默认加密对象。

Create(String)
已过时.

创建用于执行对称算法的指定加密对象。

Create()

Source:
SymmetricAlgorithm.cs
Source:
SymmetricAlgorithm.cs
Source:
SymmetricAlgorithm.cs

注意

The default implementation of this cryptography algorithm is not supported

注意

The default implementation of this cryptography algorithm is not supported.

创建用于执行对称算法的默认加密对象。

C#
[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.SymmetricAlgorithm Create();
C#
[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.SymmetricAlgorithm Create();
C#
public static System.Security.Cryptography.SymmetricAlgorithm Create();

返回

用于执行对称算法的默认加密对象。

属性

例外

.NET Core 2.0 - 3.1 和 .NET 5 及更高版本:在所有情况下。

注解

此方法在 .NET 5 及更高版本中已过时。

建议通过调用 Create(String) 此方法的重载来指定算法。

另请参阅

适用于

.NET 9 和其他版本
产品 版本 (已过时)
.NET Core 2.0, Core 2.1, Core 2.2, Core 3.0, Core 3.1 (5, 6, 7, 8, 9)
.NET Framework 1.1, 2.0, 3.0, 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1
.NET Standard 2.0, 2.1

Create(String)

Source:
SymmetricAlgorithm.cs
Source:
SymmetricAlgorithm.cs
Source:
SymmetricAlgorithm.cs

注意

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

创建用于执行对称算法的指定加密对象。

C#
public static System.Security.Cryptography.SymmetricAlgorithm? Create(string algName);
C#
[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.SymmetricAlgorithm? Create(string algName);
C#
public static System.Security.Cryptography.SymmetricAlgorithm Create(string algName);

参数

algName
String

要使用的SymmetricAlgorithm 类的特定实现的名称。

返回

一个加密对象,用于执行对称算法。

属性

另请参阅

适用于

.NET 9 和其他版本
产品 版本 (已过时)
.NET Core 2.0, Core 2.1, Core 2.2, Core 3.0, Core 3.1, 5, 6 (7, 8, 9)
.NET Framework 1.1, 2.0, 3.0, 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1
.NET Standard 2.0, 2.1