amazon-web-services - AmazonS3Encryption 忽略提供的 EncryptionMaterials
问题描述
我正在尝试从 S3 检索加密对象(由 SES 放在那里)。
我不明白的是,无论我提供什么参数KMSEncryptionMaterialsProvider(x)
,对象都未加密并成功检索。
即使提供加密过程未使用的 CMK 也是可行的。
没有withEncryptionMaterials(x)
它会失败。
我误解了什么?
BasicAWSCredentials credentials = new BasicAWSCredentials(awsId, awsSecret);
CryptoConfiguration cryptoConf = new CryptoConfiguration()
.withAwsKmsRegion(RegionUtils.getRegion(Regions.EU_WEST_1.getName()));
AmazonS3Encryption s3Encryption = AmazonS3EncryptionClientBuilder
.standard()
.withRegion(Regions.EU_WEST_1)
.withCredentials(new AWSStaticCredentialsProvider(credentials))
.withCryptoConfiguration(cryptoConf)
//.withEncryptionMaterials(new SimpleMaterialProvider())
//.withEncryptionMaterials(new KMSEncryptionMaterialsProvider("aws/ses"))
//.withEncryptionMaterials(new KMSEncryptionMaterialsProvider("ses-dev-emaildrop"))
.build();
S3Object s3object = s3Client.getObject(new GetObjectRequest(bucketName, s3ObjKey));
解决方案
推荐阅读
- c# - 通过 X509Store 调用时,有效证书不再有效
- ssl - 结构化流式传输未能读取我的 MSK Kafka 并继续删除 executorsId
- java - 我在 Java 中实现“while”循环时遇到问题
- python - 硒获取我当前的位置“位置”
- typescript - Typescript:如何将导出的默认模块的类型动态推断为对象
- c# - 使用 ajax 调用时,RowGroup 不起作用
- java - Get module path not root path in Java
- sql-server - SQL Server - 存储大位掩码的最佳方式?
- r - 将xlsb文件的工作表列表导入R
- monaco-editor - 摩纳哥编辑器动态设置视区高度