ServerSideEncryption parameter when calling the API.cos.putObject({Bucket: 'examplebucket-1250000000', /* Your bucket name. Required. */Region: 'COS_REGION', /* Bucket region, such as `ap-beijing`. Required. */Key: '1.jpg', /* Object key stored in the bucket (such as `1.jpg` and `a/b/test.txt`). Required. */Body: 'hello!',ServerSideEncryption: 'AES256',}, function(err, data) {console.log(err || data);});
SSECustomerKey parameter when calling the API.cos.putObject({Bucket: 'examplebucket-1250000000', /* Your bucket name. Required. */Region: 'COS_REGION', /* Bucket region, such as `ap-beijing`. Required. */Key: '1.jpg', /* Object key stored in the bucket (such as `1.jpg` and `a/b/test.txt`). Required. */Body: 'hello!',SSECustomerAlgorithm: 'AES256',SSECustomerKey: 'MDEyMzQ1Njc4OUFCQ0RFRjAxMjM0NTY3ODlBQkNERUY',SSECustomerKeyMD5: 'U5L61r7jcwdNvT7frmUG8g==',}, function(err, data) {console.log(err || data);});
cos.putObject({Bucket: 'examplebucket-1250000000', /* Your bucket name. Required. */Region: 'COS_REGION', /* Bucket region, such as `ap-beijing`. Required. */Key: '1.jpg', /* Object key stored in the bucket (such as `1.jpg` and `a/b/test.txt`). Required. */Body: 'hello!',ServerSideEncryption: 'cos/kms', /* Required when you upload or copy objects (including simple upload/copy and multipart upload/copy). This header cannot be specified when you download objects */// SSEKMSKeyId: specifies the customer master key (CMK) of KMS. If this field is not specified, the default CMK created by COS will be used. For more information, please see "SSE-KMS Encryption".SSEKMSKeyId: 'xxxx', /* Enter your key. Optional. */// SSEContext: specifies the Base64-encoded encryption context (key-value pairs in JSON format)SSEContext: 'eyJhIjoiYXNkZmEiLCJiIjoiMTIzMzIxIn0=', /* Specify the encryption context (Base-64 encoding required). Optional. */}, function(err, data) {console.log(err || data);});
Feedback