예제 #1
0
        internal override RestRequest BuildRequest(RestRequest request)
        {
            if (this.EncryptionConfig == null)
            {
                this.EncryptionConfig = ServerSideEncryptionConfiguration.GetSSEConfigurationWithS3Rule();
            }
            request.AddQueryParameter("encryption", "");
            string body = utils.MarshalXML(this.EncryptionConfig, "http://s3.amazonaws.com/doc/2006-03-01/");

            request.AddParameter(new Parameter("text/xml", body, ParameterType.RequestBody));

            return(request);
        }
        internal override HttpRequestMessageBuilder BuildRequest(HttpRequestMessageBuilder requestMessageBuilder)
        {
            if (this.EncryptionConfig == null)
            {
                this.EncryptionConfig = ServerSideEncryptionConfiguration.GetSSEConfigurationWithS3Rule();
            }

            requestMessageBuilder.AddQueryParameter("encryption", "");
            string body = utils.MarshalXML(this.EncryptionConfig, "http://s3.amazonaws.com/doc/2006-03-01/");

            // Convert string to a byte array
            byte[] bodyInBytes = Encoding.ASCII.GetBytes(body);
            requestMessageBuilder.BodyParameters.Add("content-type", "text/xml");
            requestMessageBuilder.SetBody(bodyInBytes);

            return(requestMessageBuilder);
        }
예제 #3
0
 public SetBucketEncryptionArgs WithAESConfig()
 {
     this.EncryptionConfig = ServerSideEncryptionConfiguration.GetSSEConfigurationWithS3Rule();
     return(this);
 }