我正在与Amazon一起使用最近发布的KMS服务,但在传递到时被忽略的Region引起了问题AmazonS3EncryptionClient
。
AmazonS3EncryptionClient s3 = new AmazonS3EncryptionClient(credentials,
new KMSEncryptionMaterialsProvider(keyId))
.withRegion(Region.getRegion(Regions.EU_WEST_1));
错误消息再次出现,表明尽管已将其US-East-1
主动设置为该区域,但仍无法在该区域中找到该密钥。EU-West-1
错误消息是
com.amazonaws.services.kms.model.NotFoundException:
Key 'arn:aws:kms:us-east-1:account#:key/mykeyname' does not exist (Service: AWSKMS;
Status Code: 400; Error Code: NotFoundException;
Request ID: 8fb90ad0-7644-11e4-bf12-0b5a59268629)
我找不到任何文档说明这是API中的特定错误,有什么建议吗?
尝试阅读此线程底部的评论/建议:
http://java.awsblog.com/post/Tx19OLB7M3D6DS8/S3-Encryption-with-AWS-Key-Management-Service
似乎已经发布了一个通过添加新参数来解决此问题的版本。
IE:
AmazonS3 s3 = new AmazonS3EncryptionClient(new DefaultAWSCredentialsProviderChain(),
new KMSEncryptionMaterialsProvider(customerMasterKeyId),
new CryptoConfiguration().withKmsRegion(Regions.fromName("us-west-2")));
本文收集自互联网,转载请注明来源。
如有侵权,请联系 [email protected] 删除。
我来说两句