View a markdown version of this page

查看授权 - Amazon Key Management Service
Amazon Web Services 文档中描述的 Amazon Web Services 服务或功能可能因区域而异。要查看适用于中国区域的差异,请参阅 中国的 Amazon Web Services 服务入门 (PDF)

本文属于机器翻译版本。若本译文内容与英语原文存在差异,则一律以英文原文为准。

查看授权

要查看授权,请使用ListGrants操作。您必须指定授权所适用的 KMS 密钥。您还可以按授权 ID、被授权人委托人或被授权人服务主体筛选授权列表。有关更多示例,请参阅ListGrants与 Amazon SDK 或 CLI 配合使用

要查看 Amazon Web Services 账户 和地区中具有特定退休本金或即将退休服务本金的所有补助金,请使用。ListRetirableGrants响应包括每项授权的详细信息。

注意

ListGrants 响应中的 GranteePrincipal 字段通常包含授权的被授权者委托人。但是,当赠款中的受赠方委托人是 Amazon 服务时,该GranteePrincipal字段包含服务委托人,它可能代表几个不同的受赠方委托人。

注意

使用GranteeServicePrincipal参数创建授权时,ListGrants响应中会包含一个GranteeServicePrincipal字段,而不是GranteePrincipal。这将明确GranteeServicePrincipal为 Amazon 服务委托人设立的补助金与在GranteePrincipal实地代表 Amazon 服务的补助金区分开来。

例如,以下命令列出 KMS 密钥的所有授权。

$ aws kms list-grants --key-id 1234abcd-12ab-34cd-56ef-1234567890ab { "Grants": [ { "KeyId": "arn:aws:kms:us-west-2:111122223333:key/1234abcd-12ab-34cd-56ef-1234567890ab", "CreationDate": 1572216195.0, "GrantId": "abcde1237f76e4ba7987489ac329fbfba6ad343d6f7075dbd1ef191f0120514a", "Constraints": { "EncryptionContextSubset": { "Department": "IT" } }, "RetiringPrincipal": "arn:aws:iam::111122223333:role/adminRole", "Name": "", "IssuingAccount": "arn:aws:iam::111122223333:root", "GranteePrincipal": "arn:aws:iam::111122223333:user/exampleUser", "Operations": [ "Decrypt" ] } ] }

以下示例显示了使用创建的拨款的ListGrants响应GranteeServicePrincipal。请注意,响应中包含一个GranteeServicePrincipal字段而不是字段GranteePrincipal,并且该Constraints字段包含一个SourceArn值。

$ aws kms list-grants --key-id 1234abcd-12ab-34cd-56ef-1234567890ab { "Grants": [ { "KeyId": "arn:aws:kms:us-west-2:111122223333:key/1234abcd-12ab-34cd-56ef-1234567890ab", "CreationDate": 1718567315.0, "GrantId": "abcde1237f76e4ba7987489ac329fbfba6ad343d6f7075dbd1ef191f0120514a", "Constraints": { "EncryptionContextSubset": { "Department": "IT" }, "SourceArn": "arn:aws:dynamodb:us-east-1:111122223333:table/ExampleTable" }, "RetiringServicePrincipal": "service-name.amazonaws.com", "Name": "", "IssuingAccount": "arn:aws:iam::111122223333:root", "GranteeServicePrincipal": "service-name.amazonaws.com", "Operations": [ "Encrypt", "Decrypt", "GenerateDataKey" ] } ] }