

本文為英文版的機器翻譯版本，如內容有任何歧義或不一致之處，概以英文版為準。

# KmsGrantConstraints
<a name="API_KmsGrantConstraints"></a>

使用此結構提議只在操作請求包含指定的[加密內容](https://docs.aws.amazon.com/kms/latest/developerguide/concepts.html#encrypt_context)時，才允許[授予中的密碼編譯](https://docs.aws.amazon.com/kms/latest/developerguide/concepts.html#cryptographic-operations)操作。您只能指定一種類型的加密內容。空白映射會視為未指定。如需詳細資訊，請參閱 [GrantConstraints](https://docs.aws.amazon.com/kms/latest/APIReference/API_GrantConstraints.html)。

## 目錄
<a name="API_KmsGrantConstraints_Contents"></a>

 ** encryptionContextEquals **   <a name="accessanalyzer-Type-KmsGrantConstraints-encryptionContextEquals"></a>
金鑰/值對的清單，必須符合[密碼編譯操作](https://docs.aws.amazon.com/kms/latest/developerguide/concepts.html#cryptographic-operations)請求中的加密內容。只有在請求中的加密內容與此限制中指定的加密內容相同時，授予才允許操作。  
類型：字串到字串映射  
必要：否

 ** encryptionContextSubset **   <a name="accessanalyzer-Type-KmsGrantConstraints-encryptionContextSubset"></a>
金鑰/值對的清單，必須包含在[密碼編譯操作](https://docs.aws.amazon.com/kms/latest/developerguide/concepts.html#cryptographic-operations)請求的加密內容中。只有在請求中的加密內容包含此限制中指定的金鑰值對時，授予才允許密碼編譯操作，但可以包含額外的金鑰值對。  
類型：字串到字串映射  
必要：否

## 另請參閱
<a name="API_KmsGrantConstraints_SeeAlso"></a>

如需在其中一種語言特定 AWS SDKs中使用此 API 的詳細資訊，請參閱下列內容：
+  [AWS 適用於 C\$1\$1 的 SDK](https://docs.aws.amazon.com/goto/SdkForCpp/accessanalyzer-2019-11-01/KmsGrantConstraints) 
+  [AWS 適用於 Java V2 的 SDK](https://docs.aws.amazon.com/goto/SdkForJavaV2/accessanalyzer-2019-11-01/KmsGrantConstraints) 
+  [AWS 適用於 Ruby V3 的 SDK](https://docs.aws.amazon.com/goto/SdkForRubyV3/accessanalyzer-2019-11-01/KmsGrantConstraints) 