<enforceFIPSPolicy > 元素<enforceFIPSPolicy> Element

指定是否强制执行以下计算机配置要求:加密算法必须符合美国联邦信息处理标准 (FIPS)。Specifies whether to enforce a computer configuration requirement that cryptographic algorithms must comply with the Federal Information Processing Standards (FIPS).

<配置 > 元素<configuration> Element
<运行时 > 元素<runtime> Element
<enforceFIPSPolicy > 元素<enforceFIPSPolicy> Element


<enforceFIPSPolicy enabled="true|false" />  

特性和元素Attributes and Elements

下列各节描述了特性、子元素和父元素。The following sections describe attributes, child elements, and parent elements.


特性Attribute 描述Description
enabledenabled 必需的特性。Required attribute.

指定是否启用强制执行的计算机配置要求,必须符合 FIPS 的加密算法。Specifies whether to enable the enforcement of a computer configuration requirement that cryptographic algorithms must be compliant with FIPS.

enabled 特性enabled Attribute

Value 描述Description
true 如果您的计算机配置为要求要符合 FIPS 的加密算法,则强制实施该要求。If your computer is configured to require cryptographic algorithms to be FIPS compliant, that requirement is enforced. 如果一个类实现一种算法,不符合 FIPS,构造函数或Create为该类的方法会引发异常,该计算机上运行时。If a class implements an algorithm that is not compliant with FIPS, the constructors or Create methods for that class throw exceptions when they are run on that computer. 这是默认设置。This is the default.
false 应用程序使用的加密算法不需要为符合 FIPS,而不考虑计算机配置。Cryptographic algorithms that are used by the application are not required to be compliant with FIPS, regardless of computer configuration.

子元素Child Elements


父元素Parent Elements

元素Element 描述Description
configuration 公共语言运行时和 .NET Framework 应用程序所使用的每个配置文件中的根元素。The root element in every configuration file used by the common language runtime and .NET Framework applications.
runtime 包含有关程序集绑定和垃圾回收的信息。Contains information about assembly binding and garbage collection.


从.NET Framework 2.0 开始,由计算机的配置控制的实现加密算法的类创建。Starting with the .NET Framework 2.0, the creation of classes that implement cryptographic algorithms is controlled by the configuration of the computer. 如果计算机配置为要求算法来为符合 FIPS,并且一个类实现不符合 FIPS 的算法,任何尝试创建该类的实例将引发异常。If the computer is configured to require algorithms to be compliant with FIPS, and a class implements an algorithm that is not compliant with FIPS, any attempt to create an instance of that class throws an exception. 构造函数引发InvalidOperationException异常,并Create方法抛出TargetInvocationException内部异常InvalidOperationException异常。Constructors throw an InvalidOperationException exception, and Create methods throw a TargetInvocationException exception with an inner InvalidOperationException exception.

如果你的应用程序在其配置要求符合 FIPS,计算机上运行并且你的应用程序使用不符合 FIPS 的算法,您可以使用此元素在配置文件中以防止公共语言运行时 (CLR) 从强制实施的 FIPS 符合性。If your application runs on computers whose configurations require compliance with FIPS, and your application uses an algorithm that is not compliant with FIPS, you can use this element in your configuration file to prevent the common language runtime (CLR) from enforcing FIPS compliance. 在.NET Framework 2.0 Service Pack 1 引入了此元素。This element was introduced in the .NET Framework 2.0 Service Pack 1.


下面的示例显示了如何防止 CLR 强制实施 FIPS 符合性。The following example shows how to prevent the CLR from enforcing FIPS compliance.

        <enforceFIPSPolicy enabled="false"/>  

请参阅See also