I am developing an application that will upload files to Amazon. Amazon provides
a method WithServerSideEncryptionMethod(ServerSideEncryptionMethod.AES256) to encrypt files but it is not working. It is saving text as a plain text.
public static void UploadFile()
{
new Program();
var key = "a";
//key = ReplaceDblSlashToSingleFwdSlash(key);
//path = ReplaceFwdSlashToBackSlash(path);
var request = new PutObjectRequest();
request.WithBucketName("demo")
.WithContentBody("i am achal kumar")
.WithKey(key)
.WithServerSideEncryptionMethod(ServerSideEncryptionMethod.AES256);
//request.PutObjectProgressEvent += displayFileProgress;
S3Response response = s3Client.PutObject(request);
response.Dispose();
}
you can use the following code to check if the is encrypted or not .. because aws s3 they already decrypt the object when they return it to you.
so try the following code to check if the object is encrypted on amazon s3
i hope this could help