

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

# 创建客户托管的密钥
<a name="health-scribe-encryption-customer"></a>

 您可以使用 AWS 管理控制台、或，创建对称的客户托管密钥。 AWS KMS APIs要创建对称客户托管密钥，请按照《 AWS Key Management Service 开发人员指南》中[创建对称客户托管密钥](https://docs.aws.amazon.com//kms/latest/developerguide/create-keys.html#create-symmetric-cmk)的步骤进行操作。

密钥政策控制对客户托管密钥的访问。每个客户托管式密钥必须只有一个密钥策略，其中包含确定谁可以使用密钥以及如何使用密钥的声明。创建客户托管式密钥时，可以指定密钥策略。有关更多信息，请参阅《 AWS Key Management Service 开发人员指南》中的[管理客户托管密钥的访问权限](https://docs.aws.amazon.com//kms/latest/developerguide/control-access-overview.html#managing-access)。

## AWS KMS 的关键政策 AWS HealthScribe
<a name="health-scribe-key-policies"></a>

 如果您使用的是与您在请求中[StartMedicalScribeJob](https://docs.aws.amazon.com//transcribe/latest/APIReference/API_StartMedicalScribeJob.html)或[StartMedicalScribeStream](https://docs.aws.amazon.com/transcribe/latest/APIReference/API_streaming_StartMedicalScribeStream.html)请求`DataAccessRole`中指定的 IAM 角色相同的账户`ResourceAccessRole`中的密钥，则无需更新密钥政策。要将其他账户中的客户托管密钥用作您的 DataAccessRole （用于转录作业）或 ResourceAccessRole （用于直播），您必须信任密钥政策中的相应角色才能执行以下操作：
+ [https://docs.aws.amazon.com//kms/latest/APIReference/API_Encrypt.html](https://docs.aws.amazon.com//kms/latest/APIReference/API_Encrypt.html) - 允许使用客户管理型密钥进行加密
+ [https://docs.aws.amazon.com//kms/latest/APIReference/API_Decrypt.html](https://docs.aws.amazon.com//kms/latest/APIReference/API_Decrypt.html) - 允许使用客户管理型密钥进行解密
+ [https://docs.aws.amazon.com//kms/latest/APIReference/API_DescribeKey.html](https://docs.aws.amazon.com//kms/latest/APIReference/API_DescribeKey.html)— 提供客户管理的密钥详细信息 AWS HealthScribe 以允许验证密钥

以下是密钥策略示例，您可以使用该策略向 ResourceAccessRole 跨账户授予使用客户托管密钥进行 AWS HealthScribe 直播的权限。要将此策略用于转录作业，请更新`Principal`以使用 AR DataAccessRole N，然后移除或修改加密上下文。

------
#### [ JSON ]

****  

```
{
   "Version":"2012-10-17",		 	 	 
   "Statement":[
      {  
         "Sid": "AllowAccessForKeyAdministrators", 
         "Effect": "Allow", 
         "Principal": {
            "AWS": "arn:aws:iam::111122223333:root" 
         }, 
         "Action": [
           "kms:*" 
         ], 
         "Resource": "*"
      },
      {
         "Sid": "AllowAccessToResourceAccessRoleForMedicalScribe",
         "Effect": "Allow",
         "Principal": {
            "AWS": "arn:aws:iam::111122223333:role/ResourceAccessRole"
         },
         "Action": [
            "kms:Encrypt",
            "kms:Decrypt",
            "kms:GenerateDataKey*"
         ],
         "Resource": "*",
         "Condition": {
            "StringEquals": {
                "kms:EncryptionContext:aws:us-east-1:transcribe:medical-scribe:session-id": "1234abcd-12ab-34cd-56ef-123456SAMPLE"
            }
         }
      },
      {
         "Sid": "AllowAccessToResourceAccessRoleForDescribeKey",
         "Effect": "Allow",
         "Principal": {
             "AWS": "arn:aws:iam::111122223333:role/ResourceAccessRole"
         },
         "Action": "kms:DescribeKey",
         "Resource": "*"
     }
   ]
}
```

------

## 适用于访问角色的 IAM 策略权限
<a name="health-scribe-key-data-access-role"></a>

 无论客户管理的密钥和角色是在相同账户还是不同账户中，您 DataAccessRole 或都 ResourceAccessRole 必须授予执行必要 AWS KMS 操作的 IAM 策略。此外，角色的信任策略必须授予代入该角色的 AWS HealthScribe 权限。

以下 IAM 策略示例显示了如何授予 AWS HealthScribe 直播 ResourceAccessRole 权限。要将此策略用于转录作业，请将 `transcribe.streaming.amazonaws.com` 替换为 `transcribe.amazonaws.com`，然后删除或修改加密上下文。

------
#### [ JSON ]

****  

```
{
    "Version":"2012-10-17",		 	 	 
    "Statement": [
        {
            "Effect": "Allow",
            "Action": [
                "kms:Encrypt",
                "kms:Decrypt",
                "kms:GenerateDataKey*"
            ],
            "Resource": "arn:aws:kms:us-west-2:111122223333:key/KMS-Example-KeyId",
            "Condition": {
                "StringEquals": {
                    "kms:ViaService": "transcribe.streaming.amazonaws.com",
                    "kms:EncryptionContext:aws:us-east-1:transcribe:medical-scribe:session-id": "1234abcd-12ab-34cd-56ef-123456SAMPLE"
                }
            }
        },
        {
            "Effect": "Allow",
            "Action": [
                "kms:DescribeKey"
            ],
            "Resource": "arn:aws:kms:us-west-2:111122223333:key/KMS-Example-KeyId",
            "Condition": {
                "StringEquals": {
                    "kms:ViaService": "transcribe.streaming.amazonaws.com"
                }
            }
        }
    ]
}
```

------

以下是的信任策略示例 ResourceAccessRole。对于 DataAccessRole，请`transcribe.streaming.amazonaws.com`替换为`transcribe.amazonaws.com`。

------
#### [ JSON ]

****  

```
{
    "Version":"2012-10-17",		 	 	 
    "Statement": [
        {
            "Effect": "Allow",
            "Principal": {
                "Service": "transcribe.streaming.amazonaws.com"
            },
            "Action": "sts:AssumeRole",
            "Condition": {
                "StringEquals": {
                    "aws:SourceAccount": "111122223333"
                },
                "ArnLike": {
                    "aws:SourceArn": "arn:aws:transcribe:us-west-2:111122223333:*"
                }
            }
        }
    ]
}
```

------

 有关在[策略中指定权限](https://docs.aws.amazon.com//kms/latest/developerguide/control-access-overview.html#overview-policy-elements)或对[密钥访问进行故障排除](https://docs.aws.amazon.com//kms/latest/developerguide/policy-evaluation.html#example-no-iam)的更多信息，请参阅《 AWS Key Management Service 开发者指南》。