

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

# 使用服务器端加密设置 Amazon SNS 主题
<a name="queue-notification-sns-sse"></a>

您可以使用服务器端加密 (SSE)，采用加密主题的方式传输敏感数据。SSE 使用在 AWS Key Management Service ()AWS KMS中管理的密钥保护 Amazon SNS 主题中的消息内容。有关 Amazon S3 如何执行加密的更多信息，请参阅 *Amazon Simple Storage Service 开发人员指南*中的[使用服务器端加密保护数据](https://docs.aws.amazon.com/sns/latest/dg/sns-server-side-encryption.html)。

要使用服务器端加密设置 SNS 主题，请查看下面的主题：
+ 《AWS Key Management Service 开发人员指南》**中的[创建密钥](https://docs.aws.amazon.com/kms/latest/developerguide/create-keys.html)。
+ 将 S *imple Notification Service 开发人员指南*[中的主题启用 SSE](https://docs.aws.amazon.com/sns/latest/dg/sns-enable-encryption-for-topic.html)

创建 KMS 密钥时，请使用以下 KMS 密钥策略：

```
{ 
  "Effect": "Allow", 
  "Principal": { 
    "Service": "gamelift.amazonaws.com" 
  },
  "Action": [
      "kms:Decrypt",
      "kms:GenerateDataKey"
  ],
  "Resource": "*",
  "Condition": {
      "ArnLike": { 
        "aws:SourceArn": "arn:aws:gamelift:your_region:your_account:matchmakingconfiguration/your_configuration_name" 
      },
      "StringEquals": { 
        "kms:EncryptionContext:aws:sns:topicArn": "arn:aws:sns:your_region:your_account:your_sns_topic_name" 
      }
  }
}
```