/// <summary> /// /// </summary> /// <param name="customerKey"></param> public void SetCosServerSideEncryptionWithCustomerKey(string customerKey) { if (customerKey != null) { SetRequestHeader("x-cos-server-side-encryption-customer-algorithm", "AES256"); SetRequestHeader("x-cos-server-side-encryption-customer-key", DigestUtils.GetBase64(customerKey, Encoding.UTF8)); SetRequestHeader("x-cos-server-side-encryption-customer-key-MD5", DigestUtils.GetMd5ToBase64(customerKey, Encoding.UTF8)); } }
public void SetCosServerSideEncryptionWithKMS(string customerKeyID, string json) { SetRequestHeader("x-cos-server-side-encryption", "cos/kms"); if (customerKeyID != null) { SetRequestHeader("x-cos-server-side-encryption-cos-kms-key-id", customerKeyID); } if (json != null) { SetRequestHeader("x-cos-server-side-encryption-context", DigestUtils.GetBase64(json, Encoding.UTF8)); } }
public Dictionary <string, string> GetFormParameters() { Dictionary <string, string> formParameters = new Dictionary <string, string>(); if (acl != null) { formParameters.Add("Acl", acl); } foreach (KeyValuePair <string, string> pair in headers) { formParameters.Add(pair.Key, pair.Value); } formParameters.Add("key", key); if (successActionRedirect != null) { formParameters.Add("success_action_redirect", successActionRedirect); } if (successActionStatus != null) { formParameters.Add("success_action_status", successActionStatus); } foreach (KeyValuePair <string, string> pair in customHeaders) { formParameters.Add(pair.Key, pair.Value); } if (xCosStorageClass != null) { formParameters.Add("x-cos-storage-class", xCosStorageClass); } if (xCOSTrafficLimit != null) { formParameters.Add(CosRequestHeaderKey.X_COS_TRAFFIC_LIMIT, xCOSTrafficLimit); } if (policy != null) { formParameters.Add("policy", DigestUtils.GetBase64(policy.Content(), Encoding.UTF8)); } return(formParameters); }