usingAmazon.S3;
usingAmazon.S3.Model;
namespaceCreatebucket { classProgram { staticvoidMain(string[]args) { varAk=""; varSk=""; varendpoint="http://s3.test.com"; varbucketName="";
AmazonS3ClientserviceClient=newAmazonS3Client(Ak,Sk, newAmazonS3Config{ServiceURL=endpoint});
try { GetBucketEncryptionResponsegetRes; GetBucketEncryptionRequestgetReq=newGetBucketEncryptionRequest { BucketName=bucketName }; getRes=serviceClient.GetBucketEncryptionAsync(getReq).GetAwaiter().GetResult(); foreach(ServerSideEncryptionRuleg_valueingetRes.ServerSideEncryptionConfiguration.ServerSideEncryptionRules) { Console.WriteLine(g_value.ServerSideEncryptionByDefault.ServerSideEncryptionAlgorithm); } } catch(AmazonS3Exceptione) { Console.WriteLine(e.Message); } } } } |