CryptoConfig.AddAlgorithm(Type, String[]) CryptoConfig.AddAlgorithm(Type, String[]) CryptoConfig.AddAlgorithm(Type, String[]) CryptoConfig.AddAlgorithm(Type, String[]) Method

定义

将一组名称添加到要用于当前应用程序域的算法映射。Adds a set of names to algorithm mappings to be used for the current application domain.

public:
 static void AddAlgorithm(Type ^ algorithm, ... cli::array <System::String ^> ^ names);
[System.Security.SecurityCritical]
public static void AddAlgorithm (Type algorithm, params string[] names);
static member AddAlgorithm : Type * string[] -> unit
Public Shared Sub AddAlgorithm (algorithm As Type, ParamArray names As String())

参数

algorithm
Type Type Type Type

要映射到的算法。The algorithm to map to.

names
String[]

要映射到该算法的名称的数组。An array of names to map to the algorithm.

异常

algorithmnames 参数为 nullThe algorithm or names parameter is null.

algorithm 不能从该程序集外部访问。algorithm cannot be accessed from outside the assembly.

- 或 --or- names 参数中的一个条目是空的或为 nullOne of the entries in the names parameter is empty or null.

注解

指定的映射优先于内置映射和 machine.config 文件中的映射。The specified mappings take precedence over the built-in mappings and the mappings in the machine.config file. 这些映射用于防止部分信任的代码使用受信任的加密操作。The mappings are used to prevent partially trust code from using trusted cryptographic operations.

安全性

SecurityCriticalAttribute
需要对直接调用方的完全信任。requires full trust for the immediate caller. 部分受信任的或透明的代码不能使用此成员。This member cannot be used by partially trusted or transparent code.

适用于