PutBucketEncryption
Updated at:2025-11-03
API description
This API enables encryption for specified buckets.
Request
-
Request syntax
Plain Text1 PUT /?encryption HTTP/1.1 2 Host: <BucketName>.bj.bcebos.com 3 Date: <Date> 4 Authorization: <AuthorizationString> 5 Content-Length: <ContentLength> 6 { 7 "encryptionAlgorithm":"AES256" 8 } -
Request parameters
None
-
Request headers
| Name | Types | Description | Required or not |
|---|---|---|---|
| encryptionAlgorithm | String | The server-side encryption options for a specified bucket currently support AES256 and SM4 encryption. | Yes |
Response
-
Response element
None
-
Response headers
None
Example
-
Request example 1
Plain Text1 PUT /?encryption HTTP/1.1 2 Host: bucket.bj.bcebos.com 3 Date: Wed, 06 Apr 2016 06:34:40 GMT 4 Authorization: AuthorizationString 5 Content-Length: 11434 6 { 7 "encryptionAlgorithm":"AES256" 8 } -
Response example 1
Plain Text1 HTTP/1.1 200 OK 2 x-bce-request-id: 4db2b34d-654d-4d8a-b49b-3049ca786409 3 Date: Wed, 06 Apr 2016 06:34:40 GMT 4 Content-Length: 11434 5 Server: BceBos -
Request example 2
Plain Text1 PUT /?encryption HTTP/1.1 2 Host: bucket.bj.bcebos.com 3 Date: Thu, 16 Mar 2023 07:53:05 GMT 4 Authorization: AuthorizationString 5 Content-Length: 11431 6 { 7 "encryptionAlgorithm":"SM4" 8 } -
Response example 2
Plain Text1 HTTP/1.1 200 OK 2 x-bce-request-id: 4db2b34d-654d-4d8a-b49b-3049ca786409 3 Date: Thu, 16 Mar 2023 07:53:06 GMT 4 Content-Length: 11431 5 Server: BceBos
