<enforceFIPSPolicy> 項目<enforceFIPSPolicy> Element

指定是否強制執行電腦設定需求,以便讓密碼編譯演算法符合美國聯邦資訊處理標準 (FIPS) 的規範。Specifies whether to enforce a computer configuration requirement that cryptographic algorithms must comply with the Federal Information Processing Standards (FIPS).



<enforceFIPSPolicy enabled="true|false" />  

屬性和項目Attributes and Elements

下列章節說明屬性、子元素和父元素。The following sections describe attributes, child elements, and parent elements.


屬性Attribute 描述Description
已啟用enabled 必要屬性。Required attribute.

指定是否要啟用電腦設定需求的強制執行密碼編譯演算法必須符合 FIPS。Specifies whether to enable the enforcement of a computer configuration requirement that cryptographic algorithms must be compliant with FIPS.

啟用屬性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 規範的演算法,您可以在設定檔中使用此元素,以防止 common language runtime (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