1
votes

I am trying to upload an xml file to Amazon S3 with Server side encrytion using KMS key using SSEKMSKeyId, but i am getting the below Error

"Server Side Encryption with AWS KMS managed key requires HTTP header x-amz-server-side-encryption : aws:kms"

I am not able to find a way to pass http header with uploadrequest.

Below is the code i am using

AWSS3TransferManagerUploadRequest *uploadRequest = [AWSS3TransferManagerUploadRequest new];

uploadRequest.SSEKMSKeyId=KMSKey;

uploadRequest.body = body;

uploadRequest.key = key;

uploadRequest.bucket = S3BucketName;

[self upload:uploadRequest];

Can someone please help me in resolving this issue.

Thanks Varun

1
The current version of AWS Mobile SDK for iOS doesn't work with KMS. We will add this feature in our next release. Thanks. - Yi Zhu

1 Answers

1
votes

We've just released AWS Mobile SDK for iOS 2.2.6 which supports KMS server-side encryption.

You can enable it by using the following line:

uploadRequest.serverSideEncryption = AWSS3ServerSideEncryptionAwsKms;