Help Center/ Object Storage Service/ Tools Guide/ obsutil/ Bucket Commands/ Configuring Encryption for a Bucket
Updated on 2026-09-20 GMT+08:00

Configuring Encryption for a Bucket

Function

You can use this command to configure encryption for a bucket.

Constraints

Command Line Structure

  • Windows
    obsutil encryption obs://bucket -method=put -localfile=xxx [-config=xxx] [-e=xxx] [-i=xxx] [-k=xxx] [-t=xxx]
  • macOS or Linux
    ./obsutil encryption obs://bucket -method=put -localfile=xxx [-tagN keyN=valueN] [-config=xxx] [-e=xxx] [-i=xxx] [-k=xxx] [-t=xxx]

Examples

  • In Windows, run obsutil encryption obs://test-bucket -method=put -localfile=d:\temp\encryption.xml to configure encryption for bucket test-bucket using the encryption.xml file.
    obsutil encryption obs://test-bucket -method=put -localfile=d:\temp\encryption.xml
    
    Start at 2024-09-30 07:59:28.8675681 +0000 UTC
    
    Put encryption configuration succeed for bucket [test-bucket], requestId is [000001997666389E4016EA797FAC6033]

Parameter Description

Parameter

Optional or Mandatory

Description

bucket

Mandatory

The bucket name

method

Mandatory

The method. Set it to get when you set the encryption configuration of a bucket.

localfile

Mandatory

The path of the bucket's encryption configuration file to be imported

config

Optional (additional parameter)

The user-defined configuration file for executing the current command. For details about parameters that can be configured, see Configuration Parameters.

e

Optional (additional parameter)

The endpoint

i

Optional (additional parameter)

The user's AK

k

Optional (additional parameter)

The user's SK

t

Optional (additional parameter)

The user's security token

Helpful Links